Examples of WfProcess


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

  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

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

  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir.processMgr
    ("chabacc", "chabacc_test_send_self");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      process.start();
      assertTrue (stateReached (process, "closed.completed"));
      ProcessData pd = process.processContext();
      assertTrue ("Hello world!".equals(pd.get("lastMessage")));
      procDir.removeProcess(process);
  } finally {
      workflowService.release (procDefDir);
      workflowService.release (procDir);
View Full Code Here

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

  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir.processMgr
    ("chabacc", "chabacc_test_rec_send");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      chan = workflowService.getChannel(process, "test_channel");
      Map pd = new HashMap ();
      pd.put ("message", "Do you echo?");
      chan.sendMessage(pd);
      process.start();
      pd = chan.receiveMessage();
      assertTrue ("Got: " + pd.get("message"),
      "Do you echo?".equals(pd.get("message")));
      assertTrue (stateReached (process, "closed.completed"));
      procDir.removeProcess(process);
View Full Code Here

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

  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir.processMgr
    ("chabacc", "chabacc_test_rec_send_indirect");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      chan = workflowService.getChannel(process, "test_channel");
      Map pd = new HashMap ();
      pd.put ("message", "Do you echo?");
      chan.sendMessage(pd);
      process.start();
      pd = chan.receiveMessage();
      assertTrue ("Got: " + pd.get("message"),
      "Do you echo?".equals(pd.get("message")));
      assertTrue (stateReached (process, "closed.completed"));
      pd = process.processContext();
      assertTrue (pd.get("feedback").equals ("Got message"));
      // cleanup
      Iterator acts = process.activitiesInState("closed").iterator();
      assertTrue (acts.hasNext ());
      Activity act = null;
      while (true) {
    act = (Activity)acts.next ();
    if (act.name().equals ("Run subflow")) {
View Full Code Here

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

  try {
      procDefDir = workflowService.processDefinitionDirectory();
      procDir = workflowService.processDirectory();
      ProcessMgr pmgr = procDefDir.processMgr
    ("chabacc", "chabacc_test_close_notification");
      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      chan = workflowService.getChannel(process, "test_channel");
      process.start();
      Map pd = chan.receiveMessage();
      assertTrue (pd == null);
      assertTrue (stateReached (process, "closed.completed"));
      procDir.removeProcess(process);
  } finally {
View Full Code Here

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

     * @throws RemoteException if a system-level error occurs.
     */
    public ActivityUniqueKey (WfActivity activity)
  throws RemoteException {
  actKey = activity.key();
  WfProcess proc = activity.container();
  procKey = proc.key();
  String mgrName = proc.manager().name();
    }
View Full Code Here

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

    /**
     * Create a new process for the given type and start it.
     */
    public void createAndStartProcess1() throws Exception {
  WfRequester cont = new DefaultRequester(workflowService());
  WfProcess process = createProcess("ut-process", "jut1", cont);
  assertTrue(process.state().startsWith("open.not_running.not_started"));
  process.start();
  assertTrue(process.state().startsWith("open.running"));
  // get the activities
  Collection c = process.steps();
  Iterator it = c.iterator();
  while (it.hasNext()) {
      WfActivity a = (WfActivity)it.next();
      assertTrue(a.state() != null);
  }
View Full Code Here

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

    /**
     * Create a new process for the given type and start it.
     */
    public void createAndStartProcess2() 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();
  assertTrue(process.state().startsWith("open.running"));
  // get the activities
  Collection c = process.steps();
  Iterator it = c.iterator();
  while (it.hasNext()) {
      WfActivity a = (WfActivity)it.next();
      assertTrue(a.state() != null);
  }
View Full Code Here

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

    /**
     * Create a new process for the given type and start it.
     */
    public void createAndStartProcess3() 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(2500);
  assertTrue(process + " should be completed, is " + process.state(),
       process.state().startsWith("closed.completed"));
  // get the activities
  Collection c = process.steps();
  Iterator it = c.iterator();
  int cnt = 0;
  while (it.hasNext()) {
      WfActivity a = (WfActivity)it.next();
      if (a.state().startsWith
View Full Code Here

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

    /**
     * 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
TOP
Copyright © 2018 www.massapi.com. 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.