I did this, some time ago to access a variable from a split node constraint (not sure if it still works):

$processInstance : ProcessInstanceImpl( )
VariableScopeInstance(variables["customerLoanRating"] >= 1000) from $processInstance.getContextInstance(VariableScope.VARIABLE_SCOPE)

You need to insert the process instance into the session.

You may want to look at various examples in examples.zip downloadable from http://www.jboss.org/drools/downloads.html

On Sat, Mar 7, 2009 at 12:23 PM, Ricardo Gil Alcaņiz <rgil@okode.com> wrote:
Hi,

I'm not a new drools user but I started to test rule flows (5.0M5) recently and I'm stucked, so any clue will be welcomed :). I'm testing how to share a StatefulKnowledgeSession between N rule flow instances. I'm trying to parametrize each instance with process variables at start time but I don't know how to use them from rule constraints (in event waits, splits, etc.). I've read the documentation and I've found this text related to constraints "Both rule and code constraints have access to globals that are defined for the process and can reuse imports at the process level." I tried it assigning (from an action) a variable value to a global variable but it's not working for me. ŋI'm missing something?

Thanks in advance!

Ricardo.

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users