Monday, July 13, 2009

Drools 5.0 AssignmentOperator Issue

I was given the critical work of migrating rules written in Drools 4.0 to Drools 5.0. I started by changing the APIs, then PackageBuilder, etc. I deduced from the documentation that the rules written in the previous version will be compatible.
So, I assumed that and tried to build the rules. The console filled the following weird errors.


Rule Compilation error : [Rule name='Test Rule']
rules/TestRule_0.java (9:681) : Syntax error, insert "AssignmentOperator Expression" to complete Expression
rules/TestRule_0.java (9:681) : Syntax error, insert ";" to complete Statement
rules/TestRule_0.java (9:681) : e cannot be resolved


I tried to google it, as always, but could not find any solution. Wasted around 4 hrs, suddenly an idea struck me. I tried it and the errors got fixed. It was a trivial issue.

Instead of
end
I was writing
end;

huh, it worked. Because of one single semicolon, rules were not building.

2 comments:

  1. Just wanted to say thank you. You just saved me a couple of hours!

    ReplyDelete
  2. Thanks heaps for saving me from hell.

    ReplyDelete