Custom Workflow Step - Wait | Community
Skip to main content
crich2784
May 26, 2022

Custom Workflow Step - Wait

  • May 26, 2022
  • 1 reply
  • 750 views

 

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,

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Mayank_Gandhi
Adobe Employee
Adobe Employee
May 27, 2022

@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.

crich2784
crich2784Author
May 31, 2022

@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.