cancel
Showing results for 
Search instead for 
Did you mean: 

PersistenceException when CallActivity containing ServiceTask is last item in process

sarahh
Champ in-the-making
Champ in-the-making
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:
  <bpmn2Smiley Tonguerocess id="NotificationTask" name="Notification Task" isExecutable="true">
    <bpmn2:callActivity id="CallActivity_Notification_SystemTaskFirst" name="Notification" calledElement="_SAS_NOTIFY_">
      <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
      <bpmn2Smiley Surprisedutgoing>SequenceFlow_4</bpmn2Smiley Surprisedutgoing>
    </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">
      <bpmn2Smiley Surprisedutgoing>SequenceFlow_5</bpmn2Smiley Surprisedutgoing>
    </bpmn2:startEvent>
    <bpmn2:userTask id="UserTask_1" name="UserTask">
      <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>
      <bpmn2Smiley Surprisedutgoing>SequenceFlow_6</bpmn2Smiley Surprisedutgoing>
    </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"/>
  </bpmn2Smiley Tonguerocess>


CallActivity:

  <bpmn2Smiley Tonguerocess id="_SAS_NOTIFY_" name="Notify" isExecutable="true">
    <bpmn2:serviceTask id="ServiceTask_notify" activiti:delegateExpression="${sasSystemTaskNotifyBean}" name="Notify">
      <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
      <bpmn2Smiley Surprisedutgoing>SequenceFlow_2</bpmn2Smiley Surprisedutgoing>
    </bpmn2:serviceTask>
    <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="ServiceTask_notify" targetRef="EndEvent_1"/>
    <bpmn2:startEvent id="StartEvent_1">
      <bpmn2Smiley Surprisedutgoing>SequenceFlow_1</bpmn2Smiley Surprisedutgoing>
    </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>
  </bpmn2Smiley Tonguerocess>
1 REPLY 1

vasile_dirla
Star Contributor
Star Contributor
Do you have any JUnit test for this scenario?