[
http://jira.jboss.com/jira/browse/JBRULES-965?page=all ]
Edson Tirelli closed JBRULES-965.
---------------------------------
Fix Version/s: 4.0.0.MR4
Resolution: Rejected
Brian,
The problem is that you have 2 maps that match your input text. In your mapping file you
have, in that order:
[condition][]- {field} is {value}={field} == {value}
[condition][]- {field} is not alpha only={field} not matches "[ a-zA-Z]"
As you can see, your input:
- city is not alpha only
Will match your mappings in the given order, matching the first one above instead of the
second. So in the first mapping above, {field} will be "city" and {value} will
be "not alpha only", causing the problem.
One way of dealing with such situations is to always write more specific mappings first in
your mapping file. The other way is make sure you don't have more than one pattern
that matches the same input.
For this simple case, if you move the first pattern above to the end of you DSL mapping
file, it will solve the problem, but as I guess this is part of a much more complex case,
I suggest you to change the mapping to avoid such situations.
Unexpected token 'not'
-----------------------
Key: JBRULES-965
URL:
http://jira.jboss.com/jira/browse/JBRULES-965
Project: JBoss Rules
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Drl Parser/Builder
Affects Versions: 4.0.0.MR3
Environment: Win XP, Drools MR3 (Snapshot from 7/2/2007)
Reporter: Brian Enderle
Assigned To: Edson Tirelli
Priority: Minor
Fix For: 4.0.0.MR4
Attachments: Address.drl, Address.dsl, Address.java
The following rule works in a DRL file
$i : Address( city not matches "[ a-zA-Z]" )
But when entered into a DSL file an "Unexpected token 'not'" error is
thrown.
DRL file: DSL entry:
There is a Address $i : {Instance}()
- city is not alpha only {field} not matches "[
a-zA-Z]"
After further coding I find that this issue also applies to 'not matches' whcih
was working prior to Snapshot from 7/2/2007.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira