[jboss-jira] [JBoss JIRA] Resolved: (JBRULES-1978) No access to context in a constraint
Kris Verlaenen (JIRA)
jira-events at lists.jboss.org
Thu May 14 00:22:46 EDT 2009
[ https://jira.jboss.org/jira/browse/JBRULES-1978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kris Verlaenen resolved JBRULES-1978.
-------------------------------------
Fix Version/s: 5.0.0.GA
Resolution: Done
This issue has already been fixed, the test code now contains tests for access to the context and kcontext variables, the variables directly and globals for both Java and MVEL dialect.
Not that you can now also access process variables inside Java directly, so it would can simply use the job variable directly whenever necessary.
> 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
> Fix For: 5.0.0.GA
>
>
> 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