Package de.danet.an.workflow.omgcore

Examples of de.danet.an.workflow.omgcore.WfProcess


     *
     */
    public void processjutToolInvocation() throws Exception {
  WfRequester req = new DefaultRequester(workflowService());
  // create the process
  WfProcess process
      = createProcess("ut-process", "jut_tool_invocation", req);
  assertTrue(process.state().equals("open.not_running.not_started"));
  // start the process
  process.start();
  Thread.sleep (1000);
  assertTrue(process.state().startsWith("open.running"));
  WfActivity act = actByName(process, "Account Antrag erstellen");
  assertTrue(invoke(act));
  act = actByName(process, "Account Antrag bearbeiten");
  assertTrue(invoke(act));
  Thread.sleep (1500);
  assertTrue(actByName(process, "Account Antrag r�ckmelden").state()
       .startsWith("closed.completed"));
  assertTrue(process.state().startsWith("closed.completed"));
    }
View Full Code Here


    /* Comment copied from interface. */
    public boolean isMemberOfPerformers(WfProcess wfProcess)
  throws RemoteException {
  for (Iterator ps = performers().iterator(); ps.hasNext();) {
      WfProcess p = (WfProcess)ps.next();
      if (p.key().equals (wfProcess.key())) {
    return true;
      }
  }
  return false;
    }
View Full Code Here

  if (mir.hasExceptions ()) {
      Exception e = mir.firstException ();
      assertTrue ("Problem executing batch: " + e.getMessage(), false);
  }
  Object[] results = mir.results();
  WfProcess proc = (WfProcess)results[0];
  assertTrue (proc.key().equals (results[1]));
    }
View Full Code Here

    /**
     * Create a new process for the given type.
     */
    public void createProcess2() throws Exception {
  WfRequester cont = new DefaultRequester(workflowService());
   WfProcess process = createProcess("ut-process", "jut2", cont);
  assertTrue(process.state().startsWith("open.not_running.not_started"));
    process.start();
  Thread.sleep (1000);
  assertTrue(process.state().startsWith("open.running"));
  int i = 9;
  int resCnt = 0;
  while (i-- > 0) {
      boolean resd = false;
      for (Iterator it = process.steps().iterator(); it.hasNext();) {
    WfActivity a = (WfActivity)it.next();
    if (a.state().startsWith ("open.not_running.suspended")) {
        a.resume ();
        resd = true;
        resCnt += 1;
View Full Code Here

    /**
     * Create a new process for the given type.
     */
    public void createProcess3() throws Exception {
  WfRequester cont = new DefaultRequester(workflowService());
  WfProcess process = createProcess("ut-process", "jut3", cont);
  assertTrue(process.state().startsWith("open.not_running.not_started"));
    process.start();
  Thread.sleep (5000);
  assertTrue("Process state should be closed.completed.normal, is "
       + process.state(),
       process.state().startsWith("closed.completed.normal"));
  assertTrue("Process workflow state should be closed, is "
       + process.workflowState(),
       process.workflowState().equals (State.CLOSED));
    }
View Full Code Here

    /**
     * Remove a given process from the database.
     */
    public void removeProcess3() throws Exception {
  WfRequester cont = new DefaultRequester(workflowService());
  WfProcess process = createProcess("ut-process", "jut999", cont);
  ProcessDirectory pd = null;
  try {
      pd = workflowService().processDirectory ();
      pd.removeProcess ((Process)process);
  } finally {
View Full Code Here

  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir.processMgr
    ("chabacc", "chabacc_test_sender");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      chan = workflowService.getChannel(process, "test_channel");
      WfActivity sleepAct = null;
      for (Iterator i = process.steps().iterator(); i.hasNext();) {
    sleepAct = (WfActivity)i.next ();
    if (sleepAct.name().equals("Wait")) {
        break;
    }
      }
      process.start();
      assertTrue (stateReached (sleepAct, "open.running"));
      Map pd = chan.receiveMessage();
      assertTrue ("Hello world!".equals(pd.get("message")));
      assertTrue (stateReached (process, "closed.completed"));
      procDir.removeProcess(process);
View Full Code Here

  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir.processMgr
    ("chabacc", "chabacc_test_receiver");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      chan = workflowService.getChannel(process, "test_channel");
      WfActivity recAct = null;
      for (Iterator i = process.steps().iterator(); i.hasNext();) {
    recAct = (WfActivity)i.next ();
    if (recAct.name().equals("Receive")) {
        break;
    }
      }
      assertTrue (recAct != null);
      process.start();
      assertTrue (stateReached (recAct, "open.running"));
      Thread.sleep (500);
      Map pd = new HashMap ();
      pd.put ("message", "Hello world!");
      chan.sendMessage(pd);
      assertTrue (stateReached (recAct, "closed.completed"));
      pd = process.processContext();
      assertTrue ("Hello world!".equals(pd.get("lastMessage")));
      assertTrue (stateReached (process, "closed.completed"));
      procDir.removeProcess(process);
  } finally {
            workflowService.release(chan);
View Full Code Here

  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir.processMgr
    ("chabacc", "chabacc_test_receiver");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      chan = workflowService.getChannel(process, "test_channel");
      Map pd = new HashMap ();
      pd.put ("message", "Hello world!");
      chan.sendMessage(pd);
      Thread.sleep (500);
      process.start();
      assertTrue (stateReached (process, "closed.completed"));
      pd = process.processContext();
      assertTrue ("Hello world!".equals(pd.get("lastMessage")));
      procDir.removeProcess(process);
  } finally {
            workflowService.release(chan);
      workflowService.release (procDefDir);
View Full Code Here

  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir.processMgr
    ("chabacc", "chabacc_test_xml_receiver");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      chan = workflowService.getChannel(process, "test_channel");
      DocumentBuilderFactory df = DocumentBuilderFactory.newInstance ();
      Document doc = df.newDocumentBuilder ().newDocument ();
      DocumentFragment frag = doc.createDocumentFragment ();
      frag.appendChild(doc.createElement ("root"));
            TransformerFactory tf = TransformerFactory.newInstance();
            Transformer t = tf.newTransformer ();
            SAXEventBufferImpl b = new SAXEventBufferImpl ();
            t.transform (new DOMSource (frag), new SAXResult(b));
            b.pack();
      Map pd = new HashMap ();
      pd.put ("message", b);
      chan.sendMessage(pd);
      Thread.sleep (500);
      process.start();
      assertTrue (stateReached (process, "closed.completed"));
            pd = process.processContext();
            Object o = pd.get("lastXMLMessage");
            assertTrue (o != null);
            assertTrue (o instanceof SAXContentBuffer);
            Node recDoc = ((SAXContentBuffer)o).toW3cDom();
            assertTrue (recDoc instanceof Document);
View Full Code Here

TOP

Related Classes of de.danet.an.workflow.omgcore.WfProcess

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.