[rules-dev] DRL comilation: Parsing null does not work where parsing an enum literal does works.
Esteban Aliverti
esteban.aliverti at gmail.com
Sun May 30 08:48:20 EDT 2010
Just guessing, but is PatternEntryPropertyWildcard defined inside
Assignment?
When you write
Assignment(null == $shiftType)
You are writing a Field Constraint over Assignment. So, the first element of
the constraint should be a field from Assignment, but you are putting
"null". I think that's your error there.
Best,
On Sun, May 30, 2010 at 8:50 AM, Geoffrey De Smet
<ge0ffrey.spam at gmail.com>wrote:
> 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
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20100530/fe01cd88/attachment.html
More information about the rules-dev
mailing list