[rules-dev] DRL comilation: Parsing null does not work where parsing an enum literal does works.

Geoffrey De Smet ge0ffrey.spam at gmail.com
Sun May 30 07:50:44 EDT 2010


This works in DRL:
   Assignment(
       (PatternEntryPropertyWildcard.ANY == $shiftTypeWildcard)
           || (shiftType == $shiftType)
       ...
   )
But this doesn't work in DRL:
   Assignment(
       (null == $shiftType)
           || (shiftType == $shiftType)
       ...
   )
It says "no viable alternative at input 'null' in rule"

Is there a specific reason why enum literals work on that spot and the 
null literal doesn't?


Here's the full stacktrace:

Exception in thread "main" java.lang.IllegalStateException: There are 
errors in the scoreDrl's:[536,8]: [ERR 101] Line 536:8 no viable 
alternative at input ')' in rule "unwantedPatternShiftType2DaysPattern" 
in pattern ShiftType2DaysPattern[542,13]: [ERR 101] Line 542:13 no 
viable alternative at input 'null' in rule 
"unwantedPatternShiftType2DaysPattern" in pattern Assignment[544,12]: 
[ERR 102] Line 544:12 mismatched input '$employee' expecting ')' in rule 
"unwantedPatternShiftType2DaysPattern" in pattern Assignment[544,32]: 
[ERR 102] Line 544:32 mismatched input ',' expecting '(' in rule 
"unwantedPatternShiftType2DaysPattern" in pattern employee[545,8]: [ERR 
102] Line 545:8 mismatched input ')' expecting '(' in rule 
"unwantedPatternShiftType2DaysPattern" in pattern employee in pattern 
shiftDateDayIndex[547,13]: [ERR 101] Line 547:13 no viable alternative 
at input 'null' in rule "unwantedPatternShiftType2DaysPattern" in 
pattern employee in pattern Assignment


-- 
With kind regards,
Geoffrey De Smet



More information about the rules-dev mailing list