Expand my Community achievements bar.

Custom Workflow Step - Wait

Avatar

Level 7

 

We are contemplating a custom workflow step that will "wait x number of business days".

 

Is it possible to create a workflow step to "block" the workflow like this?  Or would I merely need to create a loop and sleep in the loop?

What happens when the server is restarted?  Would the component start over?  Will I need to save state so, it doesn't restart the wait from the beginning?

 

I recognize that this can be handled in different ways but, I'm interested in encapsulating this function into a custom component for design reasons.

 

Any advice would be appreciated.

 

Thanks,

2 Replies

Avatar

Employee Advisor

@crich2784 I think you're on right track, you will need to preserve a state. I would have taken the server timestamp and kept payload and data and then initiated a WF modal with assign task using a cron job, the cron should run daily and should put all the pending tasks to assign task workflow after x days post the last timestamp that was preserved.

Avatar

Level 7

@Mayank_Gandhi I have this working pretty well but, I have one major flaw.

 

My component basically does a while(true) loop until it is time to end.  Now, when I try to terminate the process or step, the system hangs.  My component is not giving the system time to terminate.  It's blocking everything.  How can I make this step wait and wakeup.  Maybe this is what you were talking about with the cron job - I really don't understand.  Seems like I should be able to end the component but, not allow the workflow to continue until I'm ready?  This would be similar to the Assign Task step - I can terminate a process even when it's on the Assign Task step.