1 of 1 people found this helpful
you can use an execution scoped variable if you want to share information in different tasks or you can pass a map in the signal method
Thank you Mike,
Yes we can pass the variable while starting the process instance. But after that how does it work. Say my process xml consists of a linear sequence of java tasks. task 1 will have the variable you provided while instantiation. but how does task 2 will get hold of that, java tasks are independent tasks and will have no awareness of state engine right?
you can also pass variables when you signal an already running process instance, the ExecutionService has a signal method that takes a map as parameter.
I haven't used java tasks that much, I found custom activities to be more convenient (see: http://docs.jboss.com/jbpm/v4/userguide/html_single/#custom) you have access to the execution in their signal() and execute() methods, the variables can be retrieved with execution.getVariable('varname').