Package de.danet.an.workflow.omgcore

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


      ("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


  return suite;
    }

    private static TestSuite createStartAndInitializeSuite() {
  TestSuite suite = new TestSuite();
  ProcessData initialProcessData5 = new DefaultProcessData();
  initialProcessData5.put("d1", "Initial Data 1");
  initialProcessData5.put("d2", "Initial Data 2");
  initialProcessData5.put("d3", "Initial Data 3");
  initialProcessData5.put("d4", "Initial Data 4");
  initialProcessData5.put("d5", "Initial Data 5");
  addTest(suite, "5 Process Relevant Datas And 5 Activities "
    + " (A5T6comCyNoImplPrRelData5)",
    new GenericTest("createStartAndInitializeProcess",
        "A5T6comCyNoImplPrRelData5",
        initialProcessData5));

  ProcessData initialProcessData10
      = new DefaultProcessData(initialProcessData5);
  initialProcessData10.put("d6", "Initial Data 6");
  initialProcessData10.put("d7", "Initial Data 7");
  initialProcessData10.put("d8", "Initial Data 8");
  initialProcessData10.put("d9", "Initial Data 9");
  initialProcessData10.put("d10", "Initial Data 10");
  addTest(suite, "10 Process Relevant Datas And 5 Activities " 
    + " (A5T6comCyNoImplPrRelData10)",
    new GenericTest("createStartAndInitializeProcess",
        "A5T6comCyNoImplPrRelData10",
        initialProcessData10));

  ProcessData initialProcessData20
      = new DefaultProcessData(initialProcessData10);
  initialProcessData20.put("d11", "Initial Data 11");
  initialProcessData20.put("d12", "Initial Data 12");
  initialProcessData20.put("d13", "Initial Data 13");
  initialProcessData20.put("d14", "Initial Data 14");
  initialProcessData20.put("d15", "Initial Data 15");
  initialProcessData20.put("d16", "Initial Data 16");
  initialProcessData20.put("d17", "Initial Data 17");
  initialProcessData20.put("d18", "Initial Data 18");
  initialProcessData20.put("d19", "Initial Data 19");
  initialProcessData20.put("d20", "Initial Data 20");
  addTest(suite, "20 Process Relevant Datas And 5 Activities "
    + "(A5T6comCyNoImplPrRelData10)",
    new GenericTest("createStartAndInitializeProcess",
        "A5T6comCyNoImplPrRelData20",
        initialProcessData20));
View Full Code Here

     */
    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
View Full Code Here

     */
    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;
  try {
      proc.setProcessContext(data);
  } catch (InvalidDataException exc) {
      invalidData = true;   
  }
  assertTrue(invalidData);
  data.remove("");
  proc.setProcessContext(data);
 
  procDir.removeProcess(proc);
  Util.logExit("modifyData");
    }
View Full Code Here

    ("Invalid type for data field \"" + name
     + "\": " + ((Class)type).getName ());
  }
  // now do changes
  DOMBuilder builder = null;
  ProcessData oldValues = new DefaultProcessData();
  for (Iterator i = (new ArrayList (newValues.keySet())).iterator();
       i.hasNext();) {
      String name = (String)i.next();
      oldValues.put(name, getPaProcessData().get(name));
      Object v = newValues.get(name);
            if (logger.isDebugEnabled ()) {
                logger.debug ("Setting context data item " + name + " = " + v);
            }
            Object type = sig.get (name);
View Full Code Here

     * @ejb.interface-method view-type="remote"
     */
    public ProcessData result ()
        throws ResultNotAvailableException {
        ProcessDataInfo resSig = processDefinition().resultSignature();
        ProcessData procCtx = getPaProcessData();
        ProcessData resData = new DefaultProcessData();
        for (Iterator i = resSig.keySet().iterator(); i.hasNext();) {
            String key = (String)i.next();
            resData.put(key, procCtx.get(key));
        }
  return resData;
    }
View Full Code Here

      String key = ((SubProcRequester)req).requestingActivity();
      try {
    ActivityLocal act = lookupActivityLocal (key);
    if (act.typedState() != RunningState.ABANDONING
        && act.typedState() != ClosedCompletedState.ABANDONED) {
        ProcessData res = processContext();
        FormalParameter[] fps
      = processDefinition().formalParameters();
        ProcessData pd = new ProcessDataWithParams (fps);
        for (int i = 0; i < fps.length; i++) {
      FormalParameter fp = fps[i];
      if (fp.mode() == FormalParameter.Mode.IN) {
          continue;
      }
      String fpn = fps[i].id();
      pd.put (fpn, res.get (fpn));
        }
        act.setResult (pd);
        act.complete ();
    }
      } catch (InvalidKeyException e) {
View Full Code Here

  JDBCPersistentMap m = new JDBCPersistentMap
      (ds, Long.valueOf (recKey), tableName);
  try {
      m.setConnection(con);
      m.load();
      ProcessData data = new DefaultProcessData();
      data.putAll(m);
      return data;
  } catch (PersistentMapSQLException e) {
      throw (SQLException)e.getCause();
  } finally {
      m.setConnection(null);
View Full Code Here

    ExtProcessLocal process = (ExtProcessLocal)act.containerLocal();
    ProcessDefinitionDirectoryLocal pdd
        = (ProcessDefinitionDirectoryLocal)
        process.processDefinitionDirectoryLocal ();
    WfRequester req = new SubProcRequester (act, execMode);
    ProcessData pd = new DefaultProcessData
        (parameterMap (process, act, pdd));   
    WfProcessLocal p
                    = pdd.createProcessLocal (packageId(), processId(), req);
    p.setProcessContext(pd);
    p.start ();
View Full Code Here

                proc.setDescription(subject);
            }

            if (contextData != null) {
                ProcessDefinition procdef = proc.processDefinition();
                ProcessData procData = getProcessData(procdef, contextData);
                proc.setProcessContext(procData);
            }

            if (startImmediately) {
                proc.start();
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.