Wait for condition with Iteration

martin_chabarri
Mega Expert

Hello!

I have a workflow that has a catalog task that must expire. I need this task to have a limit of 24 hours, and then close if the state is not closed. However, should the task be closed within 24 hours, I would like the workflow to proceed.

I have set the task to not wait for completion and put a timer for 1 day after the task, however this does not account for the task being completed before 24 hours.

I would need to check the state for 24 hrs., and if state not closed = yes, keep iterating until the state is closed. The problem lies in wanting the task to auto close after 24 hrs. if it has not been closed by the fulfillment group.

Any help would be greatly appreciated.

4 REPLIES 4

TJW2
Mega Guru

What if you did a 'Separate line' in your WF
- timer to wait 24hrs
- Run Script to check if task 'closed'. If closed ignore; if NOT close task, iterate.


martin_chabarri
Mega Expert

The concern I have with this method is what if the task was closed prior to 24 hrs? The timer would then force it wait regardless.


I'm thinking 2 lines:
One with your task (if closed it would move on as normal).
The other with your 'wait for 24'; after the wait you would need to check if the task in the other line was closed.

See attached jpg


martin_chabarri
Mega Expert

Was able to create a working solution using parallel tasks, as you suggested, and a scratchpad variable to check.

Please see attached.

thank you for your help