Package de.danet.an.workflow.omgcore

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


  ProcessMgr mgr = defDir.processMgr("SystemTest", "timeoutBlock");
  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("TransitionPath");
  assertTrue(path,
       path.equals("PATH:start:a1:t1:a3:a2:t0:end"));
  procDir.removeProcess(proc);
    }
View Full Code Here


  ProcessMgr mgr = defDir.processMgr("SystemTest", "timeoutSubflow");
  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("TransitionPath");
  assertTrue(path,
       path.equals("PATH:start:a1:t1:a3:a2:t0:end"));
  procDir.removeProcess(proc);
    }
View Full Code Here

     * @exception Exception if an error occurs
     */
    public void testData() throws Exception {
  ProcessMgr mgr = defDir.processMgr("SystemTest_full", "full");
  WfProcess proc = mgr.createProcess(requester);
  ProcessData data = proc.processContext();
  assertTrue(((Boolean)data.get("packageBooleanData")).booleanValue());
  assertTrue(((String)data.get("testString")).equals("WfMOpen"));
  assertTrue((((String)data.get("packageStringData")) == null));
  assertTrue(((Long)data.get("packageIntegerData")).intValue() == 3);

  // Test access to context info via activity
  assertTrue(proc.steps().size() > 0);
  WfActivity act = (WfActivity)proc.steps().toArray()[0];
  data = act.processContext();
  assertTrue(((Boolean)data.get("packageBooleanData")).booleanValue());
  assertTrue(((String)data.get("testString")).equals("WfMOpen"));
  assertTrue((((String)data.get("packageStringData")) == null)
       || (((String)data.get("packageStringData")).equals("")));
  assertTrue(((Long)data.get("packageIntegerData")).intValue() == 3)

  procDir.removeProcess(proc);

  mgr = defDir.processMgr("SystemTest_minimal", "minimal");
  proc = mgr.createProcess(requester);
View Full Code Here

     * @exception Exception if an error occurs
     */
    public void modifyData() throws Exception {
  ProcessMgr mgr = defDir.processMgr("SystemTest_full", "full");
  WfProcess proc = mgr.createProcess(requester);
  ProcessData data = proc.processContext();
 
  assertTrue(((Boolean)data.get("packageBooleanData")).booleanValue());
  assertTrue(((String)data.get("testString")).equals("WfMOpen"));
  assertTrue((((String)data.get("packageStringData")) == null));
  assertTrue(((Long)data.get("packageIntegerData")).intValue() == 3);
  data.put("", null);
  // Illegal empty entry
  boolean invalidData = false;
  try {
      proc.setProcessContext(data);
  } catch (InvalidDataException exc) {
      invalidData = true;   
  }
  assertTrue(invalidData);
  data.remove("");
  data.put("teststring", "illegal");
  data.put("packageIntegerData", "5");
  // Misspelled teststring and wrong data type for Integer
  invalidData = false;
  try {
      proc.setProcessContext(data);
  } catch (InvalidDataException exc) {
      invalidData = true;   
  }
  data.remove("teststring");
  Iterator it = data.keySet().iterator();
  // Still wrong data type for Integer
  invalidData = false;
  try {
      proc.setProcessContext(data);
  } catch (InvalidDataException exc) {
      invalidData = true;   
  }
  data.put("packageIntegerData", new Integer("5"));

  proc.setProcessContext(data);
  ProcessDataInfo ctxInfo = mgr.contextSignature();
  // Fetch data to check modifications
  data = proc.processContext();
  assertTrue(((Long)data.get("packageIntegerData")).intValue() == 5);

  procDir.removeProcess(proc);

  mgr = defDir.processMgr("SystemTest_minimal", "minimal");
  proc = mgr.createProcess(requester);
  data = proc.processContext();
  assertTrue(data.isEmpty());
  proc.setProcessContext(data);
  data.put("", null);
  invalidData = false;
  try {
      proc.setProcessContext(data);
  } catch (InvalidDataException exc) {
      invalidData = true;   
  }
  assertTrue(invalidData);
  data.remove("");
  proc.setProcessContext(data);
 
  procDir.removeProcess(proc);
    }
View Full Code Here

    }

    public void generate(TypicalProcess process, int number,
       InitialProcessDataAdapter adapter)
  throws Exception {
  ProcessData pd = new DefaultProcessData(process.initialProcessData());
  int counterForNotStartedProcesses = 0;
  for (int i = 0; i < number; i++) {
      adapter.adapt(pd, i, number);
      try {
    new TypicalProcess(pd, initializeAndCreate, start);
View Full Code Here

  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

  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

  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

  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

  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

TOP

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

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.