12-10-2018 06:48 PM
Hi,
I have created a process that has multiple service tasks in a sequence. When I start the process, first and 2nd tasks are executed however, the rest of them are not executed. I thought this is a simple flow but couldn't figure out what is blocking some of the tasks. Here is my process. Anything wrong in the 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/cms">
<process id="FileOrchestrationProcess" name="File Orchestration Process" isExecutable="true">
<startEvent id="startevent1" name="Start"></startEvent>
<serviceTask id="ecmUpload" name="Upload Service" activiti:async="true" activiti:delegateExpression="${ecmUploadService}"></serviceTask>
<sequenceFlow id="flow1" name=" 1" sourceRef="startevent1" targetRef="ecmUpload"></sequenceFlow>
<dataObject id="ef.id" name="ef.id" itemSubjectRef="xsd:string">
<extensionElements>
<activiti:value></activiti:value>
</extensionElements>
</dataObject>
<serviceTask id="fileParsing" name="Prase file" activiti:delegateExpression="${etlfileParsingService}">
</serviceTask>
<sequenceFlow id="flow2" name=" 2" sourceRef="ecmUpload" targetRef="fileParsing"></sequenceFlow>
<serviceTask id="dataValidation" name="Validation" activiti:delegateExpression="${etlfileValidationService}">
</serviceTask>
<sequenceFlow id="flow3" name=" 3" sourceRef="fileParsing" targetRef="dataValidation"></sequenceFlow>
<serviceTask id="rawToCms" name="Load from Raw" activiti:delegateExpression="${etlRawToCmsService}">
</serviceTask>
<sequenceFlow id="flow4" name=" 4" sourceRef="dataValidation" targetRef="rawToCms"></sequenceFlow>
<serviceTask id="cmsToTransaction" name="Load Transaction" activiti:delegateExpression="${etlCmsToTxService}">
</serviceTask>
<sequenceFlow id="flow5" name=" 5" sourceRef="rawToCms" targetRef="cmsToTransaction"></sequenceFlow>
<endEvent id="terminateendevent1" name="TerminateEndEvent">
<terminateEventDefinition></terminateEventDefinition>
</endEvent>
<sequenceFlow id="flow6" name=" 6" sourceRef="cmsToTransaction" targetRef="terminateendevent1"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_earningFileOrchestrationProcess">
<bpmndi:BPMNPlane bpmnElement="earningFileOrchestrationProcess" id="BPMNPlane_earningFileOrchestrationProcess">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35.0" width="35.0" x="120.0" y="230.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ecmUpload" id="BPMNShape_ecmUpload">
<omgdc:Bounds height="71.0" width="105.0" x="190.0" y="212.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="fileParsing" id="BPMNShape_fileParsing">
<omgdc:Bounds height="71.0" width="111.0" x="330.0" y="212.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="dataValidation" id="BPMNShape_dataValidation">
<omgdc:Bounds height="71.0" width="105.0" x="480.0" y="212.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="rawToCms" id="BPMNShape_rawToCms">
<omgdc:Bounds height="71.0" width="111.0" x="620.0" y="212.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="cmsToTransaction" id="BPMNShape_cmsToTransaction">
<omgdc:Bounds height="73.0" width="111.0" x="760.0" y="211.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="terminateendevent1" id="BPMNShape_terminateendevent1">
<omgdc:Bounds height="35.0" width="35.0" x="900.0" y="230.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="155.0" y="247.0"></omgdi:waypoint>
<omgdi:waypoint x="190.0" y="247.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="100.0" x="153.0" y="230.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="295.0" y="247.0"></omgdi:waypoint>
<omgdi:waypoint x="330.0" y="247.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="100.0" x="293.0" y="230.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="441.0" y="247.0"></omgdi:waypoint>
<omgdi:waypoint x="480.0" y="247.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="100.0" x="439.0" y="230.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="585.0" y="247.0"></omgdi:waypoint>
<omgdi:waypoint x="620.0" y="247.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="100.0" x="583.0" y="230.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="731.0" y="247.0"></omgdi:waypoint>
<omgdi:waypoint x="760.0" y="247.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="100.0" x="729.0" y="230.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="871.0" y="247.0"></omgdi:waypoint>
<omgdi:waypoint x="900.0" y="247.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="100.0" x="867.0" y="230.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
12-10-2018 07:48 PM
Figured out the issue. There is no problem with Process Definition. My Implementation classes were implementing the ActivityBehavior interface instead of JavaDelegate interface. Only the first task is implementing the JavaDelegate.
Whichever has implementation for JavaDelegate interface, ran successfully and which has ActivityBehavior implementation did not run.
After changing everything to JavaDelegate implementation, everything is working fine.
What is the difference between them and can't we use interchangeably?
12-11-2018 03:34 AM
This is from the user guide, sounds like they are quite different.
[INTERNAL: non-public implementation classes] It is also possible to provide a class that implements the org.activiti.engine.impl.pvm.delegate.ActivityBehavior interface. Implementations have then access to the more powerful ActivityExecution that for example also allows to influence the control flow of the process. Note however that this is not a very good practice, and should be avoided as much as possible. So, it is advised to use the ActivityBehavior interface only for advanced use cases and if you know exactly what you’re doing.
12-12-2018 01:38 PM
Thanks PaulT _
Explore our Alfresco products with the links below. Use labels to filter content by product module.