AnsweredAssumed Answered

Catching BPMNError does not end throwing activiti

Question asked by patryan on May 9, 2016
Latest reply on May 11, 2016 by patryan
Hi
- I have a script task in a sub process which throws a BpmnError, and an ErrorBoundaryEvent to catch it (activiti v 5.18.0)_

When I run the process I see that the script task is not ended:


select ACT_ID_  from ACT_HI_ACTINST where end_time_ is  null
gives

ACT_ID_
———–
scripttask1

- if I run it three times I get three of them - so it is effectively a leak

I would have though the catching event would have ended the throwing activity. Or do I need to do this in a finally clause?

Here is the test process definition

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="myProcess" name="My process" isExecutable="true">
    <startEvent id="startevent1" name="Start"></startEvent>
    <endEvent id="endevent1" name="End"></endEvent>
    <subProcess id="subprocess1" name="Sub Process">
      <scriptTask id="scripttask1" name="Script Task" scriptFormat="groovy" activiti:autoStoreVariables="false">
        <script>throw new org.activiti.engine.delegate.BpmnError("test")</script>
      </scriptTask>
      <startEvent id="startevent2" name="Start"></startEvent>
      <endEvent id="endevent2" name="End"></endEvent>
      <sequenceFlow id="flow2" sourceRef="startevent2" targetRef="scripttask1"></sequenceFlow>
      <sequenceFlow id="flow3" sourceRef="scripttask1" targetRef="endevent2"></sequenceFlow>
    </subProcess>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="subprocess1"></sequenceFlow>
    <sequenceFlow id="flow4" sourceRef="subprocess1" targetRef="endevent1"></sequenceFlow>
    <boundaryEvent id="boundaryerror1" name="Error" attachedToRef="subprocess1">
      <errorEventDefinition></errorEventDefinition>
    </boundaryEvent>
    <sequenceFlow id="flow5" sourceRef="boundaryerror1" targetRef="endevent1"></sequenceFlow>
  </process>
</definitions>


Outcomes