[rules-users] Global type integer - Unexpected global

Faraniaina Domoina Rabarijaona rabarijaonadomoina at gmail.com
Fri Mar 14 06:44:12 EDT 2014


Hello,

I have a global integer in my drl file and I use it in a rule like this:

global int id;

when
           f: MyFact();
then
          MyClass mc=new MyClass();
         mc.setId(id);
end;

On my java code, I have:
int id=3
ksession.setGlobal("id", id);

But I get the error: Unexpected global [id].
I just test without the global in the RHS, like this:

then
          MyClass mc=new MyClass();
         int x=3;
         mc.setId(x);
end;

It's working.

What am I doing wrong ?
I tried with the type Integer (java.lang.Integer), but same problem.

If anyone can help me,

Thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20140314/20645a92/attachment.html 


More information about the rules-users mailing list