[jboss-jira] [JBoss JIRA] Created: (JBRULES-2171) CLONE -No access to context in a constraint
Neil Wallace (JIRA)
jira-events at lists.jboss.org
Tue Jul 7 09:25:51 EDT 2009
CLONE -No access to context in a constraint
-------------------------------------------
Key: JBRULES-2171
URL: https://jira.jboss.org/jira/browse/JBRULES-2171
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.0.0.M5
Reporter: Neil Wallace
Assignee: Kris Verlaenen
Fix For: 5.0.1.FINAL
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 at 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: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list