Created
June 25, 2014 07:41
-
-
Save alfrescian/fa1308ad5c6048ed7127 to your computer and use it in GitHub Desktop.
Start Alfresco Workflow assigned to SiteManager group of a site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ctx = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext(); | |
var javaSiteService = ctx.getBean("siteService"); | |
var site = javaSiteService.getSite(document.nodeRef); | |
var siteManagerGroup = javaSiteService.getSiteRoleGroup(site.getShortName(), "SiteManager", true); | |
var groupAssignee = people.getGroup(siteManagerGroup) | |
var workflow = actions.create("start-workflow"); | |
workflow.parameters.workflowName = "activiti$activitiParallelGroupReview"; | |
workflow.parameters.requiredApprovePercent = 20; | |
workflow.parameters["bpm:workflowDescription"] = "Please review and approve: " + document.name; | |
workflow.parameters["bpm:groupAssignee"] = groupAssignee; | |
var futureDate = new Date(); | |
futureDate.setDate(futureDate.getDate() + 7); | |
workflow.parameters["bpm:workflowDueDate"] = futureDate; | |
workflow.execute(document); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment