[jboss-jira] [JBoss JIRA] Updated: (JBRULES-2814) DSL variable definition may create strange effects

Mark Proctor (JIRA) jira-events at lists.jboss.org
Thu Sep 29 03:05:36 EDT 2011


     [ https://issues.jboss.org/browse/JBRULES-2814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Proctor updated JBRULES-2814:
----------------------------------

    Assignee: Edson Tirelli  (was: Mark Proctor)


> DSL variable definition may create strange effects
> --------------------------------------------------
>
>                 Key: JBRULES-2814
>                 URL: https://issues.jboss.org/browse/JBRULES-2814
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-compiler-DSL
>    Affects Versions: 5.1.1.FINAL
>            Reporter: Wolfgang Laun
>            Assignee: Edson Tirelli
>             Fix For: 5.3.0.Final
>
>
> The DSL parser accepts variable definitions
>   {name}
>   {name:pattern}
>   {name:q:pattern}
> but also
>   {name:xyz:}
> a) What *is* the purpose of "q"? It is tested in DSLMapWalker and influences what is used as a pattern, sometimes overriding a specified pattern: q pattern use-for-matching null null (.*?) null pattern pattern X null (.*?) X pattern pattern ENUM -- (.*?) DATE -- (.*?) BOOLEAN -- (.*?)
> b) A "null" pattern is used for matching if {name:xyz:} is used.
> I think the "q" is a relic and should be discarded. A ':' as delimiter in an area where any character is possible (as in a pattern) is bound to create ambiguities.
> The "C" entry in the DSL below produces "null" in the pattern trying to match a condition; i.e., the string "null" is actually matched.
> A, E, F result in pattern "(.*?)" 
> B, D use the pattern ("Boolean" or "Double", respectively)
> DSL: 
> [when][]A {type} value=${type}: {type}()
> [when][]B {type:Boolean} value=${type}: {type}()
> [when][]C {type:xyz:} value=${type}: {type}() 
> [when][]D {type:xyz:Double} value=${type}: {type}() 
> [when][]E {type:ENUM:} value=${type}: {type}()
> [when][]F {type:DATE:Float} value=${type}: {type}()
> DSLR:
> rule "rule 1"
> when 
>   A Integer value 
>   B Boolean value 
>   C Character value # fails; use "null" instead of Character to get a match
>   D Double value
>   E Enum value
>   F Float value 
> then 
> > System.out.println( "hello" ); 
> end 

--
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