// Create the workflow with the newly created node as an item of the workflow
List<WorkflowDefinition> workflows = workflowService.getAllDefinitionsByName("activiti$LoanRequestProcess"); // This could be "jbpm$LoanRequestProcess"
WorkflowDefinition workflow = workflows.get(0); // Assume it is there
// Set the workflow package
// this contains the files within the workflow
NodeRef workflowPackage = workflowService.createPackage(null);
ChildAssociationRef childAssoc = nodeService.getPrimaryParent(nodeRef);
this.nodeService.addChild(workflowPackage, nodeRef, WorkflowModel.ASSOC_PACKAGE_CONTAINS, childAssoc.getQName());
// Set the parameters for the workflow
Map<QName, Serializable> parameters = new HashMap<QName, Serializable>();
parameters.put(WorkflowModel.ASSOC_PACKAGE, workflowPackage);
parameters.put(WorkflowModel.ASSOC_ASSIGNEE, this.personService.getPerson("admin"));
WorkflowPath workflowPath = workflowService.startWorkflow(workflow.getId(), parameters);
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.