Delay next workflow usertask, instead of starting directly after completing previous task

0
What's best practice to implement a delay with a workflow usertask if you don't want it to show up immediately after the previous one in the workflow is completed?    For context, I'm developing a process that includes the legal requirement of waiting 7 days before the next action can be taken. Therefor I don't want to have the next usertask to show up in the 'my tasks' list of the related users. How would I ensure the next task doesn't show up, by either delay it's creation or perhaps pause the workflow progress?   I might achieve this using an AfterCreate microflow on the new user task that pauses the task and, with help of a scheduled event, resumes the user task to let it appear in the task list. Though I'm also a little afraid that relying on a scheduled event here might be prone to errors.
asked
1 answers
1

Hi Sander

 

Maybe use a decision in your workflow where you validate if the time has exceeded. If it is not the case:

  • you could set certain context values
  • the workflow on pause
  • jump back to the decision as failsafe so when the workflow get's unpaused it will be validated again

From there on you can check based on the context that has been set with a scheduled event if the time has exceeded. If that's the case you unpause the workflow. 

 

Why with a decision and jumpback? The decision in the workflow makes it transparent that there is some sort of check on something to proceed the flow. The jumpback as mentioned is as failsafe to validate if it's get unpaused it will meet the requirements to proceed if not it will return paused till it meets the requirements. 

 

Also good to mention, in version 10 you have additional functionalities that are sadly not in 9:

https://docs.mendix.com/refguide/workflow-boundary-events/

https://docs.mendix.com/refguide/wait-for-notification/

 

Quick example of above mentioned logic:

image.png

answered