[jboss-jira] [JBoss JIRA] Commented: (JBRULES-2482) Binding seems to be unreliable with MVEL dialect and mulitple evals

Chris DeLashmutt (JIRA) jira-events at lists.jboss.org
Tue May 18 09:57:06 EDT 2010


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

Chris DeLashmutt commented on JBRULES-2482:
-------------------------------------------

I've attached a proposed patch that seems to work for me, and passes the drools core tests.  Offset seems to be the incorrect property to use, and index seems to be the right one.  Based on conversations on IRC with Mark, Offset is used for nested patterns, and index is the index of the pattern within the tuple.

> Binding seems to be unreliable with MVEL dialect and mulitple evals
> -------------------------------------------------------------------
>
>                 Key: JBRULES-2482
>                 URL: https://jira.jboss.org/browse/JBRULES-2482
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-core  (expert)
>    Affects Versions: 5.1.0.M1
>         Environment: Windows 7, Sun JDK 1.6.0_17
>            Reporter: Chris DeLashmutt
>            Assignee: Mark Proctor
>         Attachments: mvel-binding-problem.zip, patch.txt.txt
>
>
> When using the MVEL dialect, a rule with multiple binds, and a chain of evals, the bindings seem to be incorrect.
> For example here is some DRL:
> rule "Modify Field Rule for Form: InterrelatedFieldsTestForm.fieldA (Set fieldA optional if values are in other fields)"
>     when
>         $fieldA: Field(id == "fieldA")
>         $fieldB: Field(id == "fieldB")
>         $fieldC: Field(id == "fieldC")
>         (eval(ValidationFunctions.isChecked($fieldA)) or eval(ValidationFunctions.isChecked($fieldB)) or eval(!ValidationFunctions.isBlank($fieldC))) 
>     then
>         ValidationFunctions.insertOperation(fieldOperations, new FieldOperation("fieldA",FieldOperation.OPTIONAL));
> end
> If I put debugging statements in to the static ValidationFunctions methods, or if I put breakpoints in those same static methods, I see invocations using bound variables that don't match what I declared.
> For instance, I'll see isBlank called with what appears to be the contents of $fieldA.
> If I combine the evals into a single eval with each condition separated by ||. everything seems to function properly.  I can't easily go back and change the syntax in my exisiting rules however, and the syntax I'm using seems to be valid based on my interpretation of the documentation.

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