Package de.danet.an.workflow.api

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


      return;
  }
  Object timer = ((Object[])info.state())[0];
  timerHandler().removeTimer (timer);
  ActivityUniqueKey auk = info.activityUniqueKey();
  Activity act = null;
  try {
      act = toolAgentContext().lookupActivity(auk);
  } catch (InvalidKeyException e) {
      logger.warn (auk + " is unknown, cannot cancel wait tool.");
      return;
  }
  ProcessData res = new DefaultProcessData ();
  String resParam = (String)((Object[])info.state())[1];
  res.put (resParam, "CANCELED");
  try {
      act.setResult (res);
      act.complete ();
      if (logger.isDebugEnabled ()) {
    logger.debug ("Timer application " + applId + " canceled, "
            + auk + " completed");
      }
      return;
  } catch (InvalidDataException e) {
      logger.error
    ("Cannot set \"status\" out parameter of "
     + "wait tool. Propably wrong declaration. "
     + auk + " will be terminated.");
  } catch (CannotCompleteException e) {
      logger.error ("Cannot complete " + auk
        + " (will be terminated): " + e.getMessage ());
  }
  if (act.typedState().workflowState() == State.OPEN) {
      try {
    act.terminate ();
      } catch (CannotStopException e) {
    logger.error
        ("Cannot terminate " + auk + ": " + e.getMessage ());
      } catch (NotRunningException e) {
    logger.debug (auk + " not running although state is open?");
View Full Code Here


                    fc.getApplication().getVariableResolver()
                    .resolveVariable(fc, "workflowServiceConnection"))
                    .getWorkflowService();
            List actList = new ArrayList();
            for (Iterator i = process().steps().iterator(); i.hasNext();) {
                Activity act = (Activity)i.next();
                actList.add(new ActivityWrapper(wfs, act));
            }
            activitySorter.sort (actList);
            activities = new ListDataModel (actList);
        } else {
View Full Code Here

        lastStateTime = mir.resultAsDate(8);
    }

    private Activity activity() throws RemoteException, InvalidKeyException {
        FacesContext fc = FacesContext.getCurrentInstance();
        Activity act = (Activity)fc.getExternalContext()
            .getRequestMap().get(uniqueDispKey);
        if (act == null) {
            WorkflowService wfs = WorkflowServiceConnection
                .instance("workflowServiceConnection").getWorkflowService();
            act = wfs.processDirectory().lookupActivity(info.uniqueKey());
View Full Code Here

            if (deadlineInfos[i].getExceptionName().equals(exception)) {
                dl = deadlineInfos[i];
                break;
            }
        }
        Activity activity = null;
        try {
            activity = activity();
        } catch (InvalidKeyException e) {
            // TODO:
        }
View Full Code Here

      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")) {
        break;
    }
      }
      Iterator subs = act.performers().iterator ();
      assertTrue (subs.hasNext ());
      Process sub = (Process)subs.next ();
       procDir.removeProcess(sub);
       procDir.removeProcess(process);
  } finally {
View Full Code Here

            ProcessMgr pmgr = procDefDir
                .processMgr ("ExceptionTests", "suspendMapping");
            WfProcess process
                = pmgr.createProcess(new DefaultRequester (workflowService));
            process.start();
            Activity toolAct = null;
            for (Iterator i = process.steps().iterator(); i.hasNext();) {
                Activity act = (Activity)i.next();
                if (act.name().equals("Get stock quote")) {
                    toolAct = act;
                    break;
                }
            }
            assertTrue(toolAct != null);
            stateReached(toolAct, "open.not_running.suspended.abandoning");
            toolAct.resume();
            assertTrue (stateReached (process, "closed.completed"));
            boolean found = false;
            for (Iterator i = process.steps().iterator(); i.hasNext();) {
                WfActivity act = (WfActivity)i.next ();
                if (act.name().equals("Generic")) {
                    found = true;
                    assertTrue (act.state().startsWith("closed.completed"));
                }
            }
            assertTrue (found);
            procDir.removeProcess(process);
        } finally {
View Full Code Here

            ProcessMgr pmgr = procDefDir
                .processMgr ("ExceptionTests", "suspendMapping");
            WfProcess process
                = pmgr.createProcess(new DefaultRequester (workflowService));
            process.start();
            Activity toolAct = null;
            for (Iterator i = process.steps().iterator(); i.hasNext();) {
                Activity act = (Activity)i.next();
                if (act.name().equals("Get stock quote")) {
                    toolAct = act;
                    break;
                }
            }
            assertTrue(toolAct != null);
            stateReached(toolAct, "open.not_running.suspended.abandoning");
            toolAct.changeState("open.not_running.suspended.clearing_exception");
            toolAct.resume();
            assertTrue (stateReached (process, "closed.completed"));
            boolean found = false;
            for (Iterator i = process.steps().iterator(); i.hasNext();) {
                WfActivity act = (WfActivity)i.next ();
                if (act.name().equals("Generic")) {
                    found = true;
                    assertTrue (act.state().startsWith("open.not_running.not_started"));
                }
            }
            assertTrue (found);
            found = false;
            for (Iterator i = process.steps().iterator(); i.hasNext();) {
                WfActivity act = (WfActivity)i.next ();
                if (act.name().equals("Normal")) {
                    found = true;
                    assertTrue (act.state().startsWith("closed.completed"));
                }
            }
            assertTrue (found);
            procDir.removeProcess(process);
        } finally {
View Full Code Here

      ("Cannot obtain message id: " + ee.getMessage ());
    }
    logger.debug ("Handling redelivered message " + msgId);
      }
      Map args = new HashMap((Map)((ObjectMessage)message).getObject());
            Activity act = ActivityProxy.wrap
                ((ActivityUniqueKey)args.get("activityUniqueKey"));
      args.put ("activity", act);
      args.remove("activityUniqueKey");
      ExtApplication appl = (ExtApplication)args.get("appl");
      Map params = (Map)args.get("params");
View Full Code Here

    } else {
        if (resVal instanceof ExceptionResult) {
      ((ExtActivity)act).abandon((ExceptionResult)resVal);
        } else {
            if (act instanceof ActivityProxy) {
                Activity aun = ((ActivityProxy)act).unwrap();
                aun.setResult(new DefaultProcessData ((Map)resVal));
                aun.complete ();
            }
        }
    }
      }
           if (RequestLog.isEnabled()) {
View Full Code Here

        Collection assignments = new ArrayList ();
        Collection infos = applicationDirectory()
            .infosByResource(APPLICATION_NAME, resource.resourceKey());
        for (Iterator i = infos.iterator(); i.hasNext();) {
            SimpleApplicationInfo info = (SimpleApplicationInfo)i.next();
            Activity activity = null;
            try {
                activity = pd.lookupActivity(info.activityUniqueKey());
                assignments.add (new AssignmentData (resource, info, activity));
            } catch (InvalidKeyException e) {
                logger.warn("Assignment for no longer existing activity, "
View Full Code Here

TOP

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

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.