[jboss-user] [jBPM] - Re: Java code accessing task variables

Chris Melas do-not-reply at jboss.com
Thu May 5 03:22:03 EDT 2011


Chris Melas [http://community.jboss.org/people/melc] created the discussion

"Re: Java code accessing task variables"

To view the discussion, visit: http://community.jboss.org/message/603579#603579

--------------------------------------------------------------
Good i'm glad it worked out for  :) 

Actually, you can use several methods to set variables and parameters for example,

1. result mapping (as you already mentioned), if you want to map a process variable to a value from the result parameter of the task
2. parameter mapping (as loganathan mentioned) - here you can map parameters of the task with process variables
3. set a task parameter i.e. in the properties of the task at the content parameter field of the task place a notation like #{some_value_from_variable}
4. set process variables within on entry actions and on exit actions and then use the parameter mapping to map those variables to your task parameters and use them in your task i.e. (from the sample.bpmn of the jbpm5 installation),

*on entry action* 
java.util.Map contentParam = new java.util.HashMap();
contentParam.put("reason", reason);
contentParam.put("performance", performance);
kcontext.setVariable("content", contentParam);

*Parameter mapping*
{Content=content}

5. on exit action you can set parameters to variables as shown in the code above
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/603579#603579]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110505/10edc1a9/attachment.html 


More information about the jboss-user mailing list