-
1. Re: How to use setGlobal for JBPM 5
Mauricio Salatino Jan 6, 2011 3:15 PM (in response to Amin MC)Hi there, you must have a DRL file that declares the global variable.. after that you can set it and use it in your processes.
Greetings!
-
2. Re: How to use setGlobal for JBPM 5
Amin MC Jan 6, 2011 4:51 PM (in response to Mauricio Salatino)Hi
Thanks for your quick reply! Just to clarify I need to have a DRL file registered with my KnowledgeBase as well as my BPMN file. In the DRL file I define the global variable for example:
global java.lang.String globalVariable
and in my BPMN file in the script node I can do:
System.out.println(globalVariable);?
Thanks again!
Amin
-
3. Re: How to use setGlobal for JBPM 5
Mauricio Salatino Jan 6, 2011 4:55 PM (in response to Amin MC)that's right.. try out the System.out.println(globalVariable); and let me know if it doesn't work..
I'm pretty sure that it works if you access through the kcontext. doing something like:
kcontext.getKnowledgeRuntime.getGlobal("globalVariable");
Greetings.
-
4. Re: How to use setGlobal for JBPM 5
Amin MC Jan 6, 2011 5:24 PM (in response to Mauricio Salatino)Hi
I'll give that a go.
Thanks
-
5. How to use setGlobal for JBPM 5
Kris Verlaenen Jan 10, 2011 6:54 PM (in response to Amin MC)You can also just define the global in your process. If you use the Drools eclipse plugin to edit the BPMN2 file, and you are writing your action (script node for example), there is a button there to define imports and globals.
Kris
-
6. Re: How to use setGlobal for JBPM 5
Myank Jain Aug 26, 2014 9:27 AM (in response to Kris Verlaenen)Kris,
This seems correct way to achieve.
Greetings,
Mayank