Package de.danet.an.workflow.api

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


     */
    private ProcessData getProcessData(ProcessDefinition procdef,
            SOAPElement contextData)
        throws RemoteException, SOAPException, ParseException {
        ProcessDataInfo info = procdef.contextSignature();
        ProcessData procData = new DefaultProcessData();
       
        for (Iterator pdi = contextData.getChildElements(); pdi.hasNext();) {
            SOAPElement current = (SOAPElement) pdi.next();
            String pdname = current.getLocalName();
            Object type = info.get(pdname);
            if (type == null) {
                throw new SOAPException("process does not contain a variable "
                                + "with name " + pdname);
            }
            String pdvalue = XMLUtil.getFirstLevelTextContent(current);
           
            Object value;
           
            if (type.equals(String.class)) {
                value = pdvalue;
            } else if (type.equals(Long.class)) {
                value = new Long(pdvalue);
            } else if (type.equals(Double.class)) {
                value = new Double(XMLUtil.parseXsdDouble(pdvalue));
            } else if (type.equals(Boolean.class)) {
                value = new Boolean(XMLUtil.parseXsdBoolean(pdvalue));
            } else if (type.equals(Date.class)) {
                value = XMLUtil.parseXsdDateTime(pdvalue);
            } else if (type.equals(org.w3c.dom.Element.class)) {
                // TODO: Check other values for schema types.
                value = current.getFirstChild();
            } else {
                // cannot resolve the type. leave it as a string and pray.
                value = pdvalue;
            }
           
            procData.put(pdname, value);
        }
       
        return procData;
    }
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

  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

     *
     * @return the process relevant data that define the context of the
     * process.
     */
    public ProcessData processContext () {
  return new DefaultProcessData (getPaProcessData());
    }
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

     */
    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

      if (act instanceof ActivityProxy) {
          involveContainerInTx((ActivityProxy)act);
          act = ((ActivityProxy)act).unwrap();
      }
      if (result != null) {
    act.setResult (new DefaultProcessData(result));
      }
      act.complete();
  } catch (NoSuchObjectException e) {
      logger.warn
    (act + " does not exist any more "
View Full Code Here

  } else if ((eventType.equals(WfAuditEvent.PROCESS_CONTEXT_CHANGED))
       ||(eventType.equals(WfAuditEvent.ACTIVITY_CONTEXT_CHANGED))
       ||(eventType.equals(WfAuditEvent.ACTIVITY_RESULT_CHANGED))){
      return new DefaultDataAuditEvent
    (eventBase,
     new DefaultProcessData
     (selectDataAuditEventData
      (con, rs.getString(10), "DataAuditEventOldData")),
     new DefaultProcessData
     (selectDataAuditEventData
      (con, rs.getString(10), "DataAuditEventNewData")));
        } else if (eventType.equals(WfAuditEvent.ACTIVITY_ASSIGNMENT_CHANGED)){
      return new DefaultAssignmentAuditEvent
    (eventBase, rs.getString(10), rs.getString(12),
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

TOP

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

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.