Bug 821085 - Ruleflow groups are deactivated before the last activation in the group fires
Summary: Ruleflow groups are deactivated before the last activation in the group fires
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: BRMS 5.3.0.GA
Hardware: All
OS: All
unspecified
urgent
Target Milestone: ER9
: BRMS 5.3.0.GA
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-11 20:13 UTC by Edson Tirelli
Modified: 2025-02-10 03:19 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-02-10 03:19:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBRULES-3504 0 None Closed Ruleflow groups are deactivating before firing the last activation in the group 2012-06-21 10:34:21 UTC

Description Edson Tirelli 2012-05-11 20:13:44 UTC
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 20:15:19 UTC
Requesting blocker status for BRMS 5.3.0 release as this regression is critical.

Comment 2 JBoss JIRA Server 2012-05-11 20:16:09 UTC
Edson Tirelli <ed.tirelli> updated the status of jira JBRULES-3504 to Resolved

Comment 3 JBoss JIRA Server 2012-05-11 20:16:14 UTC
Edson Tirelli <ed.tirelli> updated the status of jira JBRULES-3504 to Closed

Comment 4 Edson Tirelli 2012-05-17 14:24:49 UTC
Fix cherry-picked into 5.3.x branch:

https://github.com/droolsjbpm/drools/commit/3a4536171d808d6d096fb1a854a464226fe4819e

Comment 5 Ryan Zhang 2012-05-25 09:07:44 UTC
Please verify them on ER8.

Comment 6 Edson Tirelli 2012-05-25 12:57:50 UTC
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 09:32:22 UTC
This issue's fixes  have been picked by ER9. Please verify them on ER9.

Comment 9 Lukáš Petrovický 2012-06-21 10:38:54 UTC
The fixes didn't introduce any side-effects, marking as VERIFIED.

Comment 15 Red Hat Bugzilla 2025-02-10 03:19:50 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.


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