[
https://jira.jboss.org/jira/browse/JBPM-1954?page=com.atlassian.jira.plug...
]
Alejandro Guizar commented on JBPM-1954:
----------------------------------------
Que tal, Jorge.
Your original comment did not explicitly state that the specific case you considered
anomalous was the exception thrown by a delegation class being handled but not rethrown.
My comment in no way meant that things should be left as they were, just that the proposed
solution was, in my view, not immediately applicable and needed further discussion.
Taking the additional input from your last comment I wrote a test case and observed the
JbpmException you described. I agree that since the original exception was handled, the
subsequent JbpmException is out of place. I still disagree on the proposed solution,
tough. The decision node is not a state. Under no circumstances should the token stay
there. After an exception is handled, no decision has been made on the transition to take.
The existing Decision.execute code already contains the proviso below in case no
transition was selected.
if (transition == null) {
transition = getDefaultLeavingTransition();
if (transition == null)
throw new IllegalStateException("decision cannot select transition: "
+ this);
}
I believe the above is the most adequate way to resume execution after an exception is
handled. Of course, if the exception handler has moved the token to a different node, then
the execute() method should just return, as you propose.
JbpmException thrown from Decision after exception in delegation
class
----------------------------------------------------------------------
Key: JBPM-1954
URL:
https://jira.jboss.org/jira/browse/JBPM-1954
Project: JBoss jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Core Engine
Affects Versions: jBPM 3.2.2, jBPM 3.2.3
Environment: Ubuntu 8.4 / JDK 1.6.0_07
Reporter: Jorge Soria
Assignee: Alejandro Guizar
Fix For: jBPM 3.2.6 GA
A JbpmException with explanation "can't leave node 'xxx' without leaving
transition" is thrown in the following case:
1. A Decision node with a delegation class is defined in the processdefinition.xml.
2. The delegation class throws an exception.
3. The exception may or may not be handled by a custom ExceptionHandler.
Explanation:
The method Decision.execute(ExecutionContext) handles the decisionDelegation in its own
block. The delegation class is executed and its result is used to choose the transition.
If the delegation class throws an exception, the transition cannot be set. This produces
later a JbpmException in Node.leave(Transtion).
Proposed solution:
This is a localized problem, restricted to one method only.
Since the Token cannot find a proper transition, the process should be aborted. The
following is the diff for a patch in Decision.java:
149,155d148
<
< // Exceptions in delegation classes occur before a transition is chosen.
< // Since no transition is possible, just abort the process.
< // Custom exception handling may divert/end the process gracefully.
< if(transition == null) {
< return;
< }
--
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