/** * Get the available transition ids. * * @return ScriptableHashMap */ public ScriptableHashMap<String, String> getTransitions() { ScriptableHashMap<String, String> transitions = new ScriptableHashMap<String, String>(); WorkflowNode workflowNode = task.getPath().getNode(); if (workflowNode != null) { for (WorkflowTransition transition : workflowNode.getTransitions()) { transitions.put(transition.getId(), transition.getTitle()); } } return transitions; }
/** * Get the available transition ids. * * @return ScriptableHashMap */ public ScriptableHashMap<String, String> getTransitions() { ScriptableHashMap<String, String> transitions = new ScriptableHashMap<String, String>(); WorkflowNode workflowNode = task.getPath().getNode(); if (workflowNode != null) { for (WorkflowTransition transition : workflowNode.getTransitions()) { transitions.put(transition.getId(), transition.getTitle()); } } return transitions; }
@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) for (WorkflowTransition transition : path.getNode().getTransitions()) 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) out.println("path: " + ((currentPath == null) ? "None" : currentPath.getId() + " , node: " + currentPath.getNode().getTitle()));
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) for (WorkflowTransition transition : path.getNode().getTransitions()) 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) out.println("path: " + ((currentPath == null) ? "None" : currentPath.getId() + " , node: " + currentPath.getNode().getTitle()));
assertNotNull("No process instance was created!", procInstance); WorkflowNode node = path.getNode(); assertNotNull("The workflow node is null!", node); String nodeName = node.getName();
WorkflowNode node = path.getNode();
WorkflowNode node = path.getNode();
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());