我在觸發工作流程時遇到問題。多次觸發Alfresco工作流程
我已經在一個文件夾規則
定義應用的規則:
我)當進入這個文件夾 II)的名稱結尾創建項目爲.xml III)執行腳本
腳本是
function startWorkflow()
{
var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "activiti$Excel_initial_service";
workflow.parameters["bpm:workflowDescription"] = "Excel initial service workflow for : " + document.name;
var futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 1);
workflow.parameters["bpm:workflowDueDate"] = futureDate;
return workflow.execute(document);
}
function main()
{
startWorkflow();
}
main();
和我的工作流定義是
<?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="Excel_initial_service" name="Excel Initial Service" isExecutable="true">
<startEvent id="startevent1" name="Start"></startEvent>
.
.
.
.
<serviceTask id="servicetask1" name="Service Task" activiti:class="*"> </serviceTask>
.
.
.
.
我現在面臨的問題是服務的任務越來越被多次觸發的文件夾及其沒有得到停止在進入單個文件。
<?xml version="1.0" encoding="UTF-8"?>
<process id="***" name="Excel Generation Service" isExecutable="true">
<startEvent id="starteventexcel1" name="Start"></startEvent>
<intermediateCatchEvent id="timerintermediatecatcheventexcel1" name="TimerCatchEvent1">
<timerEventDefinition>
<timeDuration>PT10S</timeDuration>
</timerEventDefinition>
</intermediateCatchEvent>
<serviceTask id="servicetaskexcel1" name="Service Task" activiti:class="***"></serviceTask>
<intermediateCatchEvent id="timerintermediatecatcheventexcel2" name="TimerCatchEvent2">
<timerEventDefinition>
<timeDuration>PT10S</timeDuration>
</timerEventDefinition>
</intermediateCatchEvent>
<endEvent id="endeventexcel1" name="End"></endEvent>
<sequenceFlow id="flowexcel1" sourceRef="starteventexcel1" targetRef="timerintermediatecatcheventexcel1"></sequenceFlow>
<sequenceFlow id="flowexcel2" sourceRef="timerintermediatecatcheventexcel1" targetRef="servicetaskexcel1"></sequenceFlow>
<sequenceFlow id="flowexcel3" sourceRef="servicetaskexcel1" targetRef="timerintermediatecatcheventexcel2"></sequenceFlow>
<sequenceFlow id="flowexcel4" sourceRef="timerintermediatecatcheventexcel2" targetRef="endeventexcel1"></sequenceFlow>
</process>
你執行腳本任務中的一些操作? – vikash
你正在服務的任務?在我的腳本中,我正在執行一個工作流程** activiti $ Excel_initial_service **在工作流程的服務任務中,我正在生成一些excel文件 –
您能否將完整的BPMN文件添加到您的問題中? – izodev