[rules-users] Change in eval mvel syntax from 5.1 to 5.3

Chris Selwyn chris at selwyn-family.me.uk
Tue Mar 5 10:16:32 EST 2013


I have been using 5.1 for some time and am looking to upgrade.

I have found that, where in 5.1, I used to be able to write

$jd: JobDetails(
  eval ( $t = ["MTSURVEY", "MTINSTALL", "MTEXCHANGE", "MTMAINT"];
          !($t contains getJobType(businessArea, templateJobId) )) )

However, in 5.3.1 this now produces a syntax error as follows:-

[CheckJobType] [ERR 101] Line 9:9 no viable alternative at input '$t' in rule "CheckJobType"
[CheckJobType] Parser returned a null Package

 I have found that I have to now code the condition as follows:-

$jd: JobDetails(
  eval (!(["MTSURVEY", "MTINSTALL", "MTEXCHANGE", "MTMAINT"] contains getJobType(businessArea, templateJobId) )) )

It is a relatively minor thing but I am curious as to why I should have to recode this.
What has changed to cause me to do this? What other incompatibilities exist?

Chris


More information about the rules-users mailing list