Package de.danet.an.workflow.api

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


      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 {
      if (wfs != null) {
    wfs.release(pdd);
    wfs.release(wfs);
View Full Code Here


      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);
  //System.err.println(secondDate);
  assertTrue(!firstDate.equals(secondDate));
View Full Code Here

     System.out.println(sw.toString());
      }

      // remove its process definition
      pdd = workflowService().processDefinitionDirectory ();
      ProcessDefinition pd
    = pdd.lookupProcessDefinition("N1", "N2");
      assertTrue(pd!=null);
      pdd.removeProcessDefinition("N1", "N2");
      boolean gotEx = false;
      try {
    pd = pdd.lookupProcessDefinition("N1", "N2");
      } catch (Exception ex) {
    gotEx = true;
      }
      assertTrue(gotEx);
      // check the process definition of the process
      ProcessDefinition procDef = process.processDefinition();
      assertTrue(procDef.packageId().equals("N1"));
      assertTrue(procDef.processId().equals("N2"));
      // import the process definition again.
      importProcessDefinitions();
      pd = pdd.lookupProcessDefinition("N1", "N2");
      assertTrue(pd!=null);
  } finally {
View Full Code Here

  Collection processDefinitions = pdd.processDefinitions();
  assertTrue (processDefinitions.size() > 0);
  Collection ids = new ArrayList();
  Collection names = new ArrayList();
  for (Iterator pdi = processDefinitions.iterator(); pdi.hasNext();) {
      ProcessDefinition pd = (ProcessDefinition)pdi.next();
      ids.add (pd.processId());
      names.add (pd.processName());
  }
  assertTrue (ids.contains ("jut1"));
  assertTrue (names.contains ("JUnit Test Process 1"));
  assertTrue (ids.contains ("jut2"));
  assertTrue (names.contains ("JUnit Test Process 2"));
View Full Code Here

            = WorkflowServiceFactory.newInstance()
            .newWorkflowService().processDefinitionDirectory();

  Collection processDefinitions = pdd.processDefinitions();
  assertTrue (processDefinitions.size() > 0);
  ProcessDefinition pd
      = (ProcessDefinition)(processDefinitions.iterator().next());
  assertTrue (pdd.isEnabled(pd.packageId(), pd.processId()));
  pdd.setEnabled (pd.packageId(), pd.processId(), false);
  assertTrue (!pdd.isEnabled(pd.packageId(), pd.processId()));
  pdd.setEnabled (pd.packageId(), pd.processId(), true);
  assertTrue (pdd.isEnabled(pd.packageId(), pd.processId()));
    }
View Full Code Here

    public void  removeProcessDefinition() throws Exception {
        ProcessDefinitionDirectory pdd
            = WorkflowServiceFactory.newInstance()
            .newWorkflowService().processDefinitionDirectory();

  ProcessDefinition pd
      = pdd.lookupProcessDefinition("ut-procdef", "jut1");
  assertTrue(pd!=null);
  pdd.removeProcessDefinition("ut-procdef", "jut1");
  boolean gotEx = false;
  try {
View Full Code Here

    public ProcessDefinition getProcessDefinition() throws Exception {
        ProcessDefinitionDirectory pdd
            = WorkflowServiceFactory.newInstance()
            .newWorkflowService().processDefinitionDirectory();
 
  ProcessDefinition pd
      = pdd.lookupProcessDefinition("ut-procdef", "jut2");
  assertTrue (pd!=null);
  boolean gotEx = false;
  try {
      pd = pdd.lookupProcessDefinition("ut-procdef", "doesn't exist");
View Full Code Here

  assertTrue(gotEx);
  return pd;
    }

    public void removeClosedProcess() throws Exception {
  ProcessDefinition procDef = getProcessDefinition();
  assertTrue(!procDef.removeClosedProcess());
    }
View Full Code Here

    public void getSignatures() throws Exception {
        ProcessDefinitionDirectory pdd
            = WorkflowServiceFactory.newInstance()
            .newWorkflowService().processDefinitionDirectory();
 
  ProcessDefinition pd
      = pdd.lookupProcessDefinition("ut-procdef", "called1");
  assertTrue (pd != null);
  assertTrue (pd.processHeader().created().equals ("07.04.2003"));
  assertTrue (pd.processHeader().description().equals ("Was tun"));
  ProcessDataInfo pdi = pd.resultSignature();
  assertTrue (pdi.keySet().size () == 1);
  assertTrue (pdi.containsKey("status"));
  assertTrue (pdi.get("status") == String.class);
    }
View Full Code Here

    public void redefinableHeader() throws Exception {
  importProcessDefinitions("/procdef/testRedefinableHeader.xml");
        ProcessDefinitionDirectory pdd
            = WorkflowServiceFactory.newInstance()
            .newWorkflowService().processDefinitionDirectory();
  ProcessDefinition pd = pdd.lookupProcessDefinition
      ("ut-procdef", "testRedefinableHeader");
  assertTrue(pd.processHeader().author().equals("tester"));
  // Redefinable header of version in process overrides the version
  // defined in the package redefinable header.
  assertTrue(pd.processHeader().version().equals("1.2"));
  pdd.removeProcessDefinition("ut-procdef", "testRedefinableHeader");
    }
View Full Code Here

TOP

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

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.