Package org.openbp.core.engine

Examples of org.openbp.core.engine.EngineException


    NodeSocket initialSocket = ((InitialNode) node).getSocket();

    if (! initialSocket.hasControlLinks())
    {
      String msg = LogUtil.error(getClass(), "There are no control links attached to socket $0. [{1}]", initialSocket.getQualifier().toUntypedString(), context);
      throw new EngineException("NoControlLink", msg);
    }

    return initialSocket;
  }
View Full Code Here


      // The user either tries to access the application using a relative request
      // or the session context has timed out.

      // Log and create an exception
      String msg = LogUtil.error(getClass(), "Session does not have a current position or session has expired for socket reference $0. [{1}]", ref, context);
      throw new EngineException("NoCurrentPosition", msg);
    }

    // Try to determine the socket to start with using the usual socket search strategy
    if (ref != null)
    {
      Node currentNode = currentSocket.getNode();
      String socketName;

      int index = ref.indexOf(ModelQualifier.OBJECT_DELIMITER_CHAR);
      if (index >= 0)
      {
        // "Node.Socket"
        String nodeName = ref.substring (0, index);
        socketName = ref.substring(index + 1);

        currentNode = currentSocket.getProcess().getNodeByName(nodeName);
        if (currentNode == null)
        {
          String msg = LogUtil.error(getClass(), "Initial node $0 not found (position reference: $1). [{2}]", nodeName, ref, context);
          throw new ModelException("NodeNotFound", msg);
        }
        if (! (currentNode instanceof InitialNode))
        {
          String msg = LogUtil.error(getClass(), "Node $0 is not an initial node (position reference: $1). [{2}]", currentNode.getQualifier(), ref, context);
          throw new ModelException("NoInitialNode", msg);
        }
      }
      else if (index == 0)
      {
        // ".Socket"
        socketName = ref.substring(1);
      }
      else
      {
        // "Socket"
        socketName = ref;
      }

      startSocket = currentNode.getSocketByName(socketName);
      if (startSocket == null)
      {
        if (mustExist)
        {
          String msg = LogUtil.error(getClass(), "Exit socket $0 not found. [{1}]", socketName, context);
          throw new EngineException("NoExitSocket", msg);
        }
      }
    }
    else
    {
View Full Code Here

          }
          else
          {
            // Otherwise we consider the object to be transient and just save it by regular serialization
            String msg = LogUtil.error(PersistenceContextObjectSerializer.class, "Canot serialize object of type $0 (key $1) as transient object due to missing object id.", object.getClass().getName(), key);
            throw new EngineException("ContextSerialization", msg);
          }
        }
      }
    }
View Full Code Here

      PersistenceContext pc = pcp.obtainPersistenceContext();
      if (pc == null)
      {
        String msg = LogUtil.error(PersistenceContextObjectSerializer.class, "Error obtaining persistence context for deserialization of a persistent object of type $0 (id: $1, variable: $2). [{3}]", cls.getName(), id, key, context);
        throw new EngineException("ContextDeserialization", msg);
      }

      Object loaded = pc.findById(id, cls);
      if (loaded == null)
      {
        String msg = LogUtil.error(PersistenceContextObjectSerializer.class, "Persistent object of type $0 not found when deserializing token (id: $1, variable: $2). [{3}]", cls.getName(), id, key, context);
        throw new EngineException("ContextDeserialization", msg);
      }

      ret = loaded;
    }
View Full Code Here

      }
    }
    catch (CloneNotSupportedException e)
    {
      String msg = LogUtil.error(getClass(), "Error cloning token. [{0}]", memContext, e);
      throw new EngineException("NoDefaultExitSocket", msg);
    }
    if (rollbackDataBehavior == RollbackDataBehavior.UPDATE_VARIABLES || rollbackDataBehavior == RollbackDataBehavior.ADD_VARIABLES)
    {
      memProcessVariables = copyProcessVariables(memContext, engine.getPersistenceContextProvider());
    }
View Full Code Here

            value = CopyUtil.copyObject(value, Copyable.COPY_DEEP, null);
          }
          catch (CloneNotSupportedException e)
          {
            String msg = LogUtil.error(getClass(), "Error cloning process variable $0 (value: $1). [{2}]", varName, value, context, e);
            throw new EngineException("NoDefaultExitSocket", msg);
          }
        }
      }

      map.put(varName, value);
View Full Code Here

   * @param stackItem Item to push
   */
  private void push(CallStackItem stackItem)
  {
    if (stackItems.size() >= MAX_CALL_STACK_SIZE)
      throw new EngineException("MaximumStackSizeExceeded", "Maximum call stack size "
        + new Integer(MAX_CALL_STACK_SIZE)
        + " has been exceeded. An infinite sub process recursion is likely to be the cause.");

    if (LogUtil.isDebugEnabled(getClass()))
    {
View Full Code Here

  public CallStackItem pop()
  {
    // In case of an empty stack, we need to throw an exception...
    int size = stackItems.size();
    if (size == 0)
      throw new EngineException("EmptyCallStack", "The call stack is empty");

    // Get the last stack item.
    StackItem stackItem = (StackItem) stackItems.get(size - 1);

    // Pop the stack
View Full Code Here

      nextSocket = hc.getNextSocket();
      if (nextSocket == null)
      {
        String msg = LogUtil.error(getClass(), "Handler of node $0 has set a null next socket. [{1}]", node.getQualifier(), context);
        throw new EngineException("MissingNextSocket", msg);
      }
    }
    else
    {
      // No handler present, try the default socket
      if (nextSocket != null)
      {
        LogUtil.warn(getClass(), "No activity handler defined for activity node $0, using default exit socket $1.", node.getQualifier(), nextSocket.getName());
      }
      else
      {
        String msg = LogUtil.error(getClass(), "No activity handler found for activity node $0 and no default socket present. [{1}]", node.getQualifier(), context);
        throw new EngineException("NoDefaultExitSocket", msg);
      }
    }

    context.setCurrentSocket(nextSocket);
  }
View Full Code Here

      throw e;
    }
    catch (Throwable t)
    {
      String msg = LogUtil.error(getClass(), "Error executing visual $0. [{1}]", visual.getName(), t, context);
      throw new EngineException("VisualExecutionFailed", msg, t);
    }

    context.setCurrentSocket(nextSocket);
  }
View Full Code Here

TOP

Related Classes of org.openbp.core.engine.EngineException

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.