Multiple parallel workflow assignees

0
Hi,   I’m trying to create a workflow that will create an approve/reject task for multiple users. Each user should have their task automatically assigned to them rather than having to pick it up manually. The workflow should allow the users to approve or reject in parallel then, only if all users have approved, continue with the workflow. I’m trying to figure out the following in my workflow: How to loop through an array of users and create a user task for each one.  How to issue the tasks all at once and only continue with the flow once all have responded.   I’m new to Mendix and workflows, so any help would be appreciated. Thanks.
asked
2 answers
0

Hey Nick,
I was giving your problem some thought and an action I've never actually used came to mind, but might work for you here. It's the Parallel Split action. Here are some ideas on how to implement it:

You have a helper entity you mentioned be a type of array of users, with a variable to track the order. You could technically do this with the Administration.Account entity if you wanted by adding a new 'Order' variable to the Account entity. The other part of this is adding some way of tracking the number of responses (Approvals or Rejections) so you can know when to continue. You can do this by adding a new variable to your workflow reference entity, something like 'TotalResponses'

The workflow itself would then go something like:
1. Start with a parallel split action, with one split for every user in your array
2. Call a User Task option on each split for a specific user, you can determine this and pick them from the array by the order number mentioned above. Parallel split one would correspond to the person with order number one and so on.
3. Their user task completions would do what need to based on business logic, but also increment the 'TotalResponses' variable by one
4. Finally after the parallel split converges back to one path you'd call a microflow and check to see if the TotalResponses variable equals the total number of users in the array. If it does continue on with the rest of your business logic, and if not then don't do anything.

Hope this helps. If you ever want to chat about this further feel free to reach out.

answered
0

I'm sure this problem is long-gone but it might help future people: I'm not sure when it got added but there is a feature for "multi-user task" in the current version of Mendix (10.3) which would meet your criteria exactly.

answered