06-14-2014 09:32 PM
06-14-2014 11:09 PM
06-16-2014 08:32 AM
WorkflowDefinition wd = getServiceRegistry().getWorkflowService().getDefinitionByName(wName);
if(wd==null)return;
NodeRef workflowPackage = getServiceRegistry().getWorkflowService().createPackage(null);
nodeService.addChild(workflowPackage, docRef, ContentModel.ASSOC_CONTAINS, assoc.getQName());
Map<QName, Serializable> parameters = new HashMap<QName, Serializable>();
parameters.put(WorkflowModel.ASSOC_PACKAGE, workflowPackage);
parameters.put(WorkflowModel.ASPECT_WORKFLOW_PACKAGE,workflowPackage);
parameters.put(WorkflowModel.PROP_COMMENT,comment);
parameters.put(WorkflowModel.PROP_WORKFLOW_DUE_DATE,due);
ArrayList<NodeRef> assignees = new ArrayList<NodeRef>();
assignees.add(assignee);
logger.debug("assignees:"+assignees);
parameters.put(WorkflowModel.ASSOC_ASSIGNEES, assignees);
WorkflowPath path = getServiceRegistry().getWorkflowService().startWorkflow(wd.getId(), parameters);
String wfPathId = path.getId();
List<WorkflowTask> wfTasks = getServiceRegistry().getWorkflowService().getTasksForWorkflowPath(wfPathId);
if (wfTasks.size() == 0)return;
WorkflowTask wfStartTask = wfTasks.get(0);
getServiceRegistry().getWorkflowService().endTask(wfStartTask.getId(), null);
01-20-2016 03:27 AM
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.