As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
var assignee = site.assocs["custom:AssigneePerson"][0]; // This could also be username literal, ie assignee = "admin" var doc = site.childByNamePath("documentLibrary/path/to/filename.txt"); var date = new Date(); var workflow = actions.create("start-workflow"); workflow.parameters.workflowName = "jbpm$workflowModelNamespace:workflowName"; // the part after jbpm$ is found in your workflow definition/workflow model. workflow.parameters["bpm:workflowDescription"] = "Something to distinct this workflow by in the My Tasks list"; workflow.parameters["bpm:assignee"] = assignee; workflow.parameters["bpm:dueDate"] = date; workflow.execute(doc);
<transition to="end" name="SomeTaskNode"> <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <runas>admin</runas> <script> // I put my javascript code to do whatever. </script> </action> </transition>