[jboss-jira] [JBoss JIRA] Commented: (JBRULES-2409) Quotes should not be escaped when parsing a decision table

Michael Anstis (JIRA) jira-events at lists.jboss.org
Thu Sep 1 15:58:26 EDT 2011


    [ https://issues.jboss.org/browse/JBRULES-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625865#comment-12625865 ] 

Michael Anstis commented on JBRULES-2409:
-----------------------------------------

Hi Jos, any help is always welcome :) As you note, the problem is some people want the default to be no escaping, whereas others (JBRULES-1811) want the default to be escaping. A global parameter would be of help, but then if you need to parse a mix of decision tables you need to keep switching the parameter. Another idea could be to escape quotes not already escaped and to remove escaping from quotes escaped - so: $myObject.setField(\"A 12" rule\"); would parse to: $myObject.setField("A 12\" rule"); - those that *want* escaping are "business users" not wanting (needing) to understand the technical need to escape, whereas those that *do not want* escaping understand the technicalities. So "reverse escaping" would be a technicality understood by developers. Only a thought.... if Kenneth is happy for the parameter route I'll be happy to support your pull request. Cheers.

> Quotes should not be escaped when parsing a decision table
> ----------------------------------------------------------
>
>                 Key: JBRULES-2409
>                 URL: https://issues.jboss.org/browse/JBRULES-2409
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-decisiontables
>    Affects Versions: 5.0.1.FINAL
>         Environment: jdk 1.6 update 12
> windows XP 
>            Reporter: Jos Hendriks
>            Assignee: Michael Anstis
>              Labels: decision, drl, escaping, generated, quotes, table
>             Fix For: 5.3.0.CR1
>
>
> Since drools 5 quotes that are in an action cell of a decision table are escaped. As we are using method calls with String parameters in our action cells this results in invalid drl.
> I've reproduced the issue in the example decision table project generated
> by the eclipse plugin. After generating a new Drools project with decision
> table example I added the following to the Message class:
> public String getMessage(String dummy) {
>  return this.message;
> }
> In the decision table I change cell E9 from
> 'm.setMessage("$param");update(m);' to 'm.setMessage($param);update(m);'
> and cell E11 from 'Goodbye cruel world' to 'm.getMessage("msg")'.
> When I use Drools 5 I get escaped double-quotes which causes an error
> in com.sample.DecisionTableTest.readKnowledgeBase:
> m.setMessage(m.getMessage(\"msg\"));update(m); 
> Version 4.0.7 did not escape quotes and correctly generated the drl:
> m.setMessage(m.getMessage("msg"));update(m); 
> I found out that escaping of quoted has been added by request, JBRULES-1811. Please reconsider the decision and or implementation made to solve that issue. Possibly add a keyword to the decision table to define the way qoutes are parsed? Like Sequential for salience....
> The forum entry I have made includes the files and full drl. Please contact me if you need more information or help.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list