我在alfresco社区版5.1.x中创建了自定义高级工作流程,我想使用自定义javascript启动工作流程吗?
答案 0 :(得分:1)
类似的东西,
var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "activiti$<YOUR_WORKFLOW>";
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);
答案 1 :(得分:0)
您可以创建一个(java或javaScript)Webscript来启动工作流并从客户端JS调用它。
答案 2 :(得分:0)
js-api也许可以帮助您从webscript开始工作流程:https://github.com/Alfresco/alfresco-js-api
//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks
this.alfrescoJsApi.webScript.executeWebScript('GET', 'mytasks').then(function (data) {
console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);
}, function (error) {
console.log('Error' + error);
});
//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks
this.alfrescoJsApi.webScript.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {
console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);
}, function (error) {
console.log('Error' + error);
});
//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks
this.alfrescoJsApi.webScript.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {
console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);
}, function (error) {
console.log('Error' + error);
});