Package de.danet.an.workflow.api

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


     * (automatically) removing.
     * @exception Exception if an error occurs
     */
    public void complexSubflow() throws Exception {
  importProcessDefinition("/process/complexSubflow.xml");
  ProcessMgr mgr = defDir.processMgr("SystemTest", "complexSub");
  //WfProcess proc = mgr.createProcess(requester);
  WrappedProcess proc = new WrappedProcess(mgr.createProcess(requester));
  proc.start();
  // Wait for completion
  assertTrue(stateReached(proc, "closed.completed"));
  ProcessData data = proc.processContext();
  assertTrue(((String)data.get("sub1Completed"))
View Full Code Here


     * Test synchronous deadline execution. Explicit named exception are
     * tested as well as default exception if no match is found.
     * @exception Exception if an error occurs
     */
    public void timeoutSynchr() throws Exception {
  ProcessMgr mgr = defDir.processMgr("SystemTest", "timeoutSynchr");
  WfProcess proc = mgr.createProcess(requester);
  String procKey = proc.key();
  proc.start();
  assertTrue(stateReached(proc, "closed.completed"));
  ProcessData data = proc.processContext();
  String path = (String)data.get("TransitionPath");
  assertTrue(path, path.equals("PATH:act1:act2:to"));
  procDir.removeProcess(proc);

  mgr = defDir.processMgr("SystemTest", "timeoutSynchrDefault");
  proc = mgr.createProcess(requester);
  procKey = proc.key();
  proc.start();
  assertTrue(stateReached(proc, "closed.completed"));
  data = proc.processContext();
  path = (String)data.get("TransitionPath");
View Full Code Here

    /**
     * Test asynchronous deadline execution.
     * @exception Exception if an error occurs
     */
    public void timeoutASynchr() throws Exception {
  ProcessMgr mgr = defDir.processMgr("SystemTest", "timeoutASynchr");
  WfProcess proc = mgr.createProcess(requester);
  String procKey = proc.key();
  proc.start();
  assertTrue(stateReached(proc, "closed.completed"));
  ProcessData data = proc.processContext();
  String path = (String)data.get("TransitionPath");
View Full Code Here

    /**
     * Test deadline execution in combination with loops.
     * @exception Exception if an error occurs
     */
    public void timeoutLoop() throws Exception {
  ProcessMgr mgr = defDir.processMgr("SystemTest", "timeoutLoop");
  WfProcess proc = mgr.createProcess(requester);
  String procKey = proc.key();
  proc.start();
  assertTrue(stateReached(proc, "closed.completed"));
  ProcessData data = proc.processContext();
  String path = (String)data.get("TransitionPath");
View Full Code Here

     * Test deadline execution in combination with suspension of
     * activities and/or the process.
     * @exception Exception if an error occurs
     */
    public void timeoutSuspend() throws Exception {
  ProcessMgr mgr = defDir.processMgr("SystemTest", "suspendStartMan");
  WfProcess proc = mgr.createProcess(requester);
  String procKey = proc.key();
  proc.start();
  assertTrue(stateReached(proc, "closed.completed"));
  ProcessData data = proc.processContext();
  String path = (String)data.get("TransitionPath");
  assertTrue(path,
       path.equals("PATH:start:t1:t2:end"));
  procDir.removeProcess(proc);

  mgr = defDir.processMgr("SystemTest", "suspendEndMan");
  proc = mgr.createProcess(requester);
  procKey = proc.key();
  proc.start();
  assertTrue(stateReached(proc, "closed.completed"));
  data = proc.processContext();
  path = (String)data.get("TransitionPath");
  assertTrue(path,
       path.equals("PATH:start:a1:t1:a2:t2:end"));
  procDir.removeProcess(proc);

  // One test case with two variants:
  // 1. activity is suspended: (deadline is triggered after resume)
  mgr = defDir.processMgr("SystemTest", "suspendAbsolute");
  proc = mgr.createProcess(requester);
  procKey = proc.key();
  proc.start();
  Activity act = null;
  Iterator i = proc.steps().iterator();
  while (i.hasNext()) {
      act = (Activity)i.next();
      if (act.name().equals("A1")) {
    break;
      }
  }
  assertTrue(act.state(), stateReached(act, "open.running"));
  Thread.sleep(1000); // allow some time to invoke first tool
  act.suspend();
  data = proc.processContext();
  path = (String)data.get("TransitionPath");
  assertTrue(path, path.equals("PATH:start:a1"));
  assertTrue(act.state(),
       stateReached(act, "open.not_running.suspended"));
  Thread.sleep(15000);
  Date timestampRes = new Date();
  act.resume();
  assertTrue(act.state(),
       stateReached(act, "closed.completed.abandoned"));
  assertTrue(stateReached(proc, "closed.completed"));
  data = proc.processContext();
  path = (String)data.get("TransitionPath");
  Date timestampTo = (Date)data.get("timestamp_to");
  assertTrue(path,
       path.equals("PATH:start:a1:t1:end"));
  assertTrue( timestampTo + ":" + timestampRes,
        timestampTo.after(timestampRes) );
  procDir.removeProcess(proc);

  // 2. whole process is suspended: (deadline is triggered before resume
  // but cannot be started until process is resumed)
  proc = mgr.createProcess(requester);
  procKey = proc.key();
  proc.start();
  act = null;
  i = proc.steps().iterator();
  while (i.hasNext()) {
View Full Code Here

    /**
     * Test deadline execution within block activity.
     * @exception Exception if an error occurs
     */
    public void timeoutBlock() throws Exception {
  ProcessMgr mgr = defDir.processMgr("SystemTest", "timeoutBlock");
  WfProcess proc = mgr.createProcess(requester);
  String procKey = proc.key();
  proc.start();
  assertTrue(stateReached(proc, "closed.completed"));
  ProcessData data = proc.processContext();
  String path = (String)data.get("TransitionPath");
View Full Code Here

    /**
     * Test deadline execution within subflows.
     * @exception Exception if an error occurs
     */
    public void timeoutSubflow() throws Exception {
  ProcessMgr mgr = defDir.processMgr("SystemTest", "timeoutSubflow");
  WfProcess proc = mgr.createProcess(requester);
  String procKey = proc.key();
  proc.start();
  assertTrue(stateReached(proc, "closed.completed"));
  ProcessData data = proc.processContext();
  String path = (String)data.get("TransitionPath");
View Full Code Here

     */
    protected Process createProcess (String pkgId, String prcId)
        throws Exception {
  ProcessDefinitionDirectory pdd
      = workflowService().processDefinitionDirectory();
  ProcessMgr pmgr = pdd.processMgr(pkgId, prcId);
  Process process = (Process) pmgr.createProcess (defaultRequester());
  return process;
    }
View Full Code Here

     * Test a soap tool invocation which returns a complex data type of JDOM
     * element.
     * @exception Exception if an error occurs
     */
    public void addressBook() throws Exception {
  ProcessMgr pmgr4 = pdd.processMgr("st-testWSIF", "testWSIF4");
  WfProcess process4 = pmgr4.createProcess(defaultRequester());
   process4.start();
  Thread.sleep(30000);
   Map map = (Map)process4.result();
  for (Iterator it2 = map.keySet().iterator(); it2.hasNext();) {
      String name = (String) it2.next();
View Full Code Here

    /**
     * Test context signature of process description.
     * @exception Exception if an error occurs
     */
    public void testInfo() throws Exception {
  ProcessMgr mgr = defDir.processMgr("SystemTest_full", "full");
  // Test context signature
  ProcessDataInfo ctxInfo = mgr.contextSignature();
  assertTrue(((Class)ctxInfo.get("packageBooleanData"))
       .isAssignableFrom(Boolean.class));
  assertTrue(((Class)ctxInfo.get("testString"))
       .isAssignableFrom(String.class));
  assertTrue(((Class)ctxInfo.get("packageIntegerData"))
       .isAssignableFrom(Long.class));
  assertTrue(((Class)ctxInfo.get("packageIntegerData"))
       .isAssignableFrom(Long.class));
  assertTrue(((Class)ctxInfo.get("packageStringData"))
       .isAssignableFrom(String.class));

  // Test result signature (all OUT or INOUT parameters)
  Iterator res = mgr.resultSignature().values().iterator();
  ProcessDataInfo resInfo = mgr.resultSignature();
  assertTrue(((Class)resInfo.get("PARAM-InOut-String"))
       .isAssignableFrom(String.class));
  assertTrue(((Class)resInfo.get("PARAM-Out-Integer"))
       .isAssignableFrom(Long.class));

  mgr = defDir.processMgr("SystemTest_minimal", "minimal");
  assertTrue(mgr.contextSignature().isEmpty());
  assertTrue(mgr.resultSignature().isEmpty());
    }
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.