[rules-users] Rules and process variables...

bob.breitling bob.breitling at rrd.com
Fri Oct 1 15:29:05 EDT 2010


How do you or, even, can you access process variables in rules? 

I did this sort of thing in my rules consequences:

ProcessInstance pi = drools.getWorkingMemory().getProcessInstance(1);
((VariableScopeInstance)
pi.getContextInstance("VariableScope")).setVariable("x", x);

In my test, the process id of 1 is a bit of a kludge.  Is there a good way
to find that id?

This looks pretty ugly.

Is the right way to do this to create a subprocess and map the variable into
the subprocesses' working memory as facts with <mapping> tags?

Bob
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Rules-and-process-variables-tp1616599p1616599.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list