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 ("jstests", "testAbandon");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      process.start();
      assertTrue (stateReached (process, "closed.completed"));
      for (Iterator i = process.activitiesInState("closed").iterator ();
     i.hasNext ();) {
    WfActivity act = (Activity)i.next ();
View Full Code Here


        ProcessDefinitionDirectory procDefDir = null;
        ProcessDirectory procDir = null;
        try {
            procDefDir = workflowService.processDefinitionDirectory();
            procDir = workflowService.processDirectory();
            ProcessMgr pmgr = procDefDir.processMgr ("jstests", "testReplacer");
            WfProcess process
                = pmgr.createProcess(new DefaultRequester (workflowService));
            process.start();
            assertTrue (stateReached (process, "closed.completed"));
            SAXContentBuffer xmlRes = (SAXContentBuffer)
                process.processContext().get("XMLResult");
            Node resRoot = xmlRes.toW3cDom();
View Full Code Here

        ProcessDefinitionDirectory procDefDir = null;
        ProcessDirectory procDir = null;
        try {
            procDefDir = workflowService.processDefinitionDirectory();
            procDir = workflowService.processDirectory();
            ProcessMgr pmgr = procDefDir.processMgr ("jstests", "testAUK");
            WfProcess process
                = pmgr.createProcess(new DefaultRequester (workflowService));
            process.start();
            assertTrue (stateReached (process, "closed.completed"));
            String s = (String)process.processContext().get("Result");
            assertTrue (s.startsWith("jstests/testAUK "));
            procDir.removeProcess(process);
View Full Code Here

        ProcessDefinitionDirectory procDefDir = null;
        ProcessDirectory procDir = null;
        try {
            procDefDir = workflowService.processDefinitionDirectory();
            procDir = workflowService.processDirectory();
            ProcessMgr pmgr = procDefDir.processMgr ("jstests", "testJavaArg1");
            WfProcess process
                = pmgr.createProcess(new DefaultRequester (workflowService));
            process.start();
            assertTrue (stateReached (process, "closed.completed"));
            List l = (List)process.processContext().get("Result");
            assertTrue (l.size() == 1);
            assertTrue (((String)l.get(0)).equals("Hallo"));
View Full Code Here

        ProcessDefinitionDirectory procDefDir = null;
        ProcessDirectory procDir = null;
        try {
            procDefDir = workflowService.processDefinitionDirectory();
            procDir = workflowService.processDirectory();
            ProcessMgr pmgr = procDefDir.processMgr ("jstests", "testJavaArg2");
            WfProcess process
                = pmgr.createProcess(new DefaultRequester (workflowService));
            ProcessData data = new DefaultProcessData ();
            List l = new ArrayList();
            data.put("Argument", l);
            l.add ("Text:");
            process.setProcessContext(data);
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

  (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

  (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

  // Remove all old processes
  ProcessDefinitionDirectory procDefDir
      = workflowService().processDefinitionDirectory ();
  ProcessDirectory procDir = workflowService().processDirectory ();
  ProcessMgr pmgr = procDefDir.processMgr("ut-process", "dataItemLookup");
  Collection oldProcs = pmgr.processes();
  for (Iterator i = oldProcs.iterator(); i.hasNext ();) {
      procDir.removeProcess ((Process)i.next());
  }

  // Create some processes, first with null data item
  WfProcess null1 = pmgr.createProcess(req);
  WfProcess null2 = pmgr.createProcess(req);
  null2.start (); // start one to show it makes no difference

  // Now with value item
  ProcessData pd = new DefaultProcessData ();
  pd.put ("testValue", "Find this");
  WfProcess procThis1 = pmgr.createProcess(req);
  procThis1.setProcessContext (pd);
  WfProcess procThis2 = pmgr.createProcess(req);
  procThis2.setProcessContext (pd);
  WfProcess procThis3 = pmgr.createProcess(req);
  procThis3.setProcessContext (pd);

  pd.put ("testValue", "Find that");
  WfProcess procThat1 = pmgr.createProcess(req);
  procThat1.setProcessContext (pd);
  WfProcess procThat2 = pmgr.createProcess(req);
  procThat2.setProcessContext (pd);

  // very long value item
  String dummyText = "Streng dem definierten Wesen des Blindtextes "
      + "folgend, fungiere ich als solcher und gebe mich unverbindlich "
      + "inhaltsleer. In bedr�ckender Enge in vorgefertigte Masken "
      + "gepresst friste ich ein freudloses Dasein auf dem schmalen "
      + "Grat zwischen Nichtbeachtung und Bedeutungslosigkeit und habe "
      + "doch eine Bitte: Handeln Sie Sinn stiftend f�r meine Existenz "
      + "und lesen Sie mich.";
  pd.put ("testValue", dummyText);
  WfProcess procLong = pmgr.createProcess(req);
  procLong.setProcessContext (pd);

  // Do tests
  Collection c = pmgr.findByDataItem("testValue", null);
  assertTrue (c.size () == 2);
  c = toKeys (c);
  assertTrue (c.contains(null1.key()));
  assertTrue (c.contains(null2.key()));

  c = pmgr.findByDataItem ("testValue", "Find this");
  assertTrue (c.size () == 3);
  c = toKeys (c);
  assertTrue (c.contains(procThis1.key ()));
  assertTrue (c.contains(procThis2.key ()));
  assertTrue (c.contains(procThis3.key ()));
 
  c = pmgr.findByDataItem ("testValue", "Find that");
  assertTrue (c.size () == 2);
  c = toKeys (c);
  assertTrue (c.contains(procThat1.key ()));
  assertTrue (c.contains(procThat2.key ()));

  c = pmgr.findByDataItem ("testValue", dummyText);
  assertTrue (c.size () == 1);
  c = toKeys (c);
  assertTrue (c.contains(procLong.key ()));

  // Cleanup
  oldProcs = pmgr.processes();
  for (Iterator i = oldProcs.iterator(); i.hasNext ();) {
      procDir.removeProcess ((Process)i.next());
  }
    }
View Full Code Here

  ProcessDefinitionDirectory procDefDir = null;
  ProcessDirectory procDir = null;
  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir
    .processMgr ("jellytests", "basicTest");
      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

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.