AnsweredAssumed Answered

User task is automatically rejected

Question asked by tim1234 on Jun 19, 2017
Latest reply on Sep 23, 2017 by vhelmut

I am a newbie and currently using Alfresco newest community edition. 

 

I have been trying to recreate a simple review (approve/reject) task for later use. It is not a timed task. Once I assign the task, it is instantly rejected automatically.
Inside my repo-tier bpmn, I have copy some fragments from some sample codes:

 

 

<?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="loanReview" name="Loan Review" isExecutable="true">
<userTask id="reviewInProcess" name="Review In Process" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:activitiReviewTask">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
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>
execution.setVariable('wf_reviewOutcome', task.getVariable('wf_reviewOutcome'));
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>

</userTask>
<endEvent id="endevent1" name="End"></endEvent>
<startEvent id="startevent1" name="Start" activiti:formKey="wf:submitReviewTask"></startEvent>
<sequenceFlow id="flow5" sourceRef="startevent1" targetRef="reviewInProcess"></sequenceFlow>
<serviceTask id="alfrescoScripttask1" name="Approving/Denying" activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate"></serviceTask>
<sequenceFlow id="flow6" sourceRef="reviewInProcess" targetRef="alfrescoScripttask1"></sequenceFlow>
<sequenceFlow id="flow7" sourceRef="alfrescoScripttask1" targetRef="endevent1"></sequenceFlow>
</process>


<bpmndi:BPMNDiagram id="BPMNDiagram_loanReview">
<bpmndi:BPMNPlane bpmnElement="loanReview" id="BPMNPlane_loanReview">
<bpmndi:BPMNShape bpmnElement="reviewInProcess" id="BPMNShape_reviewInProcess">
<omgdc:Bounds height="55.0" width="105.0" x="120.0" y="320.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="460.0" y="330.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35.0" width="35.0" x="20.0" y="330.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="alfrescoScripttask1" id="BPMNShape_alfrescoScripttask1">
<omgdc:Bounds height="55.0" width="105.0" x="310.0" y="320.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="55.0" y="347.0"></omgdi:waypoint>
<omgdi:waypoint x="120.0" y="347.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="225.0" y="347.0"></omgdi:waypoint>
<omgdi:waypoint x="310.0" y="347.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
<omgdi:waypoint x="415.0" y="347.0"></omgdi:waypoint>
<omgdi:waypoint x="460.0" y="347.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

 

why execution.setVariable('wf_reviewOutcome', task.getVariable('wf_reviewOutcome')); dont work?
(let's assume share-tier part is setup correctly)
I appreciate any help or advice!

Outcomes