如何结束露天的人类任务

时间:2016-07-07 16:03:31

标签: task alfresco

我有以下问题。
如何用方法结束露天的用户任务?
我正在尝试修复一个露天的bug,它不允许我在整个过程中只有一个服务任务。所以我包括一个用户任务,但我想自动完成它(结束它)...我尝试了很多东西,但似乎没有任何工作。我还可以做些什么? 我正在尝试修复一个露天的bug,它不允许我在整个过程中只有一个服务任务。所以我包括一个用户任务,但我想自动完成它(结束)它... ...我尝试了很多东西,但似乎没有任何工作。
我还能做什么?

我的过程最后一次bpmn是:

 <?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="OneTask" name="One Task" isExecutable="true">
     <serviceTask id="servicetask1" name="Script Task" ac  tivi  ti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate">
       <extensionElements>
        <activiti:field name="script">
          <activiti:string><![CDATA[logger.log("Hello Service Task");]]>          </activiti:string>
       </activiti:field>
      </extensionElements>
   </serviceTask>
<endEvent id="terminateendevent1" name="TerminateEndEvent">
  <terminateEventDefinition></terminateEventDefinition>
</endEvent>
  <startEvent id="alfrescoStartevent1" name="Alfresco start" activiti:formKey="wf:submitAdhocTask"></startEvent>
  <sequenceFlow id="flow4" sourceRef="alfrescoStartevent1" targetRef="servicetask1"></sequenceFlow>
  <userTask id="alfrescoUsertask1" name="Alfresco User Task" activiti:formKey="wf:adhocTask">
    <extensionElements>
    <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
      <activiti:field name="script">
        <activiti:string><![CDATA[

        logger.log("Hello User Task");
        task.complete();

        ]]></activiti:string>
      </activiti:field>
    </activiti:taskListener>
  </extensionElements>
</userTask>
<sequenceFlow id="flow5" sourceRef="servicetask1" targetRef="alfrescoUsertask1"></sequenceFlow>
<sequenceFlow id="flow6" sourceRef="alfrescoUsertask1" targetRef="terminateendevent1"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_OneTask">
<bpmndi:BPMNPlane bpmnElement="OneTask" id="BPMNPlane_OneTask">
  <bpmndi:BPMNShape bpmnElement="servicetask1" id="BPMNShape_servicetask1">
    <omgdc:Bounds height="55.0" width="105.0" x="200.0" y="180.0"></omgdc:Bounds>
  </bpmndi:BPMNShape>
  <bpmndi:BPMNShape bpmnElement="terminateendevent1" id="BPMNShape_terminateendevent1">
    <omgdc:Bounds height="35.0" width="35.0" x="590.0" y="190.0"></omgdc:Bounds>
  </bpmndi:BPMNShape>
  <bpmndi:BPMNShape bpmnElement="alfrescoStartevent1" id="BPMNShape_alfrescoStartevent1">
    <omgdc:Bounds height="35.0" width="35.0" x="90.0" y="190.0">  </omgdc:Bounds>
  </bpmndi:BPMNShape>
  <bpmndi:BPMNShape bpmnElement="alfrescoUsertask1" id="BPMNShape_alfrescoUsertask1">
    <omgdc:Bounds height="55.0" width="105.0" x="370.0" y="180.0">  </omgdc:Bounds>
  </bpmndi:BPMNShape>
  <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
    <omgdi:waypoint x="125.0" y="207.0"></omgdi:waypoint>
    <omgdi:waypoint x="200.0" y="207.0"></omgdi:waypoint>
  </bpmndi:BPMNEdge>
  <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
    <omgdi:waypoint x="305.0" y="207.0"></omgdi:waypoint>
    <omgdi:waypoint x="370.0" y="207.0"></omgdi:waypoint>
  </bpmndi:BPMNEdge>
  <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
    <omgdi:waypoint x="475.0" y="207.0"></omgdi:waypoint>
    <omgdi:waypoint x="590.0" y="207.0"></omgdi:waypoint>
  </bpmndi:BPMNEdge>
 </bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

我需要你的帮助。
每个意见都被接受了。
也许你不能直接帮助我,但每个想法都有帮助。

1 个答案:

答案 0 :(得分:2)

尝试以这种方式使用边界计时器,任务将自动结束https://forums.activiti.org/content/ending-usertask-timerevent-using-taskendtasktransitionid-method