Skip to content

Commit

Permalink
[JBPM-10145] Handle SessionNotFoundException when exception process h…
Browse files Browse the repository at this point in the history
…as already ended (#2252) (#2257)

Co-authored-by: Martin Weiler <mweiler@redhat.com>
  • Loading branch information
github-actions[bot] and martinweiler committed Jan 20, 2023
1 parent f83186c commit f2d6c81
Showing 1 changed file with 8 additions and 4 deletions.
Expand Up @@ -317,11 +317,15 @@ public void cancel(CancelType cancelType) {

if (exceptionHandlingProcessInstanceId > -1) {
ProcessInstance processInstance = null;
KieRuntime kruntime = getKieRuntimeForExceptionSubprocess();
processInstance = (ProcessInstance) kruntime.getProcessInstance(exceptionHandlingProcessInstanceId);
try {
KieRuntime kruntime = getKieRuntimeForExceptionSubprocess();
processInstance = (ProcessInstance) kruntime.getProcessInstance(exceptionHandlingProcessInstanceId);

if (processInstance != null) {
processInstance.setState(ProcessInstance.STATE_ABORTED);
if (processInstance != null) {
processInstance.setState(ProcessInstance.STATE_ABORTED);
}
} catch(Exception e) {
logger.warn("Unable to obtain exceptionHandling processInstance {}", exceptionHandlingProcessInstanceId);
}
}
super.cancel(cancelType);
Expand Down

0 comments on commit f2d6c81

Please sign in to comment.