I would like to assign user tasks to a number of uses via gateway with "And-Wait" condition, however the # of uses is unknown/dynamic depending on the step before the gateway, which is a web service call that retrieves a list of users on the form.
How do I accomplish this? Any help is appreciated.
What are you trying to do? The looping back to the gateway.
That also might not work for you. For example, if you have three users, you'll loop back twice to assign a task to two more person.
The problem with that approach is that as soon as the first user completes the task, it'll come out of the gateway to continue in the main process (main branch).
When the other two users complete their task, it'll just get to the end of the gateway and finish. I'll never get back to the main branch since it was executed by the first person that completed the task.
Let me try and describe my situation, it's not too hard, I kind of got it working via events, but still need to do "something" to make it right.
Alright, I have a subprocess, which is just a no-wait single branch gateway with Assign Task in the branch, and the subprocess takes a string as input (username).
In the main process, first I a list of user names from making a webservice call in a pdf form, then I use a single branch gateway (no-wait), and inside this single branch, I use the sub process we created above inside a loop that loops thru the list of users, after that's done it exit the branch and waits at the "TaskCompleted Event" receive, when the total # of "taskcompleted" events were fired and received, equal to the number of users in the list, then it proceed to the next step.
This works, but I know it will catch "any" TaskComplete event, I need to filter out the ones I only really care about (which are the ones fired off in the sub processes), so I am not sure how I can catch just those tasks I care for this process instance.
I tried to filter by the StepName, but I can't really find the right one to use as the filter.
But I just thought of something, what if there are multiple ppl using the same process (different instance), then this wouldn't work, because the TaskCompleted event will catch the event from other instance of the same process as well.