[rules-users] Initialize Global
vdelbart
delbart.v at mipih.fr
Thu Oct 25 09:33:17 EDT 2007
Beware,
2.5.4.5. Globals
"If you use a global on the LHS of a rule, make sure it is immutable."
regards,
V.
java_user_ wrote:
>
> How do I initialize a global fact in the drl file? I want use the JSR94
> API and avoid using the Drools API inside the Java code. I would like to
> access the same variable every execution of a stateful session without
> having to reinstantiate the variable after each execution?
>
> Basically I want to define a global like this:
> # Define global variable
> global List objectList ;
>
> # Part that does not work
> objectList = new ArrayList() ;
> objectList.add("1");
> objectList.add("2");
>
>
> Thanks
>
--
View this message in context: http://www.nabble.com/Initialize-Global-tf4685186.html#a13406827
Sent from the drools - user mailing list archive at Nabble.com.
More information about the rules-users
mailing list