How to end alfresco's human task

大憨熊 提交于 2019-12-25 08:47:03

问题


I have the following question.
How can I end a user task in alfresco with method?
I am trying to fix a alfresco's bug, which it doesn't allow me to have only a service task in a whole process. So I include a user task, but i want to auto-complete it (end it)... I have tried many things but nothing seem to work. What else can i do? I am trying to fix a alfresco's bug, which it doesn't allow me to have only a service task in a whole process.So I include a user task, but i want to auto-complete it (end it)...
I have tried many things but nothing seem to work.
What else can i do?

My process last bpmn is:

 <?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>

I need your help.
Every opinion is accepted it.
Maybe you can't help me directly but every idea is helpful.


回答1:


try using the boundary-timer in that way the task will be automatically ended https://forums.activiti.org/content/ending-usertask-timerevent-using-taskendtasktransitionid-method



来源:https://stackoverflow.com/questions/38250242/how-to-end-alfrescos-human-task

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!