Package de.danet.an.workflow.api

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


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


    }

    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

    public List getContextVariables () {
        if (managerNameFilter.length() == 0) {
            return new ArrayList();
        }
        if (contextVariables == null) {
            ProcessDefinitionDirectory pdd = null;
            try {
                pdd = wsc.getWorkflowService().processDefinitionDirectory();
                String[] ids = managerNameFilter.split("/");
                ProcessMgr mgr = pdd.processMgr(ids[0], ids[1]);
                ProcessDataInfo pdi = mgr.contextSignature();
                contextVariables = new ArrayList ();
                contextVariables.add(new SelectItem (""));
                for (Iterator i = pdi.entrySet().iterator(); i.hasNext();) {
                    Map.Entry e = (Map.Entry)i.next();
View Full Code Here

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

      InputStream is = getClass()
                .getResourceAsStream("/process/auditing.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() > 1);
  } finally {
      workflowService().release (pdd);
  }
    }
View Full Code Here

     * using the ProcessDefinitionDirectory bean.
     */
    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

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

    }

    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

     * Create a new process for the given type and start it.
     */
    public void createAndStartProcessBatched() throws Exception {
  WfRequester cont = new DefaultRequester(workflowService());

  ProcessDefinitionDirectory pdd = null;
  WfProcessMgr pmgr = null;
  try {
      pdd = workflowService().processDefinitionDirectory ();
      pmgr = pdd.processMgr("ut-process", "jut1");
  } finally {
      workflowService().release (pdd);
  }
  MethodInvocationBatch mib = new MethodInvocationBatch();
  mib.addInvocation
View Full Code Here

    /**
     * Create a new process and then remove its process definition.
     */
    public void createProcess1AndRemoveProcessDef() throws Exception
  ProcessDefinitionDirectory pdd = null;
  try {
      WfRequester cont = new DefaultRequester(workflowService());
      Process process = (Process)createProcess("ut-process", "jut1", cont);
      assertTrue(process.state().startsWith("open.not_running.not_started"));
      process.start();
      assertTrue(process.state().startsWith("open.running"));
      // remove its process definition
      pdd = workflowService().processDefinitionDirectory ();
      ProcessDefinition pd
    = pdd.lookupProcessDefinition("ut-process", "jut1");
      assertTrue(pd!=null);
      pdd.removeProcessDefinition("ut-process", "jut1");
      boolean gotEx = false;
      try {
    pd = pdd.lookupProcessDefinition("ut-process", "jut1");
      } catch (Exception ex) {
    gotEx = true;
      }
      assertTrue(gotEx);
      // check the process definition of the process
      ProcessDefinition procDef = process.processDefinition();
      assertTrue(procDef.packageId().equals("ut-process"));
      assertTrue(procDef.processId().equals("jut1"));
      // import the process definition again.
      importProcessDefinitions();
      pd = pdd.lookupProcessDefinition("ut-process", "jut1");
      assertTrue(pd!=null);
  } finally {
      workflowService().release (pdd);
  }
    }
View Full Code Here

  }
    }

    public static void importProcessDefinitions(String filename)
  throws Exception {
        ProcessDefinitionDirectory pdd
            = WorkflowServiceFactory.newInstance()
            .newWorkflowService().processDefinitionDirectory();
  InputStream is = Basic.class.getResourceAsStream(filename);
  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.