Package org.openbp.core.model.item.process

Examples of org.openbp.core.model.item.process.ProcessItem


    {
      Node node = (Node) nodeList.next();
      if (node instanceof SubprocessNode)
      {
        SubprocessNode subprocessNode = (SubprocessNode) node;
        ProcessItem subprocess = subprocessNode.getSubprocess();
        if (subprocess == null || !subprocess.getQualifier().matches(searchFor.getQualifier(), ModelQualifier.COMPARE_ALL))
          continue;
        NodeSocket socket = subprocessNode.getSocketByName(entry.getName());
        if (socket != null)
          foundReferences.add(socket);
      }
View Full Code Here


  public void modelUpdated(ModelQualifier qualifier, int mode)
  {
    boolean ret = false;
    if (qualifier.getItem() != null && ItemTypes.PROCESS.equals(qualifier.getItemType()))
    {
      ProcessItem process = (ProcessItem) modelMgr.getItemByQualifier(qualifier, true);
      if (process != null)
      {
        for (Enumeration en = contextMap.elements(); en.hasMoreElements();)
        {
          TokenContext context = (TokenContext) en.nextElement();
View Full Code Here

    SubprocessNode node = (SubprocessNode) entrySocket.getNode();

    // If we do not have a sub process, simply continue with the default exit socket
    NodeSocket nextSocket = node.getDefaultExitSocket();

    ProcessItem subprocess = node.getSubprocess();

    // Dynamic sub processes:
    // If we have a Process Name parameter and its value is a string...
    Object result = TokenContextUtil.getParamValue(context, entrySocket, CoreConstants.DYNAMIC_SUBPROCESS_PARAM_NAME);
    if (result != null && result instanceof String)
    {
      // ...try to lookup and return a corresponding process.
      try
      {
        subprocess = (ProcessItem) context.getExecutingModel().resolveItemRef((String) result, ItemTypes.PROCESS);
      }
      catch (ModelException re)
      {
        // Fall thru to the default.
      }
    }

    if (subprocess != null)
    {
      // The default exit socket of the initial node of the sub process
      // that has the same name as the initial node of this sub process
      // node is our initial socket for execution of the sub process.
      String entryName = entrySocket.getName();
      Node subprocessInitialNode = subprocess.getNodeByName(entryName);

      if (subprocessInitialNode == null)
      {
        String msg = LogUtil.error(getClass(), "Initial node $0 called by $1 not found in process $2. [{3}]", entryName, node.getQualifier(), subprocess.getQualifier(), context);
        throw new EngineException("InitialNodeNotFound", msg);
      }

      if (!(subprocessInitialNode instanceof InitialNode))
      {
View Full Code Here

      for (Iterator it = context.getCallStack().iterator(); it.hasNext();)
      {
        CallStackImpl.StackItem stackItem = (CallStackImpl.StackItem) it.next();
        stackItem.resolveNodeSocket(modelMgr);

        ProcessItem process = stackItem.getNodeSocket().getProcess();
        EngineUtil.createProcessVariables(process, context);
      }
    }
  }
View Full Code Here

      String msg = LogUtil.error(getClass(), "Position reference $0 requires a model specification or the executing model to be set. [{1}]", ref, context);
      throw new ModelException("NoDefaultProcess", msg);
    }

    // Absolute reference: The process specification was given in the start reference
    ProcessItem process;
    if (processName != null)
    {
      // Resolve the process reference
      process = (ProcessItem) processModel.resolveItemRef(processName, ItemTypes.PROCESS);
    }
    else
    {
      // Use the model's default process
      process = processModel.getDefaultProcess();

      if (process == null)
      {
        String msg = LogUtil.error(getClass(), "Model $0 does not have a default process (position reference: $1). [{2}]", processModel.getQualifier(), ref, context);
        throw new ModelException("NoDefaultProcess", msg);
      }
    }

    // Get the entry socket
    Node node;
    if (entryName != null)
    {
      node = process.getNodeByName(entryName);
      if (node == null)
      {
        String msg = LogUtil.error(getClass(), "Initial node $0 not found in process $1 (position reference: $2). [{3}]", entryName, process.getQualifier(), ref, context);
        throw new ModelException("NodeNotFound", msg);
      }
    }
    else
    {
      node = process.getDefaultInitialNode();
      if (node == null)
      {
        String msg = LogUtil.error(getClass(), "Process $0 does not have a default initial node (position reference: $1). [{2}]", process.getQualifier(), ref, context);
        throw new ModelException("NoDefaultNode", msg);
      }
    }

    if (! (node instanceof InitialNode))
View Full Code Here

  {
    List foundModelObjects = new ArrayList();
    Iterator processes = model.getItems(ItemTypes.PROCESS);
    while (processes.hasNext())
    {
      ProcessItem process = (ProcessItem) processes.next();
      Iterator nodes = process.getNodes();
      while (nodes.hasNext())
      {
        Node node = (Node) nodes.next();
        List modelObjects = findModelObjectInNode(node, mo);
        if (modelObjects.size() != 0)
View Full Code Here

  {
    for (int i = stackItems.size() - 1; i >= 0; --i)
    {
      StackItem stackItem = (StackItem) stackItems.get(i);

      ProcessItem process = stackItem.getNodeSocket().getProcess();
      if (process == processToSearch)
        return true;
    }

    return false;
View Full Code Here

  {
    for (int i = stackItems.size() - 1; i >= 0; --i)
    {
      StackItem stackItem = (StackItem) stackItems.get(i);

      ProcessItem process = stackItem.getNodeSocket().getProcess();
      ProcessVariable var = process.getProcessVariableByName(name);
      if (var != null)
        return var;
    }

    return null;
View Full Code Here

      return;

    // First, clear the process variables of the current process
    if (tokenContext.getCurrentSocket() != null)
    {
      ProcessItem process = tokenContext.getCurrentSocket().getProcess();
      clearProcessVariables(process, size - 1);
    }

    // Clear the process variables of all processes of the stack items that are purged.
    // Do not include the last one, this holds our current position.
    for (int i = size - 1; i > newSize + 1; --i)
    {
      // Remove all process variables local to this process
      StackItem stackItem = (StackItem) stackItems.get(i);
      ProcessItem process = stackItem.getNodeSocket().getProcess();
      clearProcessVariables(process, i - 1);
    }

    // Basically we just set the size of the stack item vector here.
    if (newSize < 0)
View Full Code Here

  {
    for (int i = maxLevel; i >= 0; --i)
    {
      // Remove all process variables local to this process
      StackItem stackItem = (StackItem) stackItems.get(i);
      ProcessItem process = stackItem.getNodeSocket().getProcess();

      if (process == processToClear)
        // This process is still referenced in the call stack, so do nothing
        return;
    }
View Full Code Here

TOP

Related Classes of org.openbp.core.model.item.process.ProcessItem

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.