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.
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:
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:
I'll give that a go.
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.
This seems correct way to achieve.