Package de.danet.an.workflow.api

Examples of de.danet.an.workflow.api.Activity$Info


  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);
View Full Code Here


    private boolean stateReached(WfProcess proc,
         String procState,
         String actState)
    throws Exception {
  Activity act = (Activity)proc.steps().toArray()[0];
  boolean test = true;
  boolean stateReached = false;
  int maxRetries = 10;
  while (test){
      if (maxRetries-- > 0) {
    if (proc.state().startsWith(procState)
        && act.state().startsWith(actState)) {
        stateReached = true;
        test = false;
    } else {
        Thread.sleep(1000);
    }
View Full Code Here

  ProcessMgr mgr = defDir.processMgr
      ("deferredChoiceTests", "terminateTest");
  WfProcess proc = mgr.createProcess(requester);
  String procKey = proc.key();
  proc.start();
  Activity act2 = null;
  Activity act3 = null;
  assertTrue(stateReached(proc, "open.running"));
  for (Iterator i = proc.steps().iterator (); i.hasNext ();) {
      Activity a = (Activity)i.next ();
      if (a.name().equals ("ACT2")) {
    act2 = a;
      } else if (a.name().equals ("ACT3")) {
    act3 = a;
      }
  }
  assertTrue (act2 != null);
  assertTrue (act3 != null);
View Full Code Here

TOP

Related Classes of de.danet.an.workflow.api.Activity$Info

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.