Package de.danet.an.workflow.api

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


    /**
     * Returns a list of all defined process types
     * from the ProcessDirectory bean.
     */
    public void listProcessTypes() throws Exception {
        ProcessDirectory pdir
            = WorkflowServiceFactory.newInstance()
            .newWorkflowService().processDirectory();
  Collection processTypes = pdir.processMgrNames ();
  assertTrue (processTypes.size() > 0);
    }
View Full Code Here


    /**
     * Returns a list of all defined process types
     * from the ProcessDirectory bean.
     */
    public void listProcesses() throws Exception {
        ProcessDirectory pdir
            = WorkflowServiceFactory.newInstance()
            .newWorkflowService().processDirectory();
  Collection pts = pdir.processMgrNames ();
  Collection procs = pdir.processes();
    }
View Full Code Here

        if (mgrName == null || procKey == null) {
                        throw new ProcessingException
                            (HttpServletResponse.SC_BAD_REQUEST,
                             "No process information available");
                    }
        ProcessDirectory procDir = wfs.processDirectory();
        try {
            pl.process
                = procDir.lookupProcess(mgrName, procKey);
            pl.procKey = pl.process.key();
        } catch (InvalidKeyException e) {
            session.invalidate();
            throw new ProcessingException
                (HttpServletResponse.SC_GONE,
View Full Code Here

    } 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

    /**
     * Test.
     */
    public void findByKey () throws Exception {
  ProcessDefinitionDirectory procDefDir = null;
  ProcessDirectory procDir = null;
  try {
            SimpleApplicationDirectory ad
                = (SimpleApplicationDirectory)workflowService
                .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")) {
                    break;
          }
      }
      assertTrue (act != null);
            assertTrue (stateReached(act, "open.running"));
            Thread.sleep(1000);

            assertTrue (ad.infosByApplication("unittests.Test1").size() == 1);
            Collection infos
                = ad.infosByKey("unittests.Test1", "ToolTest");
            assertTrue (infos.size() == 1);
            SimpleApplicationInfo info
                = (SimpleApplicationInfo)infos.iterator().next();
            assertTrue (info.state() instanceof Object[]);
            WfActivity actFound = workflowService.processDirectory()
                .lookupActivity(info.activityUniqueKey());
            actFound.complete ();
            ad.removeInstance(info.id());
           
            assertTrue (stateReached (process, "closed.completed"));
      procDir.removeProcess(process);
  } finally {
      workflowService.release (procDefDir);
      workflowService.release (procDir);
  }
    }
View Full Code Here

        }
       
        ActivityUniqueKey uniqueKey = new ActivityUniqueKey(packageId + "/"
                + processId, processKey, activityKey);
       
        ProcessDirectory pd = getWorkflowService().processDirectory();
       
        return pd.lookupActivity(uniqueKey);
    }
View Full Code Here

        if (logger.isDebugEnabled()) {
            logger.debug("finding process definition'" + packageId + "/"
                    + processId + "/" + processKey + "'...");
        }
       
        ProcessDirectory pd = getWorkflowService().processDirectory();
       
        WfProcess proc
            = pd.lookupProcess(packageId + "/" + processId, processKey);
       
        return proc;
    }
View Full Code Here

     * Removes all processes created.
     * @exception Exception if an error occurs
     */
    public static void removeAllProcesses() throws Exception {
  // loop for all processes created
  ProcessDirectory pd = workflowService().processDirectory();
  Collection processes = pd.processes();
  for (Iterator it=processes.iterator(); it.hasNext();) {
      try {
    Process process = (Process)(it.next());
    pd.removeProcess(process);
      } catch (Exception e) {
    // process not in database anymore, so it is not running anymore
      }
  }
    }
View Full Code Here

     * Close (terminate, abort) all processes.
     * @exception Exception if an error occurs
     */
    public static void closeAllCloseableProcesses() throws Exception {
  // loop for all processes created
  ProcessDirectory pd = workflowService().processDirectory();
  Collection processes = pd.processes();
  for (Iterator it=processes.iterator(); it.hasNext();) {
      Process process = (Process)(it.next());
      try {
    process.abort();
      } catch (Exception e) {
View Full Code Here

     * Wait until no processes are running anymore.
     * @exception Exception if an error occurs
     */
    public static void waitForNoRunningProcesses() throws Exception {
  // loop for all processes created
  ProcessDirectory pd = workflowService().processDirectory();
  boolean runningProcesses = false;
  do {
      runningProcesses = false;
      Collection processes = pd.processes();
      for (Iterator it=processes.iterator();it.hasNext();) {
    try {
        Process process = (Process)(it.next());
        if (process.state().startsWith("open.running")) {
      runningProcesses = true;
View Full Code Here

TOP

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

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.