-
1. Re: Contexts of variables in forked processing
kukeltje May 17, 2007 9:07 AM (in response to vedavyas)What are you trying to achieve? This is a very weird way of modelling things, and probably (as you describe) does not work correctly.
-
2. Re: Contexts of variables in forked processing
estaub May 17, 2007 10:40 AM (in response to vedavyas)vedavyas,
Do you really want a fork?
Forks are used for starting pseudo-concurrent execution of multiple paths.
-Ed Staub -
3. Re: Contexts of variables in forked processing
vedavyas May 18, 2007 2:31 AM (in response to vedavyas)This is what i'm trying:
The process starts by assigning a task to a particular actor(in this case it is ADMIN). Now based on the business logic the ADMIN may require approval from one or more actors(here it is PROJECTLEADS).
So a single task for the ADMIN has to be split into multiple tasks and assigned to LEADS.
My exact problem statement goes like this:
A user can request for one or more projects when he registers. This request is assigned to the ADMIN as a single task. The ADMIN has to assign the task to the LEADS of these projects. There can be multiple LEADS for each project. So Project1 should be assigned to concerned LEADS and Project2 to its concerned LEADS and so on.
This may sound wierd as i'm trying to use the features of jBPM.
How can i model the process-definition?
Thanks -
4. Re: Contexts of variables in forked processing
kukeltje May 18, 2007 5:58 AM (in response to vedavyas)Yes, you use features of jBPM, but it is the way that you use them that leads to problems (compare: you can use a knife to cut meat ot to stab people, the latter leads to problems although it is a feature of a knife).
Use a foreachforkhandler for this (see the wiki). Adapt it slightly to accustom for the different actors. -
5. Re: Contexts of variables in forked processing
vedavyas May 22, 2007 1:08 AM (in response to vedavyas)As u said i used the ForEachForkHandler and it works for a particular case.
This is my process definition file<task-node name="assign-to-admin"> <task name="for-approval" description="team member creation request"> <assignment pooled-actors="user1"/> </task> <transition name="does user need lead approval" to="foreachfork"> <action class="com.techm.gisv.osl.cvsportal.actions.AdminAction"/> </transition> </task-node> <node name="foreachfork"> <action class="com.techm.gisv.osl.cvsportal.actions.ForEachForkHandler" config-type="bean"> <list>projects1</list> <as>project</as> </action> <transition name="assign" to="user-needs-lead-approval"> </transition> </node> <decision name="user-needs-lead-approval" expression="#{workflow.isUserDev}"> <transition name="yes" to="assign-to-tech-lead"> <action class="com.techm.gisv.osl.cvsportal.actions.ActorAction"/> </transition> <transition name="no" to="action"/> </decision> <task-node name="assign-to-tech-lead"> <task name="for-approval" description="team lead creation request"> <assignment pooled-actors="#{pooledActors.pooledActor}"/> </task> <transition name="approved and assigned back to admin" to="assign-admin"> <action class="com.techm.gisv.osl.cvsportal.actions.LeadAction"/> </transition> </task-node>
According to my process definition and based on my logic if the control comes to the <task node> "assign-to-tech-lead" then none of the attributes are available. So no value can be displayed in the tasklist.
how can i solve this? -
6. Re: Contexts of variables in forked processing
vedavyas May 22, 2007 2:53 AM (in response to vedavyas)I am trying to split a single process into multiple process using ForEachForkHandler
In this case a single task for the ADMIN is split into two or more tasks and assigned to more than one actor(LEADS). In the task list for LEADS none of the attributes of the parent process is visible in the child process.
Should i manually copy these values to the next process and if yes how can this be done? or is it available in any of the contexts?
Thanks -
7. Re: Contexts of variables in forked processing
estaub May 22, 2007 8:07 AM (in response to vedavyas)Vedavyas,
You wrote:I am trying to split a single process into multiple process using ForEachForkHandler
Do you literally mean multiple process instances, or just multiple tokens?
If process instances, look at
jpdl\examples\variable\src\main\java\org\jbpm\tutorial\context\ContextTest.java
If tokens, it should work, I think. Tokens are in a tree; variables are searched for by swimming recursively toward the root token until one with the matching name is found. See the user guide on "Variable Scope". There may be something specific in how you are (perhaps implicitly) scoping them; you didn't show anything about where they are created, etc., so it's hard to guess.
-Ed Staub -
8. Re: Contexts of variables in forked processing
estaub May 22, 2007 8:09 AM (in response to vedavyas)I wrote:
If tokens, it should work, I think.
Sorry, I was unclear, by "it should work" I meant "you shouldn't have to do anything special to see the process instance variables"; you shouldn't need to copy them. -
9. Re: Contexts of variables in forked processing
vedavyas May 22, 2007 8:45 AM (in response to vedavyas)I have created those variables in a stateful session bean.
From this class i am triggering the process definition
In the process definition from the start state, the transition occurs to assign-to-admin -
10. Re: Contexts of variables in forked processing
estaub May 22, 2007 8:57 AM (in response to vedavyas)Right, so you're creating separate process instances.
See the example I pointed at earlier for "seeding" the instance with variables when you start it.
-Ed Staub