Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-10074

Abort fails with SessionNotFoundException for process instance with multiple REST WorkItemHandlers and RETRY strategy

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.70.0.Final
    • None
    • None

      Given the following conditions:

      • A process definition containing two (or more) REST WorkItemHandler nodes
      • The REST WIH is configured using an error-handling process with RETRY strategy:
        new org.jbpm.process.workitem.rest.RESTWorkItemHandler(classLoader, "ExceptionHandlingProcess", "RETRY")
        

      Executing this process in a way that the first REST execution is successful, and the second one fails leads to the retry sub-process to get executed one additional time:

      // successful REST call for WIH node#1
      processInstanceId = 1 REST (two) entry
      processInstanceId = 1 REST (two) exit
      
      // failing REST call for WIH node#2
      processInstanceId = 1 REST (two) entry
      Exception handling process called 2
      Exception handling process called 3
      Exception handling process called 4
      Exception handling process called 5
      
      // one additional execution of the error handling process
      Exception handling process called 6
      

      Attempting to abort such a process instance fails with a SessionNotFoundException:

      org.kie.internal.runtime.manager.SessionNotFoundException: No session found for context 5
      	at org.jbpm.runtime.manager.impl.PerProcessInstanceRuntimeManager$PerProcessInstanceInitializer.initKieSession(PerProcessInstanceRuntimeManager.java:572)
      	at org.jbpm.runtime.manager.impl.RuntimeEngineImpl.internalGetKieSession(RuntimeEngineImpl.java:163)
      	at org.jbpm.runtime.manager.impl.RuntimeEngineImpl.getKieSession(RuntimeEngineImpl.java:74)
      	at org.jbpm.workflow.instance.node.WorkItemNodeInstance.getKieRuntimeForSubprocess(WorkItemNodeInstance.java:614)
      	at org.jbpm.workflow.instance.node.WorkItemNodeInstance.getKieRuntimeForExceptionSubprocess(WorkItemNodeInstance.java:596)
      	at org.jbpm.workflow.instance.node.WorkItemNodeInstance.cancel(WorkItemNodeInstance.java:320)
      	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.cancel(NodeInstanceImpl.java:161)
      	at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.setState(WorkflowProcessInstanceImpl.java:452)
      	at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.setState(WorkflowProcessInstanceImpl.java:497)
      	at org.jbpm.process.instance.ProcessRuntimeImpl.abortProcessInstance(ProcessRuntimeImpl.java:575)
      

              rhn-support-egonzale Enrique Gonzalez Martinez (Inactive)
              rhn-support-egonzale Enrique Gonzalez Martinez (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: