Hello.
Is it possible to control Scheduler activity with Javascript?
Example: Use Javascript to get the first Monday (Javascript is prepared) and reflect them in the scheduler.
Example: Use Javascript to get business or non-business days from your company's own calendar (Javascript is prepared) and reflect them in the scheduler.
If Javascript condition is met, the transition will be enabled, otherwise it will be disabled.
Thank you.
Views
Replies
Total Likes
Actually, you don't need a scheduler activity to do this.
Just use the Advanced javascript activity and enable the transition. If your condition met then run the workflow else divert the transition to the end activity.
The advanced javascript activity config will look like this.
and the workflow will look like this.
Let me know if that helps.
Views
Replies
Total Likes
@_Manoj_Kumar_, Thank you for reply.
I understood that Advanced JS can branch judgments.
Is usage of Advanced JS correct in the following?
//First call
if(Today is first Monday and business day){
task.postEvent(task.transitionByName("ok"));
}else{
task.postEvent(task.transitionByName("no"));
}
task.setCompleted();
//Next call
return 0;
And, Is there no choice but to start the scheduler every day and use JS to determine the business day?
Thanks.
Views
Replies
Total Likes
Hi @uz2020
For the first case, just use the scheduler, by selecting monthly, you have first Monday option
For your second case: if your calendar is accessible through API, you can do some api call to it and parse the response if it's a business day or not.
other choice instead of running permanently a scheduler is to calculate the condition from an external system and trigger the workflow with a signal.
Thanks,
David
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi @uz2020,
Were you able to resolve this query or do you still need more help here? Do let us know.
Thanks!
Views
Replies
Total Likes