[jboss-user] [jBPM] - Cannot get jBPM global variables to work

Andy McC do-not-reply at jboss.com
Thu May 9 06:48:28 EDT 2013

Andy McC [https://community.jboss.org/people/andymcc] created the discussion

"Cannot get jBPM global variables to work"

To view the discussion, visit: https://community.jboss.org/message/816964#816964

I'm trying to set up some globals that will be visible across all of my processes.

To test it I've created the attached diagram (TestGlobal.bpmn2) which 
* defines a single global string variable (globVar)
* tries to set it using a script task and the command kcontext.getKnowledgeRuntime().setGlobal("globVar", "a value") (as stated in the manual).
* tries to display it using kcontext.getKnowledgeRuntime().getGlobal("globVar").

The process compiles but when I run it from gwt-console but it throws a runtime error with the following text (full extract in error_message.txt, attached):
* +org.jbpm.workflow.instance.WorkflowRuntimeException: [defaultPackage.TestGlobal:69 - Set global:2] -- unable to execute Action: Unexpected global [globVar]+

This suggests that it is not sufficient to declare globVar as a global at the process level.

In an earlier effort, the display task simply tried to print the value of globVar to the log using System.out.println("Global variable:" + globVar) but this version did not even compile, complaining that globVar did not resolve to a type.

So far as I can tell I've worked in accordance with the manual - but realise there may be a key step I've missed.

Can anyone help?


Andy McC

My config: jBPM-5.4.0.Final, Windows 7 and 8, working via drools-guvnor and jbpm-console (not eclipse)

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/20130509/e43d4a04/attachment.html 

More information about the jboss-user mailing list