[
https://jira.jboss.org/jira/browse/JBPM-1471?page=com.atlassian.jira.plug...
]
Bernd Ruecker commented on JBPM-1471:
-------------------------------------
Refering to Tom:
"that you should not signal a process instance that has been ended sounds trivial to
me. the fact that this could occur seems a problem in the way the user models their
external triggers. (except in case of timers competing with external triggers)
only thing we should do is verify that we give an appropriate error message when this
happens."
I would propose to add a check to the token.signal() method which throws an exception if
the token is already ended. That should help, right?
@Tom: Okay from your side?
Since I have a similar problem at the moment...
Do not signal ENDED super process token when ending process instance
--------------------------------------------------------------------
Key: JBPM-1471
URL:
https://jira.jboss.org/jira/browse/JBPM-1471
Project: JBoss jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Core Engine
Affects Versions: jBPM 3.2.3
Reporter: Pavel Kadlec
Assignee: Alejandro Guizar
Fix For: jBPM 3.2.6 GA
Attachments: jbpm-console error.jpg
The path of execution of the super process token should not continue when the token was
ended. If it is not tested, the ended super process token is signalled and the path of
execution continues. I think it should not.
I suggest following fix to org.jbpm.graph.exe.ProcessInstance.end() method. There is one
change in if statement bellow...
/**
* ends (=cancels) this process instance and all the tokens in it.
*/
public void end() {
// end the main path of execution
rootToken.end();
if (end==null) {
// mark this process instance as ended
end = Clock.getCurrentTime();
// fire the process-end event
ExecutionContext executionContext = new ExecutionContext(rootToken);
processDefinition.fireEvent(Event.EVENTTYPE_PROCESS_END, executionContext);
// add the process instance end log
rootToken.addLog(new ProcessInstanceEndLog());
// check if this process was started as a subprocess of a super process
if (superProcessToken!=null && !superProcessToken.hasEnded()) { // THIS
IS THE FIX, TEST IF SUPER PROCESS TOKEN HAS ENDED
addCascadeProcessInstance(superProcessToken.getProcessInstance());
ExecutionContext superExecutionContext = new
ExecutionContext(superProcessToken);
superExecutionContext.setSubProcessInstance(this);
superProcessToken.signal(superExecutionContext);
}
// make sure all the timers for this process instance are cancelled when the
process end updates get saved in the database.
// TODO route this directly through the jobSession. just like the suspend and
resume.
// NOTE Only timers should be deleted, messages-type of jobs should be kept.
SchedulerService schedulerService = (SchedulerService)
Services.getCurrentService(Services.SERVICENAME_SCHEDULER, false);
if (schedulerService!=null) schedulerService.deleteTimersByProcessInstance(this);
}
}
--
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