]
Mark Proctor updated JBRULES-1978:
----------------------------------
Assignee: Kris Verlaenen (was: Mark Proctor)
No access to context in a constraint
------------------------------------
Key: JBRULES-1978
URL:
https://jira.jboss.org/jira/browse/JBRULES-1978
Project: JBoss Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 5.0.0.M5
Reporter: Lukas Petrovicky
Assignee: Kris Verlaenen
Say I have a class Job with a method isFinished() that returns boolean. Also in a process
context, I have a variable "job" of the type "Job". In a constraint on
a split node, the following happens:
a) When the constraint is in mvel dialect, the code "((Job)job).finished" is
correct.
b) When the constraint is in Java dialect, the code "Job j =
(Job)(context.getVariable("job"));" gets me the following compilation
error:
Process Compilation error : org.drools.lang.descr.ProcessDescr@48f675
[omitted] (27:1248) : context cannot be resolved
The documentation of this is quite clear: "Code constraints are expressions that
return a boolean value. They have access to the context variable. MVEL code constraints
also have direct access to the variables."
Therefore I think this is a bug.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: