在 Alfresco 中开始使用规则和简单的 javascript 非常容易,但我坚持尝试通过 javascript 添加资源来启动工作流。
我的目标是添加用于启动流程的文档(或多个文档),这样我就可以在 Alfresco WorkDesk 的 Alfresco BPM 的“OW_ATTACHMENTS”中获得参考。我已经用 bpm:workflowpagckage 或 bpm:package 尝试了很多次,但都没有运气......帮助!
编辑:
function startWorkflow(name,docNode)
{
var workflow = actions.create("start-workflow");
workflow.parameters["bpm:workflowPackage"] = docNode;
workflow.parameters.workflowName = "activiti$AdHocactivitiTimer";
workflow.parameters["bpm:assignee"] = people.getPerson("admin");
workflow.parameters["bpm:workflowDescription"] = "test";
workflow.parameters["bpm:workflowPriority"] = "2";
workflow.parameters["bpm:sendEMailNotifications"] = true;
workflow.parameters["initiator"] = people.getPerson("admin");
var today = new Date();
var duedate = today.getDate() + 1;
workflow.parameters["bpm:workflowDueDate"] = duedate;
workflow.execute(document);
}
function main()
{
var docNode = search.findNode(document.nodeRef);
var name = document.name;
startWorkflow(name,docNode);
}
main();
谢谢!