[jboss-jira] [JBoss JIRA] Commented: (JBRULES-2671) Allow relational operators for String

Toshiya Kobayashi (JIRA) jira-events at lists.jboss.org
Fri Aug 20 05:27:11 EDT 2010


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

Toshiya Kobayashi commented on JBRULES-2671:
--------------------------------------------

Attached patch is simply adds StringXXXEvaluators. If StringXXXEvaluators extends ObjectXXXEvaluators, a bit refactoring will be needed, I guess. 

> Allow relational operators for String
> -------------------------------------
>
>                 Key: JBRULES-2671
>                 URL: https://jira.jboss.org/browse/JBRULES-2671
>             Project: Drools
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: drools-core  (expert)
>    Affects Versions: 5.1.0.FINAL
>            Reporter: Toshiya Kobayashi
>            Assignee: Mark Proctor
>         Attachments: JBRULES-2671-testcase.patch, JBRULES-2671.patch
>
>
> Currently you cannot use relational operators for String fields. e.g. MyFact(name > "bbb")
> org.drools.base.evaluators.ComparableEvaluatorsDefinition.evaluators has entries for ValueType.OBJECT_TYPE, but not for ValueType.STRING_TYPE. So it results in DescrBuildError:
> =========
> Evaluator '>' does not support type 'ValueType = 'String' : [Rule name='Your First Rule']
> Unable to create restriction '[LiteralRestriction: > bbb]' for field 'name' in the rule 'Your First Rule' : [Rule name='Your First Rule'] 
> =========
> According to docs:
> 4.8.3.1.1.3.1. Operators
> "Other relational operatory may be used whenever the type values are ordered;"
> http://downloads.jboss.com/drools/docs/5.1.0.34406.FINAL/drools-expert/html_single/index.html#RuleLanguage-ConditionalElements
> It is desirable to allow relational operators for String fields as String is Comparable.

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

        


More information about the jboss-jira mailing list