cancel
Showing results for 
Search instead for 
Did you mean: 

Add process variable

greencomet90
Champ in-the-making
Champ in-the-making
Hi,
I have flow like this:
ServiceTask 1 (return object A have fields A1,A2) -> ServiceTask 2 (need A2).
How can I add A2 to flow ?
I try runtimeService.setVariable(processInstance.getId(), A2,A2Value) but when flow has not yet user task, processInstance is null, so I can't get executionId. I'm apply serviceTask by using expression.

Thanks.
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
In the service task you have a DelegateExecution, that has a method setVariable

greencomet90
Champ in-the-making
Champ in-the-making
Hi, thanks for response, but I'm using Expression for service task, not using Java Delegate class, so not having DelegateExecution. Do you have another way to add variable?

jbarrez
Star Contributor
Star Contributor
In an expression, you can put 'execution' too, even pass it into methods like that.