Package de.danet.an.workflow.tools.util

Examples of de.danet.an.workflow.tools.util.SimpleApplicationInfo


    .updateInvokingActivity (applId, activity.uniqueKey());
      if (logger.isDebugEnabled()) {
    logger.debug ("Application " + applId
            + " updated to " + activity);
      }
      SimpleApplicationInfo info
    = applicationDirectory().instanceInfo (applId);
      Object[] data = (Object[])info.state();
      data[1] = fps[1].id();
      applicationDirectory().updateState (applId, data);
      return;
  } catch (InvalidKeyException invKey) {
      if (logger.isDebugEnabled()) {
View Full Code Here


    public void terminate (Activity activity)
  throws ApplicationNotStoppedException, RemoteException {
  ActivityUniqueKey auk = null;
  try {
      auk = activity.uniqueKey();
      SimpleApplicationInfo info
    = applicationDirectory().infoByActivity (auk);
      if (logger.isDebugEnabled()) {
    logger.debug ("Terminating application " + info.id()
             + " invoked by " + auk);
      }
      applicationDirectory().removeInstance (info.id());
      timerHandler().removeTimer (((Object[])info.state())[0]);
  } catch (InvalidKeyException e) {
      // terminate is called by engine "to make sure"
      logger.debug ("Terminate called for " + auk + " but application "
        + "already removed (is OK): " + e.getMessage ());
  }
View Full Code Here

  // automatic re-invocation of this method.
  long applId = ((Long)map.get(fps[0].id())).longValue ();
  if (logger.isDebugEnabled ()) {
      logger.debug ("Cancelling timer application " + applId);
  }
  SimpleApplicationInfo info = null;
  try {
      info = applicationDirectory().instanceInfo (applId);
      applicationDirectory().removeInstance (applId);
  } catch (InvalidKeyException e) {
      logger.warn ("Timer application " + applId + " could not be "
       + "canceled because is does not exist.");
      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 ()) {
View Full Code Here

  // automatic re-invocation of this method.
  Object info = timer.getInfo();
  ActivityUniqueKey auk = null;
  String resParam = null;
  long applId = ((Long)info).longValue ();
  SimpleApplicationInfo applInfo = null;
        try {
            try {
                applInfo = applicationDirectory().instanceInfo(applId);
            } catch (InvalidKeyException e) {
                logger.warn ("Application " + applId + " removed without removing "
                        + "associated timer (may be race condition).");
                return;
            }
            auk = applInfo.activityUniqueKey();
            if (logger.isDebugEnabled ()) {
                logger.debug
                ("Handling timeout for application " + applId
                        + (auk == null ? "" : (", " + auk)));
            }
            applicationDirectory().removeInstance (applId);
            if (auk == null) {
                if (logger.isDebugEnabled ()) {
                    logger.debug ("Nothing to do for application " + applId
                            + " (no associated activity)");
                }
                return;
            }
            resParam = (String)((Object[])applInfo.state())[1];
            ActivityLocal act = null;
            try {
                Long pk = Long.valueOf (auk.activityKey());
                act = activityLocalHome().findByPrimaryKey(pk);
            } catch (FinderException nex) {
View Full Code Here

        (ProcessDirectory pd, WfResource resource) throws RemoteException {
        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, "
                            + "ignored: " + e.getMessage());
            }
View Full Code Here

        if (chosenInstanceId == null) {
            return null;
        }
        if (chosenInstance == null) {
            try {
                SimpleApplicationInfo info = applicationDirectory()
                    .instanceInfo(chosenInstanceId.longValue());
                ProcessDirectory pd
                    = wsc.getWorkflowService().processDirectory();
                Activity activity = pd.lookupActivity(info.activityUniqueKey());
                chosenInstance = new AssignmentData (null, info, activity);
            } catch (InvalidKeyException e) {
                // Must have been removed by concurrent action
                chosenInstanceId = null;
            }
View Full Code Here

            assertTrue (ad.infosByApplication("unittests.Test1").size() == 1);
            Collection infos
                = ad.infosByKey("unittests.Test1", "ToolTest");
            assertTrue (infos.size() == 1);
            SimpleApplicationInfo info
                = (SimpleApplicationInfo)infos.iterator().next();
            assertTrue (info.state() instanceof Object[]);
            WfActivity actFound = workflowService.processDirectory()
                .lookupActivity(info.activityUniqueKey());
            actFound.complete ();
            ad.removeInstance(info.id());
           
            assertTrue (stateReached (process, "closed.completed"));
      procDir.removeProcess(process);
  } finally {
      workflowService.release (procDefDir);
View Full Code Here

TOP

Related Classes of de.danet.an.workflow.tools.util.SimpleApplicationInfo

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.