[jboss-user] [jBPM] - Re: passing data to nodes

Ryan Peterson do-not-reply at jboss.com
Tue Sep 6 19:29:31 EDT 2011

Ryan Peterson [http://community.jboss.org/people/rrpeterson] created the discussion

"Re: passing data to nodes"

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

I'm going through this myself, so far I've found:

Put the variable into the map like you wrote:

Map<String, Object> params = new HashMap<String, Object>();
boolean examOK = false;
params.put("examOK", examOK);

ksession.startProcess("com.sample.bpmn.hello", params);

Then in the bpmn definition, you need to have the process variables (if you want a global process variable I think?):
<itemDefinition id="_examOK" structureRef="java.lang.Boolean" />

and within the process def itself (still in the .bpmn file):
<property id="examOK" itemSubjectRef="_examOK"/>

You also need the dataInput mapped to your task (within your task, that lies inside the process):
<dataInput id="_999_examOK" name="examOK" />



That will map it into your workItemHandler, so you can obtain it via:
Boolean examOk = (Boolean) workItem.getParameter("examOK");

I'm not 100% sure if this is the "correct" way to implement this.  I'm unsure if this variable is global for all processes, for instance: what if the process is started multiple times for multiple users?  Does each process implementation get its own global examOk boolean using this method?

Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110906/58bf251b/attachment-0001.html 

More information about the jboss-user mailing list