AnsweredAssumed Answered

PersistenceException when CallActivity containing ServiceTask is last item in process

Question asked by sarahh on Mar 13, 2015
Latest reply on Mar 16, 2015 by vasile.dirla
I have a simple process that has a startEvent, userTask, callActivity, and endEvent. 

The callActivity calls a simple process that has a startEvent, serviceTask, and endEvent.  The serviceTask is a Java Service Task that references a bean that implements the JavaDelegate interface. 

If I activate the process and complete the userTask, it kicks off the callActivity, and executes the Java Service Task (the code in the execute() method of the JavaDelegate) without error, but I ultimately get the PersistenceException below.  I do not get this exception if the callActivity is not the last item in the process.   Is this a known problem?  Is there a workaround?  

We are using Activiti 5.1.7.  Please let me know if you need more information.

Thanks,
Sarah

org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: com.xythos.common.SqlExceptionWithParameters: delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ?
[01 (String{2}):52]
[02 (int):1]

### The error may involve org.activiti.engine.impl.persistence.entity.ExecutionEntity.deleteExecution-Inline
### The error occurred while setting parameters
### SQL: delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ?
### Cause: com.xythos.common.SqlExceptionWithParameters: delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ?
[01 (String{2}):52]
[02 (int):1]

Below are the bpmn snippets for the main process and the callActivity process.

Main:
  <bpmn2:process id="NotificationTask" name="Notification Task" isExecutable="true">
    <bpmn2:callActivity id="CallActivity_Notification_SystemTaskFirst" name="Notification" calledElement="_SAS_NOTIFY_">
      <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing>
    </bpmn2:callActivity>
    <bpmn2:sequenceFlow id="SequenceFlow_4" name="" sourceRef="CallActivity_Notification_SystemTaskFirst" targetRef="EndEvent_1"/>
    <bpmn2:endEvent id="EndEvent_1">
      <bpmn2:incoming>SequenceFlow_4</bpmn2:incoming>
    </bpmn2:endEvent>
    <bpmn2:startEvent id="StartEvent_1">
      <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing>
    </bpmn2:startEvent>
    <bpmn2:userTask id="UserTask_1" name="UserTask">
      <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>
    </bpmn2:userTask>
    <bpmn2:sequenceFlow id="SequenceFlow_5" name="" sourceRef="StartEvent_1" targetRef="UserTask_1"/>
    <bpmn2:sequenceFlow id="SequenceFlow_6" name="" sourceRef="UserTask_1" targetRef="CallActivity_Notification_SystemTaskFirst"/>
  </bpmn2:process>


CallActivity:

  <bpmn2:process id="_SAS_NOTIFY_" name="Notify" isExecutable="true">
    <bpmn2:serviceTask id="ServiceTask_notify" activiti:delegateExpression="${sasSystemTaskNotifyBean}" name="Notify">
      <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
    </bpmn2:serviceTask>
    <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="ServiceTask_notify" targetRef="EndEvent_1"/>
    <bpmn2:startEvent id="StartEvent_1">
      <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
    </bpmn2:startEvent>
    <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="StartEvent_1" targetRef="ServiceTask_notify"/>
    <bpmn2:endEvent id="EndEvent_1">
      <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
    </bpmn2:endEvent>
  </bpmn2:process>

Outcomes