Package de.danet.an.workflow.api

Examples of de.danet.an.workflow.api.ProcessMgr


     * Test a xslt tool invocation which returns a complex data type of DOM
     * element.
     * @exception Exception if an error occurs
     */
    public void invokeTest11() throws Exception {
  ProcessMgr pmgr = pdd.processMgr("st-testXSLT", "testXSLT11");
  WfProcess process = pmgr.createProcess(defaultRequester());
   process.start();
  assertTrue(stateReached(process, "closed.completed"));
   Map map = (Map)process.result();
  for (Iterator it = map.keySet().iterator(); it.hasNext();) {
      String name = (String) it.next();
View Full Code Here


     * Test a xslt tool invocation which returns a complex data type of DOM
     * element.
     * @exception Exception if an error occurs
     */
    public void invokeTest12() throws Exception {
  ProcessMgr pmgr = pdd.processMgr("st-testXSLT", "testXSLT12");
  WfProcess process = pmgr.createProcess(defaultRequester());
   process.start();
  assertTrue(stateReached(process, "closed.completed"));
   Map map = (Map)process.result();
  for (Iterator it = map.keySet().iterator(); it.hasNext();) {
      String name = (String) it.next();
View Full Code Here

     * Test a xslt tool invocation which returns a complex data type of DOM
     * element.
     * @exception Exception if an error occurs
     */
    public void invokeTest13() throws Exception {
  ProcessMgr pmgr = pdd.processMgr("st-testXSLT", "testXSLT13");
  WfProcess process = pmgr.createProcess(defaultRequester());
   process.start();
  assertTrue(stateReached(process, "closed.completed"));
   Map map = (Map)process.result();
  for (Iterator it = map.keySet().iterator(); it.hasNext();) {
      String name = (String) it.next();
View Full Code Here

    /**
     * @exception Exception if an error occurs
     */
    public void invokeTest15() throws Exception {
  ProcessMgr pmgr = pdd.processMgr("st-testXSLT", "testXSLT15");
  WfProcess process = pmgr.createProcess(defaultRequester());
   process.start();
  assertTrue(stateReached(process, "closed.completed"));
   Map map = (Map)process.result();
  Date dt = (Date)map.get("datetime");
  assertTrue
View Full Code Here

     */
    protected SmartWfProcess createProcess (String pkgId, String prcId)
        throws Exception {
  ProcessDefinitionDirectory pdd
      = workflowService().processDefinitionDirectory();
  ProcessMgr pmgr = pdd.processMgr(pkgId, prcId);
  return smart(pmgr.createProcess (defaultRequester()));
    }
View Full Code Here

     * Test context signature of process description.
     * @exception Exception if an error occurs
     */
    public void testInfo() throws Exception {
  Util.logEntry("testInfo");
  ProcessMgr mgr = defDir.processMgr("SystemTest_full", "full");
  // Test context signature
  ProcessDataInfo ctxInfo = mgr.contextSignature();
  assertTrue(((Class)ctxInfo.get("packageBooleanData"))
       .isAssignableFrom(Boolean.class));
  assertTrue(((Class)ctxInfo.get("testString"))
       .isAssignableFrom(String.class));
  assertTrue(((Class)ctxInfo.get("packageIntegerData"))
       .isAssignableFrom(Long.class));
  assertTrue(((Class)ctxInfo.get("packageIntegerData"))
       .isAssignableFrom(Long.class));
  assertTrue(((Class)ctxInfo.get("packageStringData"))
       .isAssignableFrom(String.class));
  //wait to shutdown the processing instance
  Util.sleep(30000);

  // Test result signature (all OUT or INOUT parameters)
  Iterator res = mgr.resultSignature().values().iterator();
  ProcessDataInfo resInfo = mgr.resultSignature();
  assertTrue(((Class)resInfo.get("PARAM-InOut-String"))
       .isAssignableFrom(String.class));
  assertTrue(((Class)resInfo.get("PARAM-Out-Integer"))
       .isAssignableFrom(Long.class));

  mgr = defDir.processMgr("SystemTest_minimal", "minimal");
  //wait to shutdown the processing instance
  Util.sleep(30000);
  assertTrue(mgr.contextSignature().isEmpty());
  assertTrue(mgr.resultSignature().isEmpty());
  Util.logExit("testInfo");
    }
View Full Code Here

     * Test initial values of process data.
     * @exception Exception if an error occurs
     */
    public void testData() throws Exception {
  Util.logEntry("testData");
  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);

  //wait to shutdown the processing instance
  Util.sleep(30000);
  // 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");
  //wait to shutdown the processing instance
  Util.sleep(30000);
  proc = mgr.createProcess(requester);
  assertTrue(proc.processContext().isEmpty());
  procDir.removeProcess(proc);
  Util.logExit("testData");
    }
View Full Code Here

     * Test modification of process data.
     * @exception Exception if an error occurs
     */
    public void modifyData() throws Exception {
  Util.logEntry("modifyData");
  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);
  //wait to shutdown the processing instance
  Util.sleep(30000);
  // 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");
  //wait to shutdown the processing instance
  Util.sleep(30000);
  proc = mgr.createProcess(requester);
  data = proc.processContext();
  assertTrue(data.isEmpty());
  proc.setProcessContext(data);
  data.put("", null);
  invalidData = false;
View Full Code Here

  Util.logEntry("testEnabled");
  boolean gotException = false;
  // test default setting
  assertTrue(defDir.isEnabled("SystemTest_minimal", "minimal"));
  defDir.setEnabled("SystemTest_minimal", "minimal", false);
  ProcessMgr mgr = defDir.processMgr("SystemTest_minimal", "minimal");
  int noprocs = mgr.processes().size();
  //WfProcess proc = null;
  WrappedProcess proc = null;
  Util.sleep(15000);
  // Make sure that default is "disabled"
  assertTrue(mgr.processMgrState() == WfProcessMgr.DISABLED);
  // Test that process creation is not possible
  try {
      //proc = mgr.createProcess(requester);
      proc = new WrappedProcess(mgr.createProcess(requester));
  } catch (NotEnabledException exc) {
      gotException = true;
  }
  assertTrue(gotException);
  // Enable now and make sure that process can be created
  mgr.setProcessMgrState(WfProcessMgr.ENABLED);
  Util.sleep(15000);
  assertTrue(mgr.processes().size() == noprocs);
  proc = new WrappedProcess(mgr.createProcess(requester));
  createdProcs.add (proc);
  assertTrue(mgr.processes().size() == noprocs+1);
  Util.logExit("testEnabled");
    }
View Full Code Here

  } catch (InvalidKeyException exc) {
      gotException = true;
  }
  assertTrue(gotException);   
  // Try correct identifier
  ProcessMgr mgr = defDir.processMgr("SystemTest_minimal", "minimal");
  Util.sleep(15000);
  int noprocs = mgr.processes().size();
  //WfProcess proc = mgr.createProcess(requester);
  WrappedProcess proc = new WrappedProcess(mgr.createProcess(requester));
  assertTrue(mgr.processes().size() == noprocs+1);
  createdProcs.add (proc);
  Util.logExit("createMinimal");
    }
View Full Code Here

TOP

Related Classes of de.danet.an.workflow.api.ProcessMgr

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.