]
Chris DeLashmutt updated JBRULES-2482:
--------------------------------------
Attachment: mvel-binding-problem.zip
Failing test case and DRL.
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
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: