User task is automatically rejected

cancel
Showing results for 
Search instead for 
Did you mean: 
tim1234
Active Member

User task is automatically rejected

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" 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="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!

1 Reply
vhelmut
Active Member II

Re: User task is automatically rejected

Hi, @Tim Lam! 

Try to use

execution.setVariable('wf_reviewOutcome', task.getVariableLocale('wf_reviewOutcome'));

If it doesn't helps attach please model of your workflow.

Good luck!