10-07-2009 02:16 PM
NodeRef temp = new NodeRef("workspace://SpacesStore/"+id);
WorkflowDefinition workflowDef = workflowService.getDefinitionByName("jbpm$adwf:approveContent");
ChildAssociationRef childAssoc = nodeService.getPrimaryParent(temp);
NodeRef pack = workflowService.createPackage(null);
nodeService.addChild(pack, temp, ContentModel.ASSOC_CONTAINS, childAssoc.getQName());
Map<QName, Serializable> parameters = new HashMap<QName, Serializable>();
parameters.put(WorkflowModel.ASSOC_PACKAGE, pack);
parameters.put(WorkflowModel.PROP_CONTEXT, childAssoc.getParentRef());
WorkflowPath path = workflowService.startWorkflow(workflowDef.getId(), parameters);
workflowService.signal(path.id, null);
10-08-2009 11:44 AM
List tasks = workflowService.getTasksForWorkflowPath(path.id);
for(int i = 0; i < tasks.size(); i++) {
String taskId = ((WorkflowTask)tasks.get(i)).id;
workflowService.endTask(taskId, null);
}
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.