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
- 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


- 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="" xmlns:xsi="" xmlns:xsd="" xmlns:activiti="" xmlns:bpmndi="" xmlns:omgdc="" xmlns:omgdi="" typeLanguage="" expressionLanguage="" targetNamespace="">
  <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>
      <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>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="subprocess1"></sequenceFlow>
    <sequenceFlow id="flow4" sourceRef="subprocess1" targetRef="endevent1"></sequenceFlow>
    <boundaryEvent id="boundaryerror1" name="Error" attachedToRef="subprocess1">
    <sequenceFlow id="flow5" sourceRef="boundaryerror1" targetRef="endevent1"></sequenceFlow>