05-09-2022 09:44 PM
Hello guy
i've custom workflow multiple user like ParallelReview. Workflow can start and assign but last people have error
training.bpmn20.xml
<?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/test"> <process id="tkfTraining" name="F-HR-003" isExecutable="true"> <extensionElements> <activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener"> <activiti:field name="script"> <activiti:string><![CDATA[execution.setVariable('scwf_approveCount', 0); execution.setVariable('scwf_rejectCount', 0); execution.setVariable('scwf_reviewerCount', bpm_assignees.size());]]></activiti:string> </activiti:field> </activiti:executionListener> </extensionElements> <startEvent id="start" name="Start" activiti:formKey="scwf:submitTrainingTask"></startEvent> <sequenceFlow id="flow1" sourceRef="start" targetRef="trainingtask"></sequenceFlow> <userTask id="trainingtask" name="Training task" activiti:assignee="${reviewAssignee.properties.userName}" activiti:formKey="scwf:activityTrainingTask"> <extensionElements> <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field name="script"> <activiti:string><![CDATA[if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;]]></activiti:string> </activiti:field> </activiti:taskListener> <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field name="script"> <activiti:string><![CDATA[if(task.getVariableLocal('scwf_reviewOutcome') == 'Acknowledge' }) { var newApprovedCount = scwf_approveCount + 1; execution.setVariable('scwf_approveCount', newApprovedCount); }]]></activiti:string> </activiti:field> </activiti:taskListener> </extensionElements> <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="bpm_assignees" activiti:elementVariable="reviewAssignee"> <completionCondition>${scwf_approveCount == scwf_reviewerCount}</completionCondition> </multiInstanceLoopCharacteristics> </userTask> <sequenceFlow id="flow2" sourceRef="trainingtask" targetRef="AcknowledgedDecision"></sequenceFlow> <exclusiveGateway id="AcknowledgedDecision" name="Acknowledged Decision"></exclusiveGateway> <sequenceFlow id="flow3" sourceRef="AcknowledgedDecision" targetRef="acknowledge"> <conditionExpression xsi:type="tFormalExpression"><![CDATA[${scwf_approveCount == scwf_reviewerCount}]]></conditionExpression> </sequenceFlow> <sequenceFlow id="flow4" sourceRef="AcknowledgedDecision" targetRef="unknowledge"></sequenceFlow> <userTask id="acknowledge" name="Acknowledge" activiti:assignee="${initiator.properties.userName}" activiti:formKey="scwf:acknowledgtask"> <extensionElements> <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field name="script"> <activiti:string><![CDATA[if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority; // Set parallel review params on task, to be kept in history task.setVariableLocal('scwf_reviewerCount', scwf_reviewerCount); task.setVariableLocal('scwf_approveCount', scwf_approveCount);]]></activiti:string> </activiti:field> </activiti:taskListener> <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field name="script"> <activiti:string><![CDATA[if(task.getVariableLocal('scwf_reviewOutcome') == 'Acknowledge' }) { var newApprovedCount = scwf_approveCount + 1; execution.setVariable('scwf_approveCount', newApprovedCount); } ]]></activiti:string> </activiti:field> </activiti:taskListener> </extensionElements> </userTask> <userTask id="unknowledge" name="Unknowledged" activiti:assignee="${initiator.properties.userName}" activiti:formKey="scwf:unknowledgtask"> <extensionElements> <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field name="script"> <activiti:string><![CDATA[if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority; // Set parallel review params on task, to be kept in history task.setVariableLocal('scwf_reviewerCount', scwf_reviewerCount); task.setVariableLocal('scwf_approveCount', scwf_approveCount);]]></activiti:string> </activiti:field> </activiti:taskListener> <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field name="script"> <activiti:string><![CDATA[if(task.getVariableLocal('scwf_reviewOutcome') == 'Unknowledge' }) { var newRejectedCount = scwf_approveCount - 1; execution.setVariable('scwf_approveCount', newRejectedCount); }]]></activiti:string> </activiti:field> </activiti:taskListener> </extensionElements> </userTask> <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway> <sequenceFlow id="flow5" sourceRef="acknowledge" targetRef="exclusivegateway1"></sequenceFlow> <sequenceFlow id="flow6" sourceRef="unknowledge" targetRef="exclusivegateway1"></sequenceFlow> <exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway> <sequenceFlow id="flow7" sourceRef="exclusivegateway1" targetRef="exclusivegateway2"></sequenceFlow> <userTask id="sentmgr" name="Sentmanager" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="scwf:sentmgrTask"> <extensionElements> <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field name="script"> <activiti:string><![CDATA[execution.setVariable('wf_reviewOutcome', task.getVariable('wf_reviewOutcome'));]]></activiti:string> </activiti:field> </activiti:taskListener> </extensionElements> </userTask> <sequenceFlow id="flow8" sourceRef="exclusivegateway2" targetRef="sentmgr"> <conditionExpression xsi:type="tFormalExpression"><![CDATA[${scwf_approveCount == scwf_reviewerCount}]]></conditionExpression> </sequenceFlow> <userTask id="revise" name="Revise" activiti:assignee="${initiator.properties.userName}" activiti:formKey="scwf:activitiRevise"> <extensionElements> <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field name="script"> <activiti:string><![CDATA[if(task.getVariableLocal('scwf_reviseOutcome') == 'Re-submit') { execution.setVariable('scwf_resubmit', true); } else { execution.setVariable('scwf_resubmit', false); }]]></activiti:string> </activiti:field> </activiti:taskListener> </extensionElements> </userTask> <sequenceFlow id="flow9" sourceRef="exclusivegateway2" targetRef="revise"> <conditionExpression xsi:type="tFormalExpression"><![CDATA[${scwf_approveCount < scwf_reviewerCount}]]></conditionExpression> </sequenceFlow> <sequenceFlow id="flow10" sourceRef="revise" targetRef="trainingtask"> <conditionExpression xsi:type="tFormalExpression"><![CDATA[${scwf_resubmit == true}]]></conditionExpression> </sequenceFlow> <exclusiveGateway id="exclusivegateway3" name="Exclusive Gateway"></exclusiveGateway> <sequenceFlow id="flow11" sourceRef="sentmgr" targetRef="exclusivegateway3"></sequenceFlow> <userTask id="mgrapprove" name="Mananger Approve" activiti:assignee="${initiator.properties.userName}" activiti:formKey="scwf:activitimgrapprove"></userTask> <sequenceFlow id="flow12" sourceRef="exclusivegateway3" targetRef="mgrapprove"></sequenceFlow> <userTask id="mgrreject" name="Manager Reject" activiti:assignee="${initiator.properties.userName}" activiti:formKey="scwf:activitimgrreject"></userTask> <sequenceFlow id="flow13" sourceRef="exclusivegateway3" targetRef="mgrreject"></sequenceFlow> <exclusiveGateway id="exclusivegateway4" name="Exclusive Gateway"></exclusiveGateway> <sequenceFlow id="flow14" sourceRef="mgrapprove" targetRef="exclusivegateway4"></sequenceFlow> <sequenceFlow id="flow15" sourceRef="mgrreject" targetRef="exclusivegateway4"></sequenceFlow> <userTask id="approvenoti" name="Approved Notification" activiti:assignee="${initiator.properties.userName}" activiti:formKey="scwf:activitiApprovedNotification"></userTask> <sequenceFlow id="flow16" sourceRef="exclusivegateway4" targetRef="approvenoti"></sequenceFlow> <endEvent id="endevent1" name="End"></endEvent> <sequenceFlow id="flow17" sourceRef="approvenoti" targetRef="endevent1"></sequenceFlow> <sequenceFlow id="flow18" sourceRef="revise" targetRef="endevent1"> <conditionExpression xsi:type="tFormalExpression"><![CDATA[${scwf_resubmit == false}]]></conditionExpression> </sequenceFlow> </process> <bpmndi:BPMNDiagram id="BPMNDiagram_tkfTraining"> <bpmndi:BPMNPlane bpmnElement="tkfTraining" id="BPMNPlane_tkfTraining"> <bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start"> <omgdc:Bounds height="35.0" width="35.0" x="90.0" y="230.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="trainingtask" id="BPMNShape_trainingtask"> <omgdc:Bounds height="55.0" width="105.0" x="170.0" y="220.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="AcknowledgedDecision" id="BPMNShape_AcknowledgedDecision"> <omgdc:Bounds height="40.0" width="40.0" x="320.0" y="228.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="acknowledge" id="BPMNShape_acknowledge"> <omgdc:Bounds height="55.0" width="105.0" x="440.0" y="130.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="unknowledge" id="BPMNShape_unknowledge"> <omgdc:Bounds height="55.0" width="105.0" x="440.0" y="274.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1"> <omgdc:Bounds height="40.0" width="40.0" x="600.0" y="207.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2"> <omgdc:Bounds height="40.0" width="40.0" x="685.0" y="208.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sentmgr" id="BPMNShape_sentmgr"> <omgdc:Bounds height="55.0" width="105.0" x="770.0" y="201.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="revise" id="BPMNShape_revise"> <omgdc:Bounds height="55.0" width="105.0" x="442.0" y="390.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="exclusivegateway3" id="BPMNShape_exclusivegateway3"> <omgdc:Bounds height="40.0" width="40.0" x="920.0" y="209.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="mgrapprove" id="BPMNShape_mgrapprove"> <omgdc:Bounds height="69.0" width="105.0" x="1005.0" y="89.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="mgrreject" id="BPMNShape_mgrreject"> <omgdc:Bounds height="55.0" width="105.0" x="1000.0" y="274.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="exclusivegateway4" id="BPMNShape_exclusivegateway4"> <omgdc:Bounds height="40.0" width="40.0" x="1150.0" y="201.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="approvenoti" id="BPMNShape_approvenoti"> <omgdc:Bounds height="55.0" width="105.0" x="1235.0" y="194.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> <omgdc:Bounds height="35.0" width="35.0" x="1385.0" y="204.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"> <omgdi:waypoint x="125.0" y="247.0"></omgdi:waypoint> <omgdi:waypoint x="170.0" y="247.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> <omgdi:waypoint x="275.0" y="247.0"></omgdi:waypoint> <omgdi:waypoint x="320.0" y="248.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3"> <omgdi:waypoint x="340.0" y="228.0"></omgdi:waypoint> <omgdi:waypoint x="340.0" y="157.0"></omgdi:waypoint> <omgdi:waypoint x="440.0" y="157.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4"> <omgdi:waypoint x="340.0" y="268.0"></omgdi:waypoint> <omgdi:waypoint x="340.0" y="301.0"></omgdi:waypoint> <omgdi:waypoint x="440.0" y="301.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5"> <omgdi:waypoint x="545.0" y="157.0"></omgdi:waypoint> <omgdi:waypoint x="619.0" y="157.0"></omgdi:waypoint> <omgdi:waypoint x="620.0" y="207.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6"> <omgdi:waypoint x="545.0" y="301.0"></omgdi:waypoint> <omgdi:waypoint x="620.0" y="301.0"></omgdi:waypoint> <omgdi:waypoint x="620.0" y="247.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7"> <omgdi:waypoint x="640.0" y="227.0"></omgdi:waypoint> <omgdi:waypoint x="685.0" y="228.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8"> <omgdi:waypoint x="725.0" y="228.0"></omgdi:waypoint> <omgdi:waypoint x="770.0" y="228.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9"> <omgdi:waypoint x="705.0" y="248.0"></omgdi:waypoint> <omgdi:waypoint x="704.0" y="417.0"></omgdi:waypoint> <omgdi:waypoint x="547.0" y="417.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10"> <omgdi:waypoint x="442.0" y="417.0"></omgdi:waypoint> <omgdi:waypoint x="222.0" y="417.0"></omgdi:waypoint> <omgdi:waypoint x="222.0" y="275.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11"> <omgdi:waypoint x="875.0" y="228.0"></omgdi:waypoint> <omgdi:waypoint x="920.0" y="229.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12"> <omgdi:waypoint x="940.0" y="209.0"></omgdi:waypoint> <omgdi:waypoint x="940.0" y="129.0"></omgdi:waypoint> <omgdi:waypoint x="1005.0" y="123.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13"> <omgdi:waypoint x="940.0" y="249.0"></omgdi:waypoint> <omgdi:waypoint x="940.0" y="301.0"></omgdi:waypoint> <omgdi:waypoint x="1000.0" y="301.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14"> <omgdi:waypoint x="1110.0" y="123.0"></omgdi:waypoint> <omgdi:waypoint x="1169.0" y="123.0"></omgdi:waypoint> <omgdi:waypoint x="1170.0" y="201.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15"> <omgdi:waypoint x="1105.0" y="301.0"></omgdi:waypoint> <omgdi:waypoint x="1170.0" y="301.0"></omgdi:waypoint> <omgdi:waypoint x="1170.0" y="241.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow16" id="BPMNEdge_flow16"> <omgdi:waypoint x="1190.0" y="221.0"></omgdi:waypoint> <omgdi:waypoint x="1235.0" y="221.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17"> <omgdi:waypoint x="1340.0" y="221.0"></omgdi:waypoint> <omgdi:waypoint x="1385.0" y="221.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18"> <omgdi:waypoint x="494.0" y="445.0"></omgdi:waypoint> <omgdi:waypoint x="494.0" y="515.0"></omgdi:waypoint> <omgdi:waypoint x="1402.0" y="515.0"></omgdi:waypoint> <omgdi:waypoint x="1402.0" y="239.0"></omgdi:waypoint> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </definitions>
I attach file log and model.xml
Please help me
Thank you
I'm sorry for my bad language .
Explore our Alfresco products with the links below. Use labels to filter content by product module.