Bug 821085 - Ruleflow groups are deactivated before the last activation in the group fires
Ruleflow groups are deactivated before the last activation in the group fires
Status: VERIFIED
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion) (Show other bugs)
BRMS 5.3.0.GA
All All
unspecified Severity urgent
: ER9
: BRMS 5.3.0.GA
Assigned To: Edson Tirelli
Tomas Schlosser
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-11 16:13 EDT by Edson Tirelli
Modified: 2012-06-21 06:38 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBRULES-3504 None Closed Ruleflow groups are deactivating before firing the last activation in the group 2012-06-21 06:34:21 EDT

  None (edit)
Description Edson Tirelli 2012-05-11 16:13:44 EDT
Description of problem:
The fix to JBRULES-3374/BZ-761707 introduced a regression where the ruleflow group was being deactivated before firing the last activation in the group. This is wrong, among other things, because that activation can execute working memory actions that might activate other rules in the same group, in which case the ruleflow group should not be deactivated in the first place.

How reproducible:
Execute the StockTick example in the droolsjbpm-integration module:

https://github.com/droolsjbpm/droolsjbpm-integration/blob/5.3.x/droolsjbpm-integration-examples/src/main/java/org/drools/examples/broker/BrokerExample.java

Steps to Reproduce:
Execute the example.
  
Actual results:
Raises an exception. See additional details bellow for the full stack trace.

Expected results:
Examples executes without any errors.

Additional info:
Unexpected exception caught: Exception executing consequence for rule "If the drop is between 5% and 6%, do nothing" in org.drools.examples.broker: [Error: drools.insert( pa ): Unexpected exception executing action org.jbpm.process.instance.event.DefaultSignalManager$SignalAction@11c135c]
[Near : {... with( pa = new PortfolioAction ....}]
             ^
[Line: 1, Column: 1]
Exception executing consequence for rule "If the drop is between 5% and 6%, do nothing" in org.drools.examples.broker: [Error: drools.insert( pa ): Unexpected exception executing action org.jbpm.process.instance.event.DefaultSignalManager$SignalAction@11c135c]
[Near : {... with( pa = new PortfolioAction ....}]
             ^
[Line: 1, Column: 1]
	at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
	at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1274)
	at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1205)
	at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1433)
	at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:710)
	at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:674)
	at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:230)
	at org.drools.examples.broker.Broker.receive(Broker.java:72)
	at org.drools.examples.broker.events.EventFeeder$FeedJob.execute(EventFeeder.java:83)
	at org.drools.time.impl.DefaultTimerJobInstance.call(DefaultTimerJobInstance.java:46)
	at org.drools.time.impl.DefaultTimerJobInstance.call(DefaultTimerJobInstance.java:13)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:679)
Caused by: [Error: drools.insert( pa ): Unexpected exception executing action org.jbpm.process.instance.event.DefaultSignalManager$SignalAction@11c135c]
[Near : {... with( pa = new PortfolioAction ....}]
             ^
[Line: 1, Column: 1]
	at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:416)
	at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:143)
	at org.mvel2.ast.ASTNode.optimize(ASTNode.java:159)
	at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:115)
	at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
	at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:123)
	at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:116)
	at org.mvel2.MVEL.executeExpression(MVEL.java:930)
	at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:101)
	at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1264)
	... 16 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:1105)
	at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:987)
	at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:377)
	... 25 more
Caused by: org.drools.RuntimeDroolsException: Unexpected exception executing action org.jbpm.process.instance.event.DefaultSignalManager$SignalAction@11c135c
	at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:979)
	at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:322)
	at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:298)
	at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:888)
	at org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:187)
	at org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:181)
	... 32 more
Caused by: org.jbpm.workflow.instance.WorkflowRuntimeException: [adjust position:2 - Take Action:11] -- XOR split could not find at least one valid outgoing connection for split Take Action
	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:130)
	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:205)
	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:164)
	at org.jbpm.workflow.instance.impl.ExtendedNodeInstanceImpl.triggerCompleted(ExtendedNodeInstanceImpl.java:47)
	at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:162)
	at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:143)
	at org.jbpm.workflow.instance.node.RuleSetNodeInstance.signalEvent(RuleSetNodeInstance.java:73)
	at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:332)
	at org.jbpm.process.instance.event.DefaultSignalManager.internalSignalEvent(DefaultSignalManager.java:81)
	at org.jbpm.process.instance.event.DefaultSignalManager$SignalAction.execute(DefaultSignalManager.java:181)
	at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:977)
	... 37 more
Caused by: java.lang.IllegalArgumentException: XOR split could not find at least one valid outgoing connection for split Take Action
	at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:98)
	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)
	... 47 more
Comment 1 Edson Tirelli 2012-05-11 16:15:19 EDT
Requesting blocker status for BRMS 5.3.0 release as this regression is critical.
Comment 2 JBoss JIRA Server 2012-05-11 16:16:09 EDT
Edson Tirelli <ed.tirelli@gmail.com> updated the status of jira JBRULES-3504 to Resolved
Comment 3 JBoss JIRA Server 2012-05-11 16:16:14 EDT
Edson Tirelli <ed.tirelli@gmail.com> updated the status of jira JBRULES-3504 to Closed
Comment 4 Edson Tirelli 2012-05-17 10:24:49 EDT
Fix cherry-picked into 5.3.x branch:

https://github.com/droolsjbpm/drools/commit/3a4536171d808d6d096fb1a854a464226fe4819e
Comment 5 Ryan Zhang 2012-05-25 05:07:44 EDT
Please verify them on ER8.
Comment 6 Edson Tirelli 2012-05-25 08:57:50 EDT
There was a corner case that was still not fixed in this issue that was found by the jBPM team. I am reassigning the ticket to me to fix it.
Comment 8 Ryan Zhang 2012-06-13 05:32:22 EDT
This issue's fixes  have been picked by ER9. Please verify them on ER9.
Comment 9 Lukáš Petrovický 2012-06-21 06:38:54 EDT
The fixes didn't introduce any side-effects, marking as VERIFIED.

Note You need to log in before you can comment on or make changes to this bug.