cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel Tasks Problem in 5.11

santharamselva
Champ in-the-making
Champ in-the-making
Hi,

  Please any one help me on the following issue, what I am getting.

  I have created one parallel process, please see the url "http://demofans.com/PPP.JPG" to refer the attached process diagram. When I start the process , its creating 2 tasks with different "Execution Id" and same "Process Instance Id" in "act_ru_tasks table". Then , I completed the one of the user task using activiti API RuntimeService.complete(taskId,variables). Now, I need to get the variables for next user task in the another lane. So, I used RuntimeServices.getVariables(executionId) API to get the variables, but I got, first lane UserTask variable values in second UserTask Lane. As per the diagram, I got a values of "Mobile Details" in "User Details". By, the way in the act_ru_variable and act_hi_varinst tables its saved execution_id_ and proc_inst_id_ or same as proc_inst_id_ of parent process id_.

  Is it right or not? if , it is right , how do I handle variable values in different lane differently but with same variable name.

Thanks,
s.selvakumar
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
Variables set with the "setVariables()" command on a child-execution, are by default set on the process-instance UNLESS the variable is defined locally on that execution, or on a parent execution in the tree (the variable-set request will bubble up the execution-tree until an execution is found where the variable is set locally, and will set the value there).

So in your case, the variables will be set on the process-instance, rather than on the mobile or user-execution. To prevent this, you should call setVariable(s)Local(executionId, …). This will keep the variables stored on the child-execution. Beware, that all variables that are needed after the parallel-paths joins again, should be set explicit ally on the process-instance. Once the parallel paths disappear, the variables for it, are destroyed.