Package de.danet.an.workflow.api

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


        return new EJBClientTest (plc, suite);
    }

    private ProcessMgr getProcessMgr (String pkgId, String prcId)
        throws Exception {
        ProcessDefinitionDirectory procDir
            = WorkflowServiceFactory.newInstance()
            .newWorkflowService().processDefinitionDirectory();
  return procDir.processMgr(pkgId, prcId);
    }
View Full Code Here


    /**
     * Import the process definitions from a XPDL file
     * unsing the ProcessDefinitionDirectory bean.
     */
    public void importProcessDefinitions() throws Exception {
  ProcessDefinitionDirectory pdd = null;
  try {
      pdd = workflowService().processDefinitionDirectory ();

      InputStream is = getClass()
                .getResourceAsStream("/process/jellytest.xml");
      assertTrue (is != null);
      BufferedReader br = new BufferedReader
    (new InputStreamReader(is, "ISO-8859-1"));
      StringBuffer sb = new StringBuffer();
      String st;
      while ((st = br.readLine()) != null) {
    sb.append(st + "\n");
      }
      pdd.importProcessDefinitions(sb.toString());
  } finally {
      workflowService().release (pdd);
  }
    }
View Full Code Here

    }

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

    /**
     * Remove its process definition.
     */
    public void removeProcessDefinitions() throws Exception
  ProcessDefinitionDirectory pdd = null;
  try {
      pdd = workflowService().processDefinitionDirectory ();
      for (Iterator i = pdd.processDefinitions().iterator ();
     i.hasNext ();) {
    ProcessDefinition pd = (ProcessDefinition)i.next ();
    if (pd.packageId().equals ("jelly-test")) {
        pdd.removeProcessDefinition
      (pd.packageName(), pd.processName());
    }
      }
  } finally {
      workflowService().release (pdd);
View Full Code Here

  pdd = getProcessDefinitionDirectory();
    }

    private ProcessDefinitionDirectory getProcessDefinitionDirectory()
  throws Exception {
        ProcessDefinitionDirectory pdd
            = WorkflowServiceFactory.newInstance()
            .newWorkflowService().processDefinitionDirectory();
  return pdd;
    }
View Full Code Here

        throw new ProcessingException
      (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
       "Unable to retrieve workflow service");
    }
    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());
        }
View Full Code Here

    if (wfs == null) {
        throw new ProcessingException
      (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());
    }
View Full Code Here

        out.println("<head><title>Test Servlet</title></head>");
        out.println("<body>");
        out.println("<h1>Process definitions</h1>");

  WorkflowService wfs = null;
  ProcessDefinitionDirectory pdd = null;
  try {
      WorkflowServiceFactory wfsf = WorkflowServiceFactory.newInstance ();
      wfs = wfsf.newWorkflowService();
      pdd = wfs.processDefinitionDirectory();
      for (Iterator i = pdd.processDefinitions().iterator ();
     i.hasNext();) {
    ProcessDefinition pd = (ProcessDefinition)i.next ();
    out.println(pd.packageName() + "/" + pd.processName() + "<br>");
      }
  } finally {
View Full Code Here

     * In this case, it can be assumed, that the duplicate was found in the
     * database, rather than in the cache.
     * @throws Exception ...
     */
    public void checkUpdatedProcessDefinition() throws Exception {
        ProcessDefinitionDirectory pdd
            = WorkflowServiceFactory.newInstance()
            .newWorkflowService().processDefinitionDirectory();

  // import the origin process definition
  InputStream is = getClass().getResourceAsStream
      ("/procdef/initialProcessesCache1.xml");
  assertTrue (is != null);
  BufferedReader br = new BufferedReader
      (new InputStreamReader(is, "ISO-8859-1"));
  StringBuffer sb = new StringBuffer();
  String st;
  while ((st = br.readLine()) != null) {
      sb.append(st + "\n");
  }
  pdd.importProcessDefinitions(sb.toString());

  // Lookup for the process definition and save creation date
  ProcessDefinition pd
      = pdd.lookupProcessDefinition("ut-procdef", "jut2");
  assertTrue (pd!=null);
  String firstDate = pd.processHeader().packageHeader().created();

  // Import the duplicate process definition
  is = getClass().getResourceAsStream
      ("/procdef/initialProcessesCache2.xml");
  assertTrue (is != null);
  br = new BufferedReader
      (new InputStreamReader(is, "ISO-8859-1"));
  sb = new StringBuffer();
  st = null;
  while ((st = br.readLine()) != null) {
      sb.append(st + "\n");
  }
  pdd.importProcessDefinitions(sb.toString());

  // Lookup for the duplicate process definition
  pd = pdd.lookupProcessDefinition("ut-procdef", "jut2");
  assertTrue (pd!=null);
  String secondDate = pd.processHeader().packageHeader().created();

  // check for different creation dates
  //System.err.println(firstDate);
View Full Code Here

     * Import the process definitions from a XPDL file
     * unsing the ProcessDefinitionDirectory bean.
     */
    public void importProcessDefinitions() throws Exception {
  // Create process definition directory bean
  ProcessDefinitionDirectory pdd
            = workflowService().processDefinitionDirectory();

  InputStream is = getClass().getResourceAsStream("/process/jstest.xml");
  assertTrue (is != null);
  BufferedReader br = new BufferedReader
      (new InputStreamReader(is, "ISO-8859-1"));
  StringBuffer sb = new StringBuffer();
  String st;
  while ((st = br.readLine()) != null) {
      sb.append(st + "\n");
  }
  pdd.importProcessDefinitions(sb.toString());
  Collection processDefinitions = pdd.processDefinitions();
  assertTrue (processDefinitions.size() > 0);
 
    }
View Full Code Here

TOP

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

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.