[jboss-jira] [JBoss JIRA] (DROOLS-165) Fail-fast mode when a global is not defined at session start
Mario Fusco (JIRA)
jira-events at lists.jboss.org
Mon Jun 17 08:04:21 EDT 2013
[ https://issues.jboss.org/browse/DROOLS-165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mario Fusco resolved DROOLS-165.
--------------------------------
Fix Version/s: 5.5.1.Final
6.0.0.Beta4
Resolution: Done
I fixed the mvel bug causing the infinite loop and the fix will be available with the next mvel release (2.1.6) that will be used in next version of drools.
As for the proposal of adding a new keyword to check that a global is not null, I am not sure it makes sense and anyway, if so, I'd like to have it available also on other parts of the DRL (e.g.: the argument of a function?). In fact nothing prevents a rule consequence to nullify a global so it won't be enough to check for its existence only as precondition of an invocation to fireAllRules().
> Fail-fast mode when a global is not defined at session start
> ------------------------------------------------------------
>
> Key: DROOLS-165
> URL: https://issues.jboss.org/browse/DROOLS-165
> Project: Drools
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Affects Versions: 6.0.0.Beta3
> Reporter: Jan Hustak
> Assignee: Mario Fusco
> Priority: Minor
> Fix For: 5.5.1.Final, 6.0.0.Beta4
>
>
> The following DRL causes an infinite loop when run without setting the "missing" global:
> global java.util.Collection missing
> dialect "mvel"
> rule "toInfinityAndBeyond"
> when
> then
> x = missing[3]
> end
> because it triggers https://jira.codehaus.org/browse/MVEL-290
> Even though the core issue is in MVEL I would really like an option to fail fast when a global is undefined at the very start of a session. I don't know about others but I never define globals from within the rules and I've had all sorts of trouble with missing globals - the infinite loop was just the last straw.
> Of course, a global may legitimately be defined as null (which would also trigger the MVEL bug). So perhaps the fail-fast mode could be enabled on a case-by-case basis:
> global required java.util.Collection basicHelpers
> Sorry if this has been suggested before, I couldn't find any pertinent discussions.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list