[jboss-jira] [JBoss JIRA] Updated: (JBRULES-1603) Creating a multiline DSL with first line variable containing () causes source to be corrupt
Richard Ambridge (JIRA)
jira-events at lists.jboss.org
Wed May 14 11:03:26 EDT 2008
[ http://jira.jboss.com/jira/browse/JBRULES-1603?page=all ]
Richard Ambridge updated JBRULES-1603:
--------------------------------------
Description:
Using drools-jbrms, create a new package, and add an Model,
Then create a DSL as follows: (change MessageObj to any object that exists in your Model, and extraField1,2 to items in that object)
[when]Line 1 {val1}=MessageObj(extraField1 matches "{val1}")
[when]- and this {val2}=extraField2 matches "{val2}"
[then]Action=System.out.println("Hi");
Then create new Rule, Business Guided
Add a When, select the 'Line 1' option
Add another when, select the 'and this' option
Add a Then, select the 'Action'
Click validate.. it should pass.
Next change the variable for 'and this' from 'val2' to 'val(2|3)'
Click validate, it should pass
Next change the variable for 'Line 1' from 'val' to 'val(1|2)'
Click validate, It will fail
unknown:4:64 mismatched token: [@18,102:104='val',<7>,4:64]; expecting type RIGHT_PAREN
unknown:4:68 mismatched token: [@20,106:106='2',<25>,4:68]; expecting type RIGHT_PAREN
Click view source and you will see:
rule "TestRule"
dialect "mvel"
when
MessageObj( extraField1 matches "val(1|2, extraField2 matches "val(2|3)" )")
then
System.out.println("Hi");
end
Notice, the 1|2 is not terminated correctly.
was:
Using drools-jbrms, create a new package, and add an Model,
Then create a DSL as follows: (change MessageObj to any object that exists in your Model, and extraField1,2 to items in that object)
Then create new Rule, Business Guided
Add a When, select the 'Line 1' option
Add another when, select the 'and this' option
Add a Then, select the 'Action'
Click validate.. it should pass.
Next change the variable for 'and this' from 'val2' to 'val(2|3)'
Click validate, it should pass
Next change the variable for 'Line 1' from 'val' to 'val(1|2)'
Click validate, It will fail
unknown:4:64 mismatched token: [@18,102:104='val',<7>,4:64]; expecting type RIGHT_PAREN
unknown:4:68 mismatched token: [@20,106:106='2',<25>,4:68]; expecting type RIGHT_PAREN
Click view source and you will see:
rule "TestRule"
dialect "mvel"
when
MessageObj( extraField1 matches "val(1|2, extraField2 matches "val(2|3)" )")
then
System.out.println("Hi");
end
Notice, the 1|2 is not terminated correctly.
Forgot the DSL
> Creating a multiline DSL with first line variable containing () causes source to be corrupt
> -------------------------------------------------------------------------------------------
>
> Key: JBRULES-1603
> URL: http://jira.jboss.com/jira/browse/JBRULES-1603
> Project: JBoss Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-brms
> Affects Versions: 4.0.7
> Environment: Solaris 10, Glassfish
> Reporter: Richard Ambridge
> Assigned To: Mark Proctor
> Priority: Minor
>
> Using drools-jbrms, create a new package, and add an Model,
> Then create a DSL as follows: (change MessageObj to any object that exists in your Model, and extraField1,2 to items in that object)
> [when]Line 1 {val1}=MessageObj(extraField1 matches "{val1}")
> [when]- and this {val2}=extraField2 matches "{val2}"
> [then]Action=System.out.println("Hi");
> Then create new Rule, Business Guided
> Add a When, select the 'Line 1' option
> Add another when, select the 'and this' option
> Add a Then, select the 'Action'
> Click validate.. it should pass.
> Next change the variable for 'and this' from 'val2' to 'val(2|3)'
> Click validate, it should pass
> Next change the variable for 'Line 1' from 'val' to 'val(1|2)'
> Click validate, It will fail
> unknown:4:64 mismatched token: [@18,102:104='val',<7>,4:64]; expecting type RIGHT_PAREN
> unknown:4:68 mismatched token: [@20,106:106='2',<25>,4:68]; expecting type RIGHT_PAREN
> Click view source and you will see:
> rule "TestRule"
> dialect "mvel"
> when
> MessageObj( extraField1 matches "val(1|2, extraField2 matches "val(2|3)" )")
> then
> System.out.println("Hi");
> end
> Notice, the 1|2 is not terminated correctly.
--
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
More information about the jboss-jira
mailing list