Bug 777921 (SOA-450)

Summary: Decision Nodes not working, exception says decision selected non existing transition
Product: [JBoss] JBoss Enterprise SOA Platform 4 Reporter: Jeff DeLong <jdelong>
Component: JBPM - within SOAAssignee: Mark Little <mark.little>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 4.2 CR3CC: jon.folland, jwulf
Target Milestone: ---   
Target Release: 4.3 GA   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-450
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
T60 laptop running RHEL 5, Java 1.5, SOA Platform 4.2 CR3
Last Closed: 2008-09-29 11:51:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 777945    

Description Jeff DeLong 2008-03-03 15:06:40 UTC
Date of First Response: 2008-03-16 08:54:45
project_key: SOA

I have defined a process definition with the following decision node where Account is a POJO. I can see that the Account as a jBPM variable in the jBPM Admin Console. 

<decision name="Sufficient Funds in Account?" expression="#{account.balance &gt; tollTransaction.toll} ">
		<transition to="Post Toll Transaction to Account" name="true"></transition>
		<transition to="Replenish Account" name="false"></transition>
</decision>

When I execute the process, I get the following errors:

15:55:39,123 ERROR [GraphElement] action threw exception: decision 'Sufficient Funds in Account?' selected non existing transition 'true '
org.jbpm.JbpmException: decision 'Sufficient Funds in Account?' selected non existing transition 'true '
        at org.jbpm.graph.node.Decision.execute(Decision.java:102)
        at org.jbpm.graph.def.Node.enter(Node.java:319)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
        at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$b7f2fc0f.enter(<generated>)
        at org.jbpm.graph.def.Transition.take(Transition.java:151)
        at org.jbpm.graph.def.Node.leave(Node.java:394)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
        at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$b7f2fc0f.leave(<generated>)
        at org.jbpm.graph.exe.Token.signal(Token.java:195)
        at org.jbpm.graph.exe.Token.signal(Token.java:140)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
        at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$e74c698b.signal(<generated>)
        at org.jbpm.command.SignalCommand.execute(SignalCommand.java:91)
        at org.jboss.soa.esb.services.jbpm.cmd.AsyncProcessSignal$AsyncSignalAction.execute(AsyncProcessSignal.java:287)
        at org.jbpm.graph.def.Action.execute(Action.java:122)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
        at org.jbpm.graph.def.Action$$EnhancerByCGLIB$$b15cf56b.execute(<generated>)
        at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:264)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
        at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$b7f2fc0f.executeAction(<generated>)
        at org.jbpm.job.ExecuteActionJob.execute(ExecuteActionJob.java:32)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
        at org.jbpm.job.Job$$EnhancerByCGLIB$$27ab04c8.execute(<generated>)
        at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:164)
        at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:64)


I then tried the following (simpler) expression, and got a similar result:

#{account.balance > 100} 


16:07:28,807 ERROR [GraphElement] action threw exception: decision 'Sufficient Funds in Account?' selected non existing transition 'false '
org.jbpm.JbpmException: decision 'Sufficient Funds in Account?' selected non existing transition 'false '

Comment 1 Jeff DeLong 2008-03-03 15:12:43 UTC
Cross reference is JBPM-1143

Comment 2 Alejandro Guizar 2008-03-04 04:15:35 UTC
Link: Added: This issue related JBPM-1143


Comment 3 Jon Folland 2008-03-16 12:54:45 UTC
I believe there may be a bug in the Decision class where exception handling is concerned which causes this failure:

If the line: String transitionName = decisionHandler.decide(executionContext); ...

...in the method public void execute(ExecutionContext executionContext)

throws an exception which is caught here in the same method:

raiseException(exception, executionContext);

We miss the block:

      if (transition==null) {
        transition = getDefaultLeavingTransition();
        log.debug("decision didn't select transition, taking default "+transition);
      }


So when executionContext.leaveNode(transition); is called at the bottom, there wil be no transition.

I believe we need to check for a tranistion==null condition regardless of whether such an exception is called. Otherwise you will never be able to handle an exception in a Decision without an exception being thrown (which kind of defeits the point :-)

Comment 4 Mark Little 2008-03-24 16:32:39 UTC
From Jeff:

"I removed the trailing white space and the decision node worked. Thanks to whoever Ronald and Alex for pointing this out. I also commented on this in the JIRA. Bottom line is that this is a usability issue, and as Ronald points out, there are couple ways that it could be addressed. If Koen can address it in the next release of the designer that would be nice. In the meantime users just need to be careful not to add a space at the end of a decision expression."

Comment 5 Mark Little 2008-03-24 16:33:39 UTC
Link: Added: This issue is a dependency of SOA-474


Comment 6 Ronald van Kuijk 2008-04-23 21:33:33 UTC
I'm inclined to close the issue in jBPM and make a new one that is for stripping the whitespace in the core OR in the designer (when editing the xml source it will still be possible to make mistakes!!). Comments?

Jon, could you file a new issue for your remark in the jBPM project

Comment 7 Koen Aers 2008-04-24 07:44:26 UTC
I have fixed the issue in the GPD. Whitespaces are stripped for all expressions now.

Comment 8 Mark Little 2008-07-12 08:32:38 UTC
See linked issue for rejection reason.

Comment 9 Jeff DeLong 2008-07-17 02:52:02 UTC
I am a bit confused. Koen says he fixed the issue, while Mark says it was rejected.

Comment 10 nwallace 2008-09-25 20:22:16 UTC
Link: Added: This issue related SOA-866