[rules-users] DSL matching return wrong DRL
Matt Geis
mgeis at yahoo.com
Wed Jul 22 12:32:41 EDT 2009
The question has already been answered, but to help you understand how DSL expansion works, here's what happens.
1. The expander goes down the list and matches the first expression against all lines in your rules. So,
rule dsl2drl_1
when
Get month summer
then
Print months;
end
becomes
rule dsl2drl_1
when
$month: Month(); summer
then
Print months;
end
2. The expander tries to match the second expression, and fails.
3. The expander tries to match the third expression, and succeeds, leaving you with the following DRL.
rule dsl2drl_1
when
$month: Month(); summer
then
System.out.println("Month: " + $month.getId());;
end
Looking at the LHS of the rule, this will not compile.
Matt
More information about the rules-users
mailing list