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.
// 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);