/** * @param path WorkflowPath * @param instance ProcessInstance */ private void endStartTaskAutomatically(WorkflowPath path, ProcessInstance instance) { // Check if StartTask Needs to be ended automatically WorkflowDefinition definition = path.getInstance().getDefinition(); TypeDefinition metadata = definition.getStartTaskDefinition().getMetadata(); Set<QName> aspects = metadata.getDefaultAspectNames(); if(aspects.contains(WorkflowModel.ASPECT_END_AUTOMATICALLY)) { String taskId = ActivitiConstants.START_TASK_PREFIX + instance.getId(); endStartTask(taskId); } }
/** * @param path WorkflowPath * @param instance ProcessInstance */ private void endStartTaskAutomatically(WorkflowPath path, ProcessInstance instance) { // Check if StartTask Needs to be ended automatically WorkflowDefinition definition = path.getInstance().getDefinition(); TypeDefinition metadata = definition.getStartTaskDefinition().getMetadata(); Set<QName> aspects = metadata.getDefaultAspectNames(); if(aspects.contains(WorkflowModel.ASPECT_END_AUTOMATICALLY)) { String taskId = ActivitiConstants.START_TASK_PREFIX + instance.getId(); endStartTask(taskId); } }
String workflowDefId = task.getPath().getInstance().getDefinition().getName(); if (workflowDefId.indexOf('$') != -1 && (workflowDefId.indexOf('$') < workflowDefId.length() -1))
String workflowDefId = task.getPath().getInstance().getDefinition().getName(); if (workflowDefId.indexOf('$') != -1 && (workflowDefId.indexOf('$') < workflowDefId.length() -1))
public WorkflowTask createTask (String id, WorkflowTaskDefinition taskDef, String name, String defaultTitle, String defaultDescription, WorkflowTaskState state, WorkflowPath path, String workflowDefinitionName, Map<QName, Serializable> properties) { String actualId = buildGlobalId(id); String processKey = getProcessKey(workflowDefinitionName) + ".task." + name; TypeDefinition metadata = taskDef.getMetadata(); String title = getLabel(processKey, TITLE_LABEL, metadata.getTitle(dictionaryService), defaultTitle, name); defaultDescription = (defaultDescription !=null && defaultDescription.trim().length() == 0) ? null : defaultDescription; String description = getLabel(processKey, DESC_LABEL, defaultDescription, metadata.getDescription(dictionaryService), title); return new WorkflowTask(actualId, taskDef, name, title, description, state, path, properties); }
public WorkflowTask createTask (String id, WorkflowTaskDefinition taskDef, String name, String defaultTitle, String defaultDescription, WorkflowTaskState state, WorkflowPath path, String workflowDefinitionName, Map<QName, Serializable> properties) { String actualId = buildGlobalId(id); String processKey = getProcessKey(workflowDefinitionName) + ".task." + name; TypeDefinition metadata = taskDef.getMetadata(); String title = getLabel(processKey, TITLE_LABEL, metadata.getTitle(dictionaryService), defaultTitle, name); defaultDescription = (defaultDescription !=null && defaultDescription.trim().length() == 0) ? null : defaultDescription; String description = getLabel(processKey, DESC_LABEL, defaultDescription, metadata.getDescription(dictionaryService), title); return new WorkflowTask(actualId, taskDef, name, title, description, state, path, properties); }
private boolean fromSameParallelReviewWorkflow(WorkflowTask wt, String userName) { // check whether this is parallel review workflow, "parallel" will match all parallel workflows (any engine) if (wt.getPath().getInstance().getDefinition().getName().toLowerCase().contains("parallel")) { WorkflowTaskQuery tasksQuery = new WorkflowTaskQuery(); tasksQuery.setTaskState(null); tasksQuery.setActive(null); tasksQuery.setProcessId(wt.getPath().getInstance().getId()); List<WorkflowTask> allWorkflowTasks = workflowService.queryTasks(tasksQuery, true); for (WorkflowTask task : allWorkflowTasks) { if (isInitiatorOrAssignee(task, userName)) { // if at list one match then user has task from the same workflow return true; } } } return false; }
private boolean fromSameParallelReviewWorkflow(WorkflowTask wt, String userName) { // check whether this is parallel review workflow, "parallel" will match all parallel workflows (any engine) if (wt.getPath().getInstance().getDefinition().getName().toLowerCase().contains("parallel")) { WorkflowTaskQuery tasksQuery = new WorkflowTaskQuery(); tasksQuery.setTaskState(null); tasksQuery.setActive(null); tasksQuery.setProcessId(wt.getPath().getInstance().getId()); List<WorkflowTask> allWorkflowTasks = workflowService.queryTasks(tasksQuery, true); for (WorkflowTask task : allWorkflowTasks) { if (isInitiatorOrAssignee(task, userName)) { // if at list one match then user has task from the same workflow return true; } } } return false; }
String definitionId = instance.getDefinition().getId(); String definitionName = instance.getDefinition().getName(); String instanceId = instance.getId(); nodeService.setProperty(packageNode, WorkflowModel.PROP_WORKFLOW_DEFINITION_ID, definitionId);
String definitionId = instance.getDefinition().getId(); String definitionName = instance.getDefinition().getName(); String instanceId = instance.getId(); nodeService.setProperty(packageNode, WorkflowModel.PROP_WORKFLOW_DEFINITION_ID, definitionId);
for (WorkflowInstance workflow : workflows) out.println("id: " + workflow.getId() + " , desc: " + workflow.getDescription() + " , start date: " + workflow.getStartDate() + " , def: " + workflow.getDefinition().getName() + " v" + workflow.getDefinition().getVersion()); for (WorkflowInstance workflow : workflows) out.println("id: " + workflow.getId() + " , desc: " + workflow.getDescription() + " , start date: " + workflow.getStartDate() + " , def: " + workflow.getDefinition().getName()); out.println("definition: " + workflow.getDefinition().getName()); out.println("id: " + workflow.getId()); out.println("description: " + workflow.getDescription()); currentWorkflowDef = instance.getDefinition(); currentPath = workflowService.getWorkflowPaths(instance.getId()).get(0); out.print(executeCommand("use")); WorkflowPath path = workflowService.startWorkflow(currentWorkflowDef.getId(), params); endStartTaskForPath(path); out.println("started workflow id: " + path.getInstance().getId() + " , def: " + path.getInstance().getDefinition().getTitle()); currentPath = path; out.print(interpretCommand("show transitions"));
for (WorkflowInstance workflow : workflows) out.println("id: " + workflow.getId() + " , desc: " + workflow.getDescription() + " , start date: " + workflow.getStartDate() + " , def: " + workflow.getDefinition().getName() + " v" + workflow.getDefinition().getVersion()); for (WorkflowInstance workflow : workflows) out.println("id: " + workflow.getId() + " , desc: " + workflow.getDescription() + " , start date: " + workflow.getStartDate() + " , def: " + workflow.getDefinition().getName()); out.println("definition: " + workflow.getDefinition().getName()); out.println("id: " + workflow.getId()); out.println("description: " + workflow.getDescription()); currentWorkflowDef = instance.getDefinition(); currentPath = workflowService.getWorkflowPaths(instance.getId()).get(0); out.print(executeCommand("use")); WorkflowPath path = workflowService.startWorkflow(currentWorkflowDef.getId(), params); endStartTaskForPath(path); out.println("started workflow id: " + path.getInstance().getId() + " , def: " + path.getInstance().getDefinition().getTitle()); currentPath = path; out.print(interpretCommand("show transitions"));
assertEquals("I'm the description", workflowInstance.getDescription()); assertEquals(dueDate, workflowInstance.getDueDate()); assertEquals(def.getId(), workflowInstance.getDefinition().getId());
assertEquals("I'm the description", workflowInstance.getDescription()); assertEquals(dueDate, workflowInstance.getDueDate()); assertEquals(def.getId(), workflowInstance.getDefinition().getId());
if(!processName.equals(workflowTask.getPath().getInstance().getDefinition().getName())) if(!query.getWorkflowDefinitionName().equals(workflowTask.getPath().getInstance().getDefinition().getName()))
if(!processName.equals(workflowTask.getPath().getInstance().getDefinition().getName())) if(!query.getWorkflowDefinitionName().equals(workflowTask.getPath().getInstance().getDefinition().getName()))
assertEquals(workflowDefName, workflow.getDefinition().getName());
public void testStartWorkflow() { WorkflowDefinition definition = deployDefinition(getTestDefinitionPath()); WorkflowPath path = workflowService.startWorkflow(definition.getId(), null); assertNotNull(path); assertTrue(path.isActive()); assertNotNull(path.getNode()); WorkflowInstance instance = path.getInstance(); assertNotNull(instance); assertEquals(definition.getId(), instance.getDefinition().getId()); }
assertNotNull(path.getNode()); assertNotNull(path.getInstance()); assertEquals(workflowDef.getId(), path.getInstance().getDefinition().getId()); String workflowDefId = (String)nodeService.getProperty(pckgNode, WorkflowModel.PROP_WORKFLOW_DEFINITION_ID); assertEquals(workflowDefId, workflowDef.getId());