Package de.danet.an.workflow.api

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


       + "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.");
View Full Code Here


     * @exception CannotExecuteException if an error occurs
     */
    public void invoke(Activity activity, FormalParameter[] formPars, Map map)
  throws RemoteException, CannotExecuteException {
  // initialize the parameters: recipient, message, sender.
  ActivityUniqueKey auk = null;
  try {
      auk = activity.uniqueKey();
      result.set (sendMail(formPars, map));
  } catch (InvalidDataException e) {
      logger.error (e.getMessage());
View Full Code Here

     */
    public void ejbTimeout (Timer timer) {
  // Note that a RemoteException will lead to a rollback and an
  // 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) {
                logger.warn (auk + " has disappeared (doing nothing)");
                return;
            }
View Full Code Here

     * @throws RemoteException if a temporary problem occurs and the
     * workflow engine should retry the tool invocation
     */
    public void terminate (Activity activity)
  throws ApplicationNotStoppedException, RemoteException {
  ActivityUniqueKey auk = null;
  try {
      auk = activity.uniqueKey();
      SimpleApplicationInfo info
    = applicationDirectory().infoByActivity (auk);
      if (logger.isDebugEnabled()) {
View Full Code Here

     * @throws CannotExecuteException if an error occurs
     * @throws RemoteException if a system level error occurs
     */
    public void invoke(Activity activity, FormalParameter[] formPars, Map map)
  throws CannotExecuteException, RemoteException {
  ActivityUniqueKey auk = null;
  try {
      // Do not attempt to perform any operation on the activity
      // except key() and uniqueKey() before executing the
      // script. Else, the activity becomes part of the EJB
      // transaction and is locked, i.e. all accesses (even
View Full Code Here

    .initCause (e);
  }
    }

    private void readObject (ObjectInputStream in) throws IOException {
  ActivityUniqueKey auk = null;
  try {
      engine = (WorkflowEngine)((Handle)in.readObject()).getEJBObject ();
      auk = (ActivityUniqueKey)in.readObject();
      activity = engine.processDirectory().lookupActivity (auk);
  } catch (InvalidKeyException e) {
      throw (IOException)
    (new IOException ("Cannot find " + auk.toString() + ": "
          + e.getMessage ())).initCause (e);
  } catch (ClassNotFoundException e) {
      throw (IOException)
    (new IOException ("Cannot get EJB from handle: "
          + e.getMessage ())).initCause (e);
View Full Code Here

     * <code>key()</code>} method as unique within the scope of the
     * containing process only.)
     * @return value of uniqueKey.
     */
    public ActivityUniqueKey uniqueKey() {
  return new ActivityUniqueKey
      (getPaProcessMgrName(), getPaProcessKey(), getPaKey());
    }
View Full Code Here

    /* Comment copied from interface. */
    public void invoke
  (Activity activity, FormalParameter[] formalParameter, Map map)
  throws CannotExecuteException, RemoteException {
  ActivityUniqueKey auk = null;
  String channelName = null;
  try {
      auk = activity.uniqueKey();
      channelName = (String)map.get(formalParameter[0].id());
      if (logger.isDebugEnabled ()) {
View Full Code Here

         Activity activity, Object state, boolean saveAssignment) {
  try {
      Connection con = null;
      UniversalPrepStmt prepStmt = null;
      try {
    ActivityUniqueKey auk = activity.uniqueKey();
    con = ds.getConnection();
    long instId = EJBUtil.newPrimaryKey
        ("SimpleApplicationDirectory");
    prepStmt = new UniversalPrepStmt
        (ds, con, "INSERT INTO SimpleAppl (DBId, ApplName, "
         + "InstKey, ActivityKey, ProcessKey, ProcessMgr"
         + (saveAssignment ? ", ResourceKey" : "")
         + ", AssignedAt, InstData) VALUES (?, ?, ?, ?, ?, ?"
         + (saveAssignment ? ", ?" : "")
         + ", ?, ?)");
    int offset = 1;
    prepStmt.setLong (offset++, instId);
    prepStmt.setString (offset++, applName);
                prepStmt.setString (offset++, applInstKey);
    prepStmt.setString (offset++, auk.activityKey());
    prepStmt.setString (offset++, auk.processKey());
    prepStmt.setString (offset++, auk.managerName());
    if (saveAssignment) {
        String resourceKey = null;
        Iterator i = activity.assignments().iterator();
        if (i.hasNext ()) {
      WfAssignment assignment = (WfAssignment)i.next();
View Full Code Here

    String resKey = rs.getString (4);
    Date asndAt = rs.getTimestamp(5);
    Object state = JDBCUtil.getBinary(rs, 6);
    return new SimpleApplicationInfo
        (instId, actKey == null? null
         : new ActivityUniqueKey (mgrKey, prcKey, actKey),
         asndAt, resKey, state);
      } finally {
    JDBCUtil.closeAll (rs, prepStmt, con);
      }
  } catch (ClassNotFoundException e) {
View Full Code Here

TOP

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

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.