Package de.danet.an.workflow.api

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


  ProcessDefinitionDirectory procDefDir = null;
  ProcessDirectory procDir = null;
  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir
    .processMgr ("jellytests", "insertTest");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      process.start();
      assertTrue (stateReached (process, "closed.completed"));
      procDir.removeProcess(process);
  } finally {
      workflowService.release (procDefDir);
View Full Code Here


  ProcessDefinitionDirectory procDefDir = null;
  ProcessDirectory procDir = null;
  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir
    .processMgr ("jellytests", "resultsTest");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      process.start();
      assertTrue (stateReached (process, "closed.completed"));
      procDir.removeProcess(process);
  } finally {
      workflowService.release (procDefDir);
View Full Code Here

  ProcessDefinitionDirectory procDefDir = null;
  ProcessDirectory procDir = null;
  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir
    .processMgr ("jellytests", "dbTest");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      process.start();
      assertTrue (stateReached (process, "closed.completed"));
      procDir.removeProcess(process);
  } finally {
      workflowService.release (procDefDir);
View Full Code Here

  (String pkgId, String prcId, WfRequester req)
        throws Exception {
  ProcessDefinitionDirectory procDir = null;
  try {
      procDir = workflowService.processDefinitionDirectory();
      ProcessMgr pmgr = procDir.processMgr(pkgId, prcId);
      return pmgr.createProcess (req);
  } finally {
      workflowService.release (procDir);
  }
    }
View Full Code Here

     * Check context signature.
     */
    public void contextSignature() throws Exception {
  Basic.importProcessDefinitions("/procdef/initialProcesses.xml");
  // create the process
  ProcessMgr processMgr = getProcessMgr("ut-procdef", "jut1");
  ProcessDataInfo procDataInfo = processMgr.contextSignature ();
  assertTrue (procDataInfo.containsKey("packageTestValue1"));
  assertTrue (procDataInfo.get("packageTestValue1")
        .equals (java.lang.String.class));
  assertTrue (procDataInfo.containsKey("packageTestValue2"));
  assertTrue (procDataInfo.get("packageTestValue2")
View Full Code Here

    }
    ProcessLookup pl = new ProcessLookup();
    ProcessDefinitionDirectory procDefDir
                    = wfs.processDefinitionDirectory();
    if ( packageID != null && processID != null ) {
                    ProcessMgr mgr = null;
        try {
      mgr = procDefDir.processMgr(packageID, processID);
        } catch (InvalidKeyException e) {
      throw new ProcessingException
          (HttpServletResponse.SC_BAD_REQUEST,
           e.getMessage());
        }
                    String mgrName = mgr.name();
        if (dataItemName != null && dataItemValue != null) {
      // Try to connect to existing process
      Collection procs = mgr
          .findByDataItem(dataItemName, dataItemValue);
      if (procs.size() == 1)  {
                            pl.process = (WfProcess)procs.iterator().next();
          pl.procKey = pl.process.key();
          pl.packageId = packageID;
          pl.processId = processID;
          if ( session != null) {
        session.setAttribute("WfM_mgrName", mgr.name());
        session.setAttribute("WfM_procKey", pl.procKey);
          }
                            return pl;
                        }
      if (procs.size() > 1) {
          logger.error
                                ("More than one process found for " + mgr.name()
                                 + ", data item: " + dataItemName + " = "
         + dataItemValue);
          throw new ProcessingException
        (HttpServletResponse.SC_CONFLICT,
         "More than one matching process found");
View Full Code Here

      (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
       "Unable to retrieve workflow service");
    }
    ProcessDefinitionDirectory procDefDir
                    = wfs.processDefinitionDirectory();
    ProcessMgr mgr = null;
    try {
        mgr = procDefDir.processMgr(pl.packageId, pl.processId);
    } catch (InvalidKeyException e) {
        throw new ProcessingException
      (HttpServletResponse.SC_BAD_REQUEST,
       e.getMessage());
    }
    ProcessDirectory procDir = wfs.processDirectory();
    WfProcess proc = null;
    try {
        proc = procDir.lookupProcess(mgr.name(), pl.procKey);
    } catch (InvalidKeyException e) {
        throw new ProcessingException
      (HttpServletResponse.SC_GONE,
       "Process has been removed");
    }
View Full Code Here

                .executeBatch(new SimpleApplicationDirectoryLookup());
            assertTrue (ad.infosByKey
                        ("unittests.Test1", "ToolTest").size() == 0);
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir
    .processMgr ("simpleApplDirTests", "test1");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      process.start();
            WfActivity act = null;
      for (Iterator i = process.steps().iterator(); i.hasNext();) {
          act = (WfActivity)i.next ();
          if (act.name().equals("invokeTool")) {
View Full Code Here

    private WfProcess createProcess(String pkgId, String prcId, WfRequester req)
            throws Exception {
        ProcessDefinitionDirectory procDir = null;
        try {
            procDir = workflowService.processDefinitionDirectory();
            ProcessMgr pmgr = procDir.processMgr(pkgId, prcId);
            return pmgr.createProcess(req);
        } finally {
            workflowService.release(procDir);
        }
    }
View Full Code Here

     * (automatically) removing.
     * @exception Exception if an error occurs
     */
    public void simpleSubflow() throws Exception {
  importProcessDefinition("/process/subflow.xml");
  ProcessMgr mgr = defDir.processMgr("SystemTest", "withSimpleSub");
  //WfProcess proc = mgr.createProcess(requester);
  WrappedProcess proc = new WrappedProcess(mgr.createProcess(requester));
  proc.start();
  // Wait for completion
  assertTrue(stateReached(proc, "closed.completed"));
  ProcessData data = proc.processContext();
  assertTrue(((String)data.get("TransitionPath"))
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.