Highlighted

How do I make a "dynamic" Gateway?

Clookes

17-03-2009

Hi,



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.



Thanks in advance.

Replies

Highlighted

Jasmin_Charbonn

17-03-2009

Unfortunately with the current version you can't really do that.



You could theoretically loop back to the gateway and go back into it n number of times, but you would need a second branch that goes straight to the end, and you would need to Gateway to be "No Wait".



There is going to be a new service in the next version of LiveCycle that will allow you to specify a list of users to send stuff in parallel.



I know it doesn't help you now, but it's coming.



Jasmin
Highlighted

Jasmin_Charbonn

18-03-2009

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.



I'm not sure if that makes sense but let me know.



Jasmin
Highlighted

Clookes

18-03-2009

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.



Thanks.
Highlighted

Jasmin_Charbonn

18-03-2009

You can use a filter based on information coming from the event.



You can use the /MapContent/StepName to get the name of the step where the task was completed from.



Jasmin
Highlighted

Clookes

18-03-2009

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.



Ummm...
Highlighted

Jasmin_Charbonn

19-03-2009

You could cross-reference it with the processInstanceId. It is unique for every invocation of the process.



But it get more and more complicated. Like I said in my original email, this is not easy to implement in the current release.



Jasmin