[jboss-jira] [JBoss JIRA] (JBRULES-3517) Combining custom operators with OR results in compile error
Stathis Rouvas (JIRA)
jira-events at lists.jboss.org
Tue Jul 10 11:12:12 EDT 2012
[ https://issues.jboss.org/browse/JBRULES-3517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12705196#comment-12705196 ]
Stathis Rouvas commented on JBRULES-3517:
-----------------------------------------
Another thing to take into account is that in the line of the example
v1717 : Tra48( gnId.gNo==gNo , name F_str[startsWith] la.c547148 || postCode F_str[contains] la.c547149 )
if the order of the equality comparison is reversed, i.e. "gNo==gnId.gNo" is written instead of the original "gnId.gNo==gNo", no errors are produced and the rule fires.
> Combining custom operators with OR results in compile error
> -----------------------------------------------------------
>
> Key: JBRULES-3517
> URL: https://issues.jboss.org/browse/JBRULES-3517
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-compiler (expert)
> Affects Versions: 5.4.0.Final
> Environment: Drools.5.4.0
> Java.1.6
> Linux
> Reporter: Stathis Rouvas
> Assignee: Mario Fusco
> Labels: custom_operator
> Attachments: F_StrEvaluator.java, F_StrEvaluatorDefinition.java
>
>
> I recently migrated from Drools.5.0.1 to Drools.5.4.0 and I am having issues when combining constraints with OR when custom operators are involved.
> For example, the following rule:
> rule "r548695.1"
> no-loop true
> dialect "mvel"
> when
> gnId : GN()
> la : t547147( )
> v1717 : Tra48( gnId.gNo==gNo , name F_str[startsWith] la.c547148 || postCode F_str[contains] la.c547149 )
> then
> System.out.println("Rule r548695.1 fired");
> end
> results in the following exception:
> Unable to Analyse Expression gnId.gNo == gNo && ( F_str0.evaluate( name, la.c547148 ) || F_str1.evaluate( postCode, la.c547149 ) ):
> [Error: unable to resolve method using strict-mode: my.package.rulez.Tra48.F_str0()]
> [Near : {... gNo == gNo && ( F_str0.evaluate( name, la.c54 ....}]
> ^ : [Rule name='r548695.1']
> Please note, that the same rule using AND (&&) between the custom operators compiles OK.
> The above rule had not problem whatsoever in Drools.5.0.1.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list