public WorkflowTaskDefinition getTaskDefinition(PvmActivity activity, String taskFormKey, String processKey, boolean isStart) { WorkflowNode node = getNode(activity, processKey, true); String taskDefId = taskFormKey == null ? node.getName() : taskFormKey; return factory.createTaskDefinition(taskDefId, node, taskFormKey, isStart); }
public WorkflowTaskDefinition getTaskDefinition(PvmActivity activity, String taskFormKey, String processKey, boolean isStart) { WorkflowNode node = getNode(activity, processKey, true); String taskDefId = taskFormKey == null ? node.getName() : taskFormKey; return factory.createTaskDefinition(taskDefId, node, taskFormKey, isStart); }
@Test public void testSignal() throws Exception { WorkflowDefinition def = deployTestSignallingDefinition(); ProcessInstance processInstance = runtime.startProcessInstanceById(BPMEngineRegistry.getLocalId(def.getId())); String procId = processInstance.getId(); List<String> nodeIds = runtime.getActiveActivityIds(procId); assertEquals(1, nodeIds.size()); assertEquals("task1", nodeIds.get(0)); String pathId = BPMEngineRegistry.createGlobalId(ActivitiConstants.ENGINE_ID, procId); WorkflowPath path = workflowEngine.signal(pathId, null); assertEquals(pathId, path.getId()); assertEquals("task2", path.getNode().getName()); assertEquals(pathId, path.getInstance().getId()); assertTrue(path.isActive()); nodeIds = runtime.getActiveActivityIds(procId); assertEquals(1, nodeIds.size()); assertEquals("task2", nodeIds.get(0)); // Should end the WorkflowInstance path = workflowEngine.signal(pathId, null); assertEquals(pathId, path.getId()); assertNull(path.getNode()); assertEquals(pathId, path.getInstance().getId()); assertFalse(path.isActive()); }
for (WorkflowPath path : paths) out.println("path id: " + path.getId() + " , node: " + path.getNode().getName()); out.println("path: " + path.getId() + " , node: " + path.getNode().getName() + " , active: " + path.isActive()); List<WorkflowTask> tasks = workflowService.getTasksForWorkflowPath(path.getId()); for (WorkflowTask task : tasks) out.print("id: " + timer.getId() + " , name: " + timer.getName() + " , due date: " + timer.getDueDate() + " , path: " + timer.getPath().getId() + " , node: " + timer.getPath().getNode().getName() + " , process: " + timer.getPath().getInstance().getId()); if (timer.getTask() != null)
for (WorkflowPath path : paths) out.println("path id: " + path.getId() + " , node: " + path.getNode().getName()); out.println("path: " + path.getId() + " , node: " + path.getNode().getName() + " , active: " + path.isActive()); List<WorkflowTask> tasks = workflowService.getTasksForWorkflowPath(path.getId()); for (WorkflowTask task : tasks) out.print("id: " + timer.getId() + " , name: " + timer.getName() + " , due date: " + timer.getDueDate() + " , path: " + timer.getPath().getId() + " , node: " + timer.getPath().getNode().getName() + " , process: " + timer.getPath().getInstance().getId()); if (timer.getTask() != null)
@Test public void testGetDefinitionById() throws Exception { WorkflowDefinition definition = deployTestTaskDefinition(); WorkflowDefinition result = workflowEngine.getDefinitionById(definition.getId()); assertNotNull("The workflow definition was not found!", result); assertEquals(definition.getId(), result.getId()); assertEquals(definition.getDescription(), result.getDescription()); assertEquals(definition.getName(), result.getName()); assertEquals(definition.getTitle(), result.getTitle()); assertEquals(definition.getVersion(), result.getVersion()); WorkflowTaskDefinition resultStartDef = result.getStartTaskDefinition(); assertNotNull("Start task is null!", resultStartDef); WorkflowTaskDefinition originalStartDef = definition.getStartTaskDefinition(); assertEquals("Start task Id does not match!", originalStartDef.getId(), resultStartDef.getId()); WorkflowNode resultNode = resultStartDef.getNode(); assertNotNull("Start Task Node is null!", resultNode); assertEquals("Start Task Node Name does not match!", originalStartDef.getNode().getName(), resultNode.getName()); TypeDefinition metaData = resultStartDef.getMetadata(); assertNotNull("Start Task Metadata is null!", metaData); assertEquals("Start Task Metadata name does not match!", originalStartDef.getMetadata().getName(), metaData.getName()); workflowEngine.undeployDefinition(definition.getId()); WorkflowDefinition nullResult = workflowEngine.getDefinitionById(definition.getId()); assertNull("The workflow definition was found but should be null!", nullResult); }
String nodeName = node.getName();
assertNotNull(tasks); assertEquals(1, tasks.size()); assertEquals("waitTask", tasks.get(0).getDefinition().getNode().getName());