-
1. Re: How to pass a variable value to java task
mwohlf Sep 21, 2010 4:43 PM (in response to jeen007)1 of 1 people found this helpfulyou 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
see:
http://docs.jboss.com/jbpm/v4/userguide/html_single/#withvariables
http://docs.jboss.com/jbpm/v4/userguide/html_single/#d0e5153
-
2. Re: How to pass a variable value to java task
jeen007 Sep 21, 2010 5:12 PM (in response to mwohlf)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?
-
3. Re: How to pass a variable value to java task
mwohlf Sep 21, 2010 5:49 PM (in response to jeen007)Hi Jeen,
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').