how to use global variable in drools

54 views Asked by At

I have a drools file (.drl) which I am using to trigger rules. I have declared a global variable in the same file. However I am unable to use the same.

DRL:

global Boolean testValue                              // line 1
System.out.println("Global testValue: "+testValue)    // line 2

When I call the rules, I get an error on line 2. The testValue is being populated prior to calling.

Any suggestion, or where I am going wrong? I am certain this is not a syntax error.

0

There are 0 answers