cancel
Showing results for 
Search instead for 
Did you mean: 

Service tasks are not executing sequentially

basu
Champ in-the-making
Champ in-the-making
Hi,
I created a task and flow is shown in the attachment.

Start –> UserTask —> ServiceTask1 —> ServiceTask2 —>ServiceTask3 –> End

After the build was successfull for the above task and generated the bar file I deployed it from activiti probe. Now when I start the process its executing upto ServiceTask1 and its saying Task was successfully completed. I need all the tasks to be executed sequentially one after another up to end. I am not seeing any exceptions in the logs. Please let me know if I missed any thing for the complete process to be completed from the below code snippet.


<?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:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="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="simpletask" name="SimpleTask">
    <startEvent id="startevent2" name="Start"></startEvent>
    <userTask id="usertask12" name="Authenticate" activiti:assignee="kermit" activiti:formKey="taskforms/request.form"></userTask>
    <sequenceFlow id="flow94" name="" sourceRef="startevent2" targetRef="usertask12"></sequenceFlow>
    <serviceTask id="servicetask65" name="Task1" activiti:class="org.task.Task1">
      <extensionElements>
        <activiti:field name="server">
          <activiti:string>abc</activiti:string>
        </activiti:field>
        <activiti:field name="command">
          <activiti:string>xyz</activiti:string>
        </activiti:field>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow95" name="" sourceRef="usertask12" targetRef="servicetask65"></sequenceFlow>
    <serviceTask id="servicetask66" name="Task2" activiti:class="org.task.Task1">
      <extensionElements>
        <activiti:field name="server">
          <activiti:string>def</activiti:string>
        </activiti:field>
        <activiti:field name="command">
          <activiti:string>xyz</activiti:string>
        </activiti:field>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow96" name="" sourceRef="servicetask65" targetRef="servicetask66"></sequenceFlow>
    <serviceTask id="servicetask67" name="Task3" activiti:class="org.task.Task1">
      <extensionElements>
        <activiti:field name="server">
          <activiti:string>mnp</activiti:string>
        </activiti:field>
        <activiti:field name="command">
          <activiti:string>qwe</activiti:string>
        </activiti:field>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow97" name="" sourceRef="servicetask66" targetRef="servicetask67"></sequenceFlow>
    <endEvent id="endevent2" name="End"></endEvent>
    <sequenceFlow id="flow98" name="" sourceRef="servicetask67" targetRef="endevent2"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_simpletask">
    <bpmndi:BPMNPlane bpmnElement="simpletask" id="BPMNPlane_simpletask">
      <bpmndi:BPMNShape bpmnElement="startevent2" id="BPMNShape_startevent2">
        <omgdc:Bounds height="55" width="55" x="62" y="100"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask12" id="BPMNShape_usertask12">
        <omgdc:Bounds height="55" width="105" x="160" y="100"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="servicetask65" id="BPMNShape_servicetask65">
        <omgdc:Bounds height="55" width="105" x="310" y="100"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="servicetask66" id="BPMNShape_servicetask66">
        <omgdc:Bounds height="55" width="105" x="470" y="100"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="servicetask67" id="BPMNShape_servicetask67">
        <omgdc:Bounds height="55" width="105" x="630" y="100"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2">
        <omgdc:Bounds height="55" width="55" x="800" y="100"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow94" id="BPMNEdge_flow94">
        <omgdi:waypoint x="117" y="127"></omgdi:waypoint>
        <omgdi:waypoint x="160" y="127"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow95" id="BPMNEdge_flow95">
        <omgdi:waypoint x="265" y="127"></omgdi:waypoint>
        <omgdi:waypoint x="310" y="127"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow96" id="BPMNEdge_flow96">
        <omgdi:waypoint x="415" y="127"></omgdi:waypoint>
        <omgdi:waypoint x="470" y="127"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow97" id="BPMNEdge_flow97">
        <omgdi:waypoint x="575" y="127"></omgdi:waypoint>
        <omgdi:waypoint x="630" y="127"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow98" id="BPMNEdge_flow98">
        <omgdi:waypoint x="735" y="127"></omgdi:waypoint>
        <omgdi:waypoint x="800" y="127"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>


Thank,
Basu
4 REPLIES 4

frederikherema1
Star Contributor
Star Contributor
When an exception occurs when execution the process, the transaction will be rolled back to the last wait-state (or start of process is canceled if process is started). How do you check if only servicetask 1 has been executed? You are using the same activiti:class for all 3 the tasks.

What is the state of the process in the DB (ACT_RU_EXECUTION) after executing the process?

basu
Champ in-the-making
Champ in-the-making
Hi,
Thank you for your response. I am using same class for all the service tasks but with different arguments as shown in the XML file(I modified the original arguments which I am using in my original task).
When I check the log file… ServiceTask1 logs are printing on the log file and it seems its not moving to ServiceTask2. But on UI its displaying "Task was successfully completed". I am expecting to see ServiceTask2 and ServiceTask3 logs on log file.

I checked act_ru_execution table and IS_ACTIVE_ is showing as 1 for this task.

Thanks,
Basu.

jbarrez
Star Contributor
Star Contributor
What interface is your class implementing? If its ActivityBehavior, then you will need to continue the process yourself.
It is more preferred to use the JavaDelegate interface instead, as described in the userguide. The ActivityBehavior is only intended for users that 100% know what they're doing, and get more powerful features that way.

basu
Champ in-the-making
Champ in-the-making
Thank you very much for your response. I am implementing ActivityBehavior Interface and now changed to JavaDelegate Interface. Its working now.

Thanks,
Basu