cancel
Showing results for 
Search instead for 
Did you mean: 

getting null value for variable from Delegate Execution

maulee17
Champ in-the-making
Champ in-the-making
Hi,

In the activiti workflow,I have one sub process. This sub process has a service task.
Service task has a java class as a delegate and it implements JavaDelegate.

when I do execution.getVariable("myvariable"), It returns null.
Here when I debug the execution,it displays like concurrentExecution[1234].

The variable is set out of the sub process and outer classes have scopeExecution[1234] as DelegateExecution.

Can someone help to understand the difference between two ,i.e Concurrent Execution and Scope Execution ?

Also any pointer to resolve this issue would be helpful.

Thanks,
Maulee.
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
The scope-execution for a sub-process is created, having as parent, the execution that created the subprocess. in your case, this is a ConcurrentExecution. A concurrentExecution is used when, e.g. a parallel gateway created 2 separate paths of execution.

In normal cases, if a variable is not present on the child-execution, it asks it's parent-execution if the variable is available, and so on until the root of the execution-tree has been reached. However, when dealing with call-activities, the parent execution (which created the child-execution) isn't exposed. use the activiti:in and activitiSmiley Surprisedut declarations for this (to get variables in and out of subprocess-scope), see user guide.

maulee17
Champ in-the-making
Champ in-the-making
Thanks frederikheremans for quick explanation.

But I am using an embedded sub process. In this case both the process context are shared. right ?

Also If I am not wrong activiti:in and activitiSmiley Surprisedut I can use with call activity only.