Package de.danet.an.workflow.omgcore

Examples of de.danet.an.workflow.omgcore.WfProcess


  // create the process
  ProcessDefinitionDirectory pdd
      = workflowService().processDefinitionDirectory();
  // dynamic invoke WSIF with WSDL definition as DOM tree.
  ProcessMgr pmgr = pdd.processMgr("st-testWSIF", "testWSIF1");
  WfProcess process = pmgr.createProcess(defaultRequester());
   process.start();
  checkResult(process);
  // dynamic invoke WSIF with WSDL definition retrieved from URL.
  ProcessMgr pmgr2 = pdd.processMgr("st-testWSIF", "testWSIF2");
  WfProcess process2 = pmgr2.createProcess(defaultRequester());
   process2.start();
  checkResult(process2);
    }
View Full Code Here


     * element.
     * @exception Exception if an error occurs
     */
    public void googleSearch() throws Exception {
  ProcessMgr pmgr3 = pdd.processMgr("st-testWSIF", "testWSIF3");
  WfProcess process3 = pmgr3.createProcess(defaultRequester());
   process3.start();
  Thread.sleep(30000);
   Map map = (Map)process3.result();
  for (Iterator it2 = map.keySet().iterator(); it2.hasNext();) {
      String name = (String) it2.next();
      System.out.println("name = " + name);
      if (name.equals("searchresult")) {
    String returnResult = (String)map.get(name);
View Full Code Here

     * @exception Exception if an error occurs
     */
    public void testRun() throws Exception {
  List msgList = importProcessDefinition("/process/minimal.xml");
  ProcessMgr mgr = defDir.processMgr("SystemTest", "stopOnStart");
  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);
  processRemoved = false;
  try {
      mgr.processByKey(procKey);
  } catch (InvalidKeyException exc) {
      processRemoved = true;
  }
  assertTrue(processRemoved);

  mgr = defDir.processMgr("SystemTest", "completeNoRemoval");
  proc = mgr.createProcess(requester);
  procKey = proc.key();
  proc.start();
  assertTrue(stateReached(proc, "closed.completed",
        "closed.completed"));
  // Assure that process has to be removed manually
  assertTrue(mgr.processByKey(procKey) != null);
  procDir.removeProcess(proc);
  processRemoved = false;
  try {
      mgr.processByKey(procKey);
  } catch (InvalidKeyException exc) {
      processRemoved = true;
  }
  assertTrue(processRemoved);

  mgr = defDir.processMgr("SystemTest", "completeRemoval");
  proc = mgr.createProcess(requester);
  procKey = proc.key();
  proc.start();
  // Assure that process has been removed automatically
  processRemoved = false;
  int maxRetries = 5;
  boolean test = true;
  while (test){
View Full Code Here

     * @exception Exception if an error occurs
     */
    public void testPath() throws Exception {
  List msgList = importProcessDefinition("/process/transition1.xml");
  ProcessMgr mgr = defDir.processMgr("SystemTest", "simplePath");
  WfProcess proc = mgr.createProcess(requester);
  proc.start();
  // Wait for completion
  assertTrue(stateReached(proc, "closed.completed",
        "closed.completed"));
  ProcessData data = proc.processContext();
  assertTrue(((String)data.get("TransitionPath"))
       .equals("PATH:act1:act2:act3"));
  procDir.removeProcess(proc);

  mgr = defDir.processMgr("SystemTest", "block_2_in_2_out");
  proc = mgr.createProcess(requester);
  proc.start();
  // Wait for completion
  assertTrue("Process not completed in time",
       stateReached(proc, "closed.completed",
        "closed.completed"));
  data = proc.processContext();
  assertTrue(((String)data.get("ConfirmA3")).equals("OK"));
  assertTrue(((String)data.get("ConfirmA4")).equals("OK"));
  procDir.removeProcess(proc);
  defDir.removeProcessDefinition("SystemTest", "simplePath")
  defDir.removeProcessDefinition("SystemTest", "block_2_in_2_out")
View Full Code Here

  }

  List msgList = importProcessDefinition("/process/loop.xml");
  assertTrue(msgList.size() == 0);
  ProcessMgr mgr = defDir.processMgr("SystemTest", "loop_3_times");
  WfProcess proc = mgr.createProcess(requester);
  proc.start();
  // Wait for completion
  assertTrue(stateReached(proc, "closed.completed"));
  ProcessData data = proc.processContext();
  assertTrue(((Long)data.get("Counter")).intValue() == 3);
  procDir.removeProcess(proc);
  defDir.removeProcessDefinition("SystemTest", "loop_3_times")
    }
View Full Code Here

     * @exception Exception if an error occurs
     */
    public void testCascade() throws Exception {
  // Uses XPDL imported by testLoop
  ProcessMgr mgr = defDir.processMgr("SystemTest", "cascade");
  WfProcess proc = mgr.createProcess(requester);
  proc.start();
  // Wait for completion
  assertTrue(stateReached(proc, "closed.completed"));
  ProcessData data = proc.processContext();
  assertTrue(((Boolean)data.get("completed"))
       .equals(Boolean.TRUE));
  procDir.removeProcess(proc);
  defDir.removeProcessDefinition("SystemTest", "cascade")
    }
View Full Code Here

     * @exception Exception if an error occurs
     */
    public void testScrabble() throws Exception {
  // Uses XPDL imported by testLoop
  ProcessMgr mgr = defDir.processMgr("SystemTest", "scrabble");
  WfProcess proc = mgr.createProcess(requester);
  proc.start();
  // Wait for completion
  assertTrue(stateReached(proc, "closed.completed"));
  ProcessData data = proc.processContext();
  assertTrue(((String)data.get("compound")).equals("DANET"));
  procDir.removeProcess(proc);
  defDir.removeProcessDefinition("SystemTest", "cascade")
    }
View Full Code Here

     * @exception Exception if an error occurs
     */
    public void testAndSplitOtherwise() throws Exception {
  // Uses XPDL imported by testLoop
  ProcessMgr mgr = defDir.processMgr("SystemTest", "andOtherwiseTest");
  WfProcess proc = mgr.createProcess(requester);
  proc.start();
  // Wait for completion
  assertTrue(stateReached(proc, "closed.completed"));
  ProcessData data = proc.processContext();
  assertTrue(((Boolean)data.get("Success")).equals(Boolean.TRUE));
  assertTrue(((Boolean)data.get("Error")).equals(Boolean.FALSE));
  procDir.removeProcess(proc);
  defDir.removeProcessDefinition("SystemTest", "andOtherwiseTest")
    }
View Full Code Here

     * @exception Exception if an error occurs
     */
    public void loopTest() throws Exception {
  ProcessMgr mgr = defDir.processMgr
      ("deferredChoiceTests", "loopingDeferredChoiceTest");
  WfProcess proc = mgr.createProcess(requester);
  String procKey = proc.key();
  proc.start();
  assertTrue(stateReached(proc, "closed.completed"));
  ProcessData data = proc.processContext();
  String path = (String)data.get("Path");
  assertTrue(path, path.equals("Path:ACT0:ACT1:ACT2:ACT5:ACT1:ACT2:ACT5"
             + ":ACT1:ACT3:ACT5:ACT1:ACT3:ACT5"));
  procDir.removeProcess(proc);
    }
View Full Code Here

     * @exception Exception if an error occurs
     */
    public void terminateProcessTest() throws Exception {
  ProcessMgr mgr = defDir.processMgr
      ("deferredChoiceTests", "terminateTest");
  WfProcess proc = mgr.createProcess(requester);
  String procKey = proc.key();
  proc.start();
  assertTrue(stateReached(proc, "open.running"));
  proc.terminate ();
  assertTrue(stateReached(proc, "closed.terminated"));
  procDir.removeProcess(proc);
    }
View Full Code Here

TOP

Related Classes of de.danet.an.workflow.omgcore.WfProcess

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.