[jboss-user] [jBPM] - jBPM 5.1 - How to read variable in a Java application

Itajubá Segundo do-not-reply at jboss.com
Tue Jul 19 02:24:06 EDT 2011

Itajubá Segundo [http://community.jboss.org/people/isegundo] created the discussion

"jBPM 5.1 - How to read variable in a Java application"

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

I have downloaded the new jbpm-5.1.0.Final-installer-full from JBoss website, and I have started studying jBPM.

I want my Java application to start a process and during process life cycle I want to read the variable data. Quite simple requirement, right?

Well I have defined a variable during process design and I use the following code to start a process instance:

Map<String, Object> params2 = new HashMap<String, Object>();
params2.put("valor", 20000);
ksession.startProcess("com.ims.teste.requisicao", params2);

Then I use the following code to "see" all process instances running(I started other several instance using the code structure):

ArrayList<ProcessInstance> a = (ArrayList<ProcessInstance>) ksession.getProcessInstances();

And I can get all instances correctly.

Well, now how can I access the variable programatically through the same java application?? I could not find any "get" method that look like a "getVariable" or something like that.

Looking at documentation the best I could find was in jBPM 3 docs using ContextInstance. But it doesn't work with jBPM 5.1. 
Link here:  http://docs.jboss.org/jbpm/v3/userguide/context.html http://docs.jboss.org/jbpm/v3/userguide/context.html

How can I do this in 5.1?

Thank you very much.

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/20110719/8bcbcd45/attachment.html 

More information about the jboss-user mailing list