[
https://jira.jboss.org/jira/browse/JBPM-1954?page=com.atlassian.jira.plug...
]
Jorge Soria commented on JBPM-1954:
-----------------------------------
Hola Alejandro.
In principle you are right. An exception should be thrown back to the infringer and this
is sound whenever we do not have any exception-handler. However, if we have an
exception-handler, it will try to execute correction code and then return. In our case, we
have a custom exception-handler that makes the process end gracefully. And it does so
without any problems, but when it returns from the call inline 148
raiseException(exception, executionContext);
the Decision has swallowed up the exception and .... continues to the next node with
transition = null.
The result is then that the exception that should be thrown has disappeared and the client
gets an unrelated exception that is indeed hard to relate to.
What you sugest is to leave things as they are, because the raiseException() method
already re-throws the exception if there is no exception-handler. What I sugest is to
comply to the jBPM philosophy and, if the exception-handler has done its job, continue
with the process as it is defined, or from the state the exception-handler has left it
in.
The problem with just re-throwing the exception or leaving the code as it is, is that the
process no longer complies with the central statement in "JBoss jBPM - Workflow in
Java. jBPM jPDL User Guide. 3.2.3" section 10.7:
"The exception handling mechanism of jBPM only applies to java exceptions. Graph
execution on itself cannot result in problems. It is only the execution of delegation
classes that can lead to exceptions."
and that the exception-handler is executed and so discarded, leaving the process in an
unknown state.
Saludos.
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