[
http://jira.jboss.com/jira/browse/JBRULES-1278?page=comments#action_12399870 ]
Edson Tirelli commented on JBRULES-1278:
----------------------------------------
I was not able to reproduce the problem from the example you showed. I used the following
test case:
package org.drools.test;
import org.drools.Cheese;
global java.util.List list;
rule "Cheese matches stilton"
salience 10
when
stilton : Cheese( type matches "[Ss]tilto[^0-9]" )
then
list.add( stilton );
end
rule "Cheese not matches"
when
brie : Cheese( type not matches "(stil.*|mu\w*|brie\d|aged.*|.*prov.*)"
)
then
list.add( brie );
end
rule "Cheese matches with space"
salience -10
when
stilton : Cheese( type matches "aged stilton" )
then
list.add( stilton );
end
rule "Cheese matches with ^ and escaped s"
salience -20
when
prov : Cheese( type matches "^provolone\s*" )
then
list.add( prov );
end
I guess you are using DSL (by the ticket title).
Please provide a test case to reproduce the problem.
Thank you,
Edson
DSL Parser "eval"
-----------------
Key: JBRULES-1278
URL:
http://jira.jboss.com/jira/browse/JBRULES-1278
Project: JBoss Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Drl Parser/Builder
Affects Versions: 4.0.1
Reporter: M H
Assigned To: Mark Proctor
Priority: Blocker
Fix For: 4.0.5
rule "PatternTest"
when
$pli:Item( title matches "^Test\s*")
then
#
end
this one compiles but on Runtime it ends in an Exception when title looks for example
like this "BlaBla (Test)".
as workaround i thought about using the next part, but
rule "PatternTest"
when
$pli:Item( eval(title.matches("^Test\s*")) )
then
#
end
it resolves into, also it shouldn't (because title.matches() is Java Code a
shouldn't be parsed by the DSL Parser itself):
SyntaxfehlerRule Compilation error : [Rule name=OnlineStreaming Start,
agendaGroup=MAIN, salience=100, no-loop=true]
com/p7s1/swi/phoenix/n24/Rule_OnlineStreaming_Start_0.java (19:923) :
Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ )
--
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