2 提交 / 0 new
最新文章
213青年的头像
离线
Last seen: 1 年 3 个月 之前
Joined: 2016-10-12 15:41
Points: 0
如何建立一个自定义流程

你好
我想一个文档进入文件夹就启动一个流程,这个流程需要多人审核,在审核没有通过的时候文档无法被其他用户读取,只有审核的人可以阅读,当审核通过后文件进入此文件夹
我有尝试通过执行脚本实现,但是只能找到这个简单JS文件,而且这个脚本的邮件通知功能好像没有什么起到作用
 var workflow = actions.create("start-workflow");workflow.parameters.workflowName = "activiti$activitiReview";
workflow.parameters["bpm:workflowDescription"] = "Please assign approver for "+ document.name;
workflow.parameters['bpm:assignee']=people.getPerson("username");
workflow.parameters["sendEMailNotifications"] = true;
workflow.execute(document);
数据字典中本来就有的一个start-polled-review-workflow.js我把rule设置为执行这个脚本但是他什么也不会做,function startWorkflow(assigneeGroup){var workflow = actions.create("start-workflow");workflow.parameters.workflowName = "activiti$activitiReviewPooled";workflow.parameters["bpm:workflowDescription"] = "Please review " + document.name;workflow.parameters["bpm:groupAssignee"] = assigneeGroup;var futureDate = new Date();futureDate.setDate(futureDate.getDate() + 7);workflow.parameters["bpm:workflowDueDate"] = futureDate;return workflow.execute(document);}
function main(){var name = document.name;var siteName = document.siteShortName;
if (siteName == null){if (logger.isLoggingEnabled())logger.log("Did not start workflow as the document named " + name + " is not located within a site.");
return;}
var reviewGroup = "GROUP_site_" + siteName;
// make sure the group existsvar group = people.getGroup(reviewGroup);if (group != null){if (logger.isLoggingEnabled())logger.log("Starting pooled review and approve workflow for document named " + name + " assigned to group " + reviewGroup);
startWorkflow(group);
if (logger.isLoggingEnabled())logger.log("Started pooled review and approve workflow for document named " + name + " assigned to group " + reviewGroup);}else if (logger.isLoggingEnabled()){logger.log("Did not start workflow as the group " + reviewGroup + " could not be found.");}}
main();

Kate的头像
离线
Last seen: 5 个月 4 周 之前
Joined: 2015-12-02 22:16
Points: 0
你好,这个是可以达成的

你好,这个是可以达成的,但是用普通的javascript的脚本实现有点儿麻烦。
建议,定制你自己的工作流,然后为文件夹设定规则,例如“当项被创建时”,启动你所设置的流程即可。