cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Pause Workflow Until Another Workflows' Tasks are Completed

Hi all

 

Just wondering if anyone has done anything like this before. The scenario I have is:

  • User enters data into a repeater field of a form
  • Each item in the repeater field would become a task item for other users
  • The WF cannot continue until all the tasks have been completed.

The solution I have come up with is:

  • Main WF looks up the main list
  • Creates entries for each repeater item into a secondary list - one of the fields is a reference to the item ID of the main form in the main list
  • Main WF kicks off secondary WF in the secondary list to run on each item (secondary WF = approval WF for each item)
  • Main WF goes into sleep until all the tasks from the secondary list are completed

The only thing I can think of is to have a tertiary WF that goes in to periodically check if the tasks associated with a particular item ID (referring to the main form ID).

 

Is there another solution that I can use?

 

Thanks

Labels: (2)
0 Kudos
Reply
3 Replies
Highlighted
Nintex Newbie

Re: Pause Workflow Until Another Workflows' Tasks are Completed

I'd use only a main wf running parallel tasks.

The "Parallel" action will not finish until all tasks are completed

0 Kudos
Reply
Not applicable

Re: Pause Workflow Until Another Workflows' Tasks are Completed

Hi Fernando

This may have worked - but we dont know how many tasks to create at design time - I don't know if we can create new branch for Parallel actions at runtime. So this may not work.

Here is a solution I thought of instead of creating another WF:

  • When the main WF creates an item in the secondary list (1 for every item in the repeater section), I have a WF Collection variable that stores all the newly created items' IDs.
  • In my For each loop, I am reading the XML for the repeater, creating a new item in the secondary list and kicking off the secondary WF.
  • Once all the individual approval items have been created, I change the state to go into a "Wait for all tasks to be completed" state.
  • In this state, I firstly pause the WF for 1 hour. Then I loop through and look up the secondary WF status field and check if that is completed (status == '5') for each item.
  • If the status field == 5 (for completed), i remove the List ID from the collection. If number of items in collection == 0, I change state to "Completing WF" to send the last email before completing.
  • If the status is not completed, I go back to the top of the state machine (go to the same state) and put the WF to sleep for an hour and so on.

What do you think? If anyone can see a way to optimise this further, please let me know. 

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Pause Workflow Until Another Workflows' Tasks are Completed

I would store the Task-IDs of the generated Tasks an after creating the Tasks I would check alle the Task-IDs if their tasks are finished, either within the same workflow or in a seperate one. After all tasks with the stored Task IDs are finished, I'd proceed with the next logic.

0 Kudos
Reply