[jboss-jira] [JBoss JIRA] (JBRULES-2518) equal sign (=) in string literal in MVEL modify statement causes error
Tibor Zimányi (JIRA)
issues at jboss.org
Tue Jul 10 09:38:01 EDT 2018
[ https://issues.jboss.org/browse/JBRULES-2518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tibor Zimányi closed JBRULES-2518.
----------------------------------
Resolution: Out of Date
This project is not active anymore. The current active project is "DROOLS". Closing this.
> equal sign (=) in string literal in MVEL modify statement causes error
> ----------------------------------------------------------------------
>
> Key: JBRULES-2518
> URL: https://issues.jboss.org/browse/JBRULES-2518
> Project: JBRULES
> Issue Type: Bug
> Components: drools-core (expert)
> Affects Versions: 5.0.1.FINAL
> Environment: Mac OS X 10.6.3, Java 1.6
> Reporter: Steve Miner
> Assignee: Mario Fusco
> Fix For: 6.0.0.Alpha1
>
>
> rule "mvel equal sign bug"
> dialect "mvel"
> when
> $d: Dog(name == "Bertie")
> then
> modify ($d) {name = "Bertie = Boy"};
> end
> Note the string literal for the new value for name contains an equal sign (=). That causes an error. Apparently, the modify macro or the MVEL parser is choking on the equal sign.
> java.lang.Error: org.drools.rule.InvalidRulePackage: Unable to build expression for 'consequence': [Error: unterminated literal]
> [Near : {... h ($d) {name = "Bertie = Boy"} ....}]
> ^
> [Line: 1, Column: 43] ' modify ($d) {name = "Bertie = Boy"};
> ' : [Rule name='mvel equal sign bug']
> If I remove the "=" from inside the string literal (substituting "is a"), it works as expected.
> rule "mvel equal sign bug"
> dialect "mvel"
> when
> $d: Dog(name == "Bertie")
> then
> modify ($d) {name = "Bertie is a Boy"};
> end
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
More information about the jboss-jira
mailing list