Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

Advanced JavaScript Activity

Avatar

Level 2

Hi team,

 

1) Anyone help me What is the use of Advanced JS activity in Adobe Campaign Classic?

2) What is the use of First call and next calls?

3) what is task.setCompleted();

4) what is return 0 in both calls?

 

please any one help me any share use case for clarify this question?

@ParthaSarathy 

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi @Kumar_27,

 

The First Call is the code base which will be executed at each start of the workflow.

 

The next call is the code which will run post the first call. If you are using the scheduler functionality in the Advanced Javascript, then first run of the Advanced JS will trigger the First Call code block and then Next call.

 

Subsequent runs triggered by scheduler within Advanced JS will trigger only the next call and not the first call.

 

Transitions similar to split help to change the flow of data based on some inputs which can be configured programmatically. For transitions consider the following example:

 

var input = 1;
if(input == 1)
{
task.postEvent(task.transitionByName('ok'));
}
else
{
task.postEvent(task.transitionByName('notOk'));
}

 

As we see in the above example, the code will evaluate to give output to the 'Ok' transition and hence the workflow will move towards 'Ok' transition.

 

If the value of input was any numeric value other than 1, then the workflow will move to notOk transition.

 

Refer to following link for more info:

 

https://blog.floriancourgey.com/2018/06/how-to-specify-the-transition-in-an-advanced-javascript-code...

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

Hi @Kumar_27,

 

The First Call is the code base which will be executed at each start of the workflow.

 

The next call is the code which will run post the first call. If you are using the scheduler functionality in the Advanced Javascript, then first run of the Advanced JS will trigger the First Call code block and then Next call.

 

Subsequent runs triggered by scheduler within Advanced JS will trigger only the next call and not the first call.

 

Transitions similar to split help to change the flow of data based on some inputs which can be configured programmatically. For transitions consider the following example:

 

var input = 1;
if(input == 1)
{
task.postEvent(task.transitionByName('ok'));
}
else
{
task.postEvent(task.transitionByName('notOk'));
}

 

As we see in the above example, the code will evaluate to give output to the 'Ok' transition and hence the workflow will move towards 'Ok' transition.

 

If the value of input was any numeric value other than 1, then the workflow will move to notOk transition.

 

Refer to following link for more info:

 

https://blog.floriancourgey.com/2018/06/how-to-specify-the-transition-in-an-advanced-javascript-code...