我無法通過Web腳本啓動工作流程。錯誤通過JavaScript啓動工作流程
我創建的文件workflow.get.js:
var nodeId = args.nodeid; //fdadc86f-d996-472d-8267-850a63573b02
var workflowName = args.w; //jbpm$wf:adhoc
var document = search.findNode("workspace://SpacesStore/" + nodeId);
var workflowAction = actions.create("start-workflow");
workflowAction.parameters.workflowName = workflowName;
workflowAction.parameters["bpm:workflowDescription"] = "Please edit: " + document.name;
workflowAction.parameters["bpm:assignees"] = [people.getPerson("admin"), people.getPerson("admin")];
var futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 7);
workflowAction.parameters["bpm:workflowDueDate"] = futureDate;
workflowAction.execute(document);
workflow.get.desc.xml
<webscript>
<shortname>Start Workflow</shortname>
<description>Testando Start Workflow</description>
<url>/workflow?nodeid={idfile}&&w={namewf}</url>
<format default="html">argument</format>
<authentication>admin</authentication>
<transaction>required</transaction>
</webscript>
和workflow.get.html.ftl
The ${args.w} started!
當我點擊http:// localhost:8080/alfresco/service/workflow?nodeId = fdadc86f-d996-472d-8267-850a63573b02 & w = jbpm $ wf:adhoc返回錯誤
06190076 Wrapped Exception (with status template): 06190474 Failed to execute script '/triggerworkflow.get.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts)': 06190473 Can't find method org.alfresco.repo.jscript.ScriptAction.execute(org.mozilla.javascript.Undefined). (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts)#11)
Exception: org.alfresco.error.AlfrescoRuntimeException - 08200041 TypeError: Cannot read property "name" from null (workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions/Workflow/workflow.get.js#7)
org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:469)
Exception: org.alfresco.scripts.ScriptException - 08200042 Failed to execute script '/Workflow/workflow.get.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)': 08200041 TypeError: Cannot read property "name" from null (workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions/Workflow/workflow.get.js#7)
org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:183)
Exception: org.springframework.extensions.webscripts.WebScriptException - 08200035 Wrapped Exception (with status template): 08200042 Failed to execute script '/Workflow/workflow.get.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)' : 08200041 TypeError: Cannot read property "name" from null (workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions/Workflow/ workflow.get.js#7)
org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:742) Anybody help me?
你能解釋我,如果使用 ** ** workflow.get.js VAR 工作流程= actions.create( 「啓動工作流」); workflow.parameters.workflowName =「activiti $ TrainerEmpanelment」; workflow.parameters [「bpm:assignee」] = people.getPerson(「admin」); workflow.parameters [「initiator」] = people.getPerson(「admin」); var today = new Date(); var duedate = today.getDate()+ 1; workflow.parameters [「bpm:workflowDueDate」] = duedate; workflow.execute(document); workflow.get.desc.xml文件的網址是什麼 – Paul
您可能不想要.desc.xml文件的URL - 通常只有在瀏覽可用的web腳本列表時才需要。如果您希望URL調用Web腳本,那麼無論您在說明文件中的「」標籤中輸入了什麼內容!如果這太多了,我建議你要麼購買一份「專業Alfresco」(幾年前,但webscript的東西仍然是一樣的),或參加一個Alfresco培訓課程 –
Gagravarr
我已經改變了URL在' .desc.xml文件保存並轉到外部web腳本再次點擊webscript我得到錯誤>「06190085包裝異常(狀態模板):06190498無法執行腳本'/triggerworkflow.get.js(在存儲庫存儲工作區中://SpacesStore/Company Home/Data Dictionary/Web Scripts)':missing; before statement(/triggerworkflow.get。js(在倉庫工作空間中:// SpacesStore/Company Home/Data Dictionary/Web Scripts)#6)「 – Paul