public void testStartActivityC() { LogUtil.info(getClass().getName(), ">>> testStartActivityC"); String currentActivityDef = "B"; String desiredActivityDef = "C"; // get process instance Map runningActivities = workflowManager.getActivityInstanceByProcessIdAndStatus(processId, null); String activityId = String.valueOf(runningActivities.get(currentActivityDef)); WorkflowActivity wa = workflowManager.getActivityById(activityId); String processInstanceId = wa.getProcessId(); // abort running activities and start activity C boolean started = workflowManager.activityStart(processInstanceId, desiredActivityDef, true); // check running activities runningActivities = workflowManager.getActivityInstanceByProcessIdAndStatus(processId, null); String abortedActivity = (String) runningActivities.get(currentActivityDef); String runningActivity = (String) runningActivities.get(desiredActivityDef); LogUtil.info( getClass().getName(), "Running activities: " + runningActivities + "; Result: " + started); Assert.assertTrue(abortedActivity == null && runningActivity != null); }
public void testAssignment() { LogUtil.info(getClass().getName(), ">>> testAssignment"); Map activityInstance = workflowManager.getActivityInstanceByProcessIdAndStatus(processId, true); String activityId = String.valueOf(activityInstance.get("A")); WorkflowActivity wa = workflowManager.getActivityById(activityId); String processInstanceId = wa.getProcessId(); WorkflowAssignment ass = workflowManager.getAssignmentByProcess(processInstanceId); WorkflowAssignment ass2 = workflowManager.getAssignment(activityId); Assert.assertTrue( ass != null && ass2 != null && ass.getActivityId().equals(ass2.getActivityId())); }