WfProcess proc = mgr.createProcess(requester);
String procKey = proc.key();
proc.start();
assertTrue(stateReached(proc, "open.running.running",
"open.not_running.suspended.suspended"));
Activity act = (Activity)proc.steps().toArray()[0];
act.resume();
assertTrue(stateReached(proc, "closed.completed",
"closed.completed"));
// Assure that process has to be removed manually
assertTrue(mgr.processByKey(procKey) != null);
procDir.removeProcess(proc);
boolean processRemoved = false;
try {
mgr.processByKey(procKey);
} catch (InvalidKeyException exc) {
processRemoved = true;
}
assertTrue(processRemoved);
mgr = defDir.processMgr("SystemTest", "stopOnFinish");
proc = mgr.createProcess(requester);
procKey = proc.key();
proc.start();
assertTrue(stateReached(proc, "open.running.running",
"open.not_running.suspended.suspended"));
act = (Activity)proc.steps().toArray()[0];
act.resume();
assertTrue(stateReached(proc, "closed.completed",
"closed.completed"));
// Assure that process has to be removed manually
assertTrue(mgr.processByKey(procKey) != null);
procDir.removeProcess(proc);