[jboss-jira] [JBoss JIRA] Updated: (JBRULES-2131) More flexible DSL: sharing of comparison operators between attributes

Prem Stephen (JIRA) jira-events at lists.jboss.org
Fri Jun 19 09:03:05 EDT 2009


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

Prem Stephen updated JBRULES-2131:
----------------------------------

                Issue Type: Feature Request  (was: Bug)
    Workaround Description:   (was: After much experimentation, I found that switching the lines so that "less than or equal to" comes before "less than" does not break.
for eg, this works

[when]There is a Contact with=Contact()
[when]- age is greater than {age}=age > {age}
[when]- age is less than or equal to {age}=age <= {age}
[when]- age is less than {age}=age < {age}

If this cannot be fixed, this quirky behaviour should at the very least be documented.
)
               Environment:     (was: I tried building the DSL using Guvnor
)
               Description: 
In the following DSL
[when]There is a Contact with=Contact()
[when]- age is greater than or equal to {age}=age > {age}
[when]- age is greater than {age}=age > {age}
[when]- age is less than or equal to {age}=age <= {age}
[when]- age is less than {age}=age < {age}

Now, if I had 10 attributes of type int, then currently from what I could read in my documentation I need to recreate these lines for each of these 10 attributes.

Hope about a DSL that is more granular, similar to the one below ( i am just putting this up )
[when][operator]is less than="<"
[when][operator]is less than or equal to ="<="
[when][operator]is greater than=">"
[when][operator]is greater than or equal to =">="

then, I should be able to state that since age is a int, it can use the above operators.
A country, being a String, should not be able to use these operators.

  was:
In http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html_single/index.html#d0e5595, section 4.10.4 - I am expanding on the following syntax example for structuring combinations in the DSL.

In my example, I have

[when]There is a Contact with=Contact()
[when]- age is less than {age}=age < {age}
[when]- age is greater than {age}=age > {age}
[when]- age is less than or equal to {age}=age <= {age}   <-------------------- this line does not work
[when]- age is foo than or equal to {age}=age <= {age}

and my rule is

when
	There is a Contact with
	- age is foo than or equal to 35
	
then
	Log : "Contact exists Test";

Now, the line that does not work is because it shares the start "age is less than " with an earlier DSL.
Replacing "less" with "foo" works for this reason.
I think the parsing needs to be fixed to look at the whole sentence.

                  Priority: Critical  (was: Blocker)
                Workaround:   (was: [Workaround Exists])


> More flexible DSL: sharing of comparison operators between attributes
> ---------------------------------------------------------------------
>
>                 Key: JBRULES-2131
>                 URL: https://jira.jboss.org/jira/browse/JBRULES-2131
>             Project: JBoss Drools
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 5.0.1.FINAL
>            Reporter: Prem Stephen
>            Assignee: Mark Proctor
>            Priority: Critical
>
> In the following DSL
> [when]There is a Contact with=Contact()
> [when]- age is greater than or equal to {age}=age > {age}
> [when]- age is greater than {age}=age > {age}
> [when]- age is less than or equal to {age}=age <= {age}
> [when]- age is less than {age}=age < {age}
> Now, if I had 10 attributes of type int, then currently from what I could read in my documentation I need to recreate these lines for each of these 10 attributes.
> Hope about a DSL that is more granular, similar to the one below ( i am just putting this up )
> [when][operator]is less than="<"
> [when][operator]is less than or equal to ="<="
> [when][operator]is greater than=">"
> [when][operator]is greater than or equal to =">="
> then, I should be able to state that since age is a int, it can use the above operators.
> A country, being a String, should not be able to use these operators.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list