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

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


          pos = Integer.parseInt(regionStr.substring(sepIndex + 1)) + 1;
        }

        getDrawing().getEditor().startUndo("Add Parameter");

        NodeParam param = socket.createParam(paramName);
        param.setDataType(paramType);

        // Add the param to the socket
        socket.addParam(param, pos - 1);
        param.maintainReferences(ModelObject.SYNC_GLOBAL_REFNAMES | ModelObject.SYNC_LOCAL_REFNAMES);

        // Add the parameter figure to the socket figure
        ParamFigure paramFigure = addParam(param, pos);

        ((WorkspaceDrawingView) getDrawing().getEditor().view()).singleSelect(paramFigure);
View Full Code Here


    TokenContext destContext)
  {
    // Iterate all parameters of the exit socket
    for (Iterator it = srcSocket.getParams(); it.hasNext();)
    {
      NodeParam srcParam = (NodeParam) it.next();

      // Copy the parameter value
      copyParamData(srcParam, srcContext, destSocket, destContext);
    }
  }
View Full Code Here

   * @param destContext Destination token context
   */
  private static void copyParamData(NodeParam srcParam, TokenContext srcContext, NodeSocket destSocket,
    TokenContext destContext)
  {
    NodeParam destParam = destSocket.getParamByName(srcParam.getName());
    if (destParam != null)
    {
      Object value = TokenContextUtil.getParamValue(srcContext, srcParam);
      TokenContextUtil.setParamValue(destContext, destParam, value);
    }
View Full Code Here

    if (paramList != null)
    {
      int nParams = paramList.size();
      for (int i = 0; i < nParams; ++i)
      {
        NodeParam param = (NodeParam) paramList.get(i);

        String expression = param.getExpression();
        if (expression != null)
        {
          // Evaluate the expression before checking the parameters
          if (ScriptUtil.isConstantExpression(expression))
          {
            // Evaluate constant expressions only if we do not yet have a parameter value
            Object value = TokenContextUtil.getParamValue(context, param);

            if (value == null)
            {
              value = ScriptUtil.getConstantExpressionValue(expression);

              if (value != null)
              {
                // Finally, we have a value. Assign it to to the parameter
                TokenContextUtil.setParamValue(context, param, value);
              }
            }
          }
          else
          {
            // Evaluate a script expression
            ScriptEngine scriptEngine = engine.getScriptEngineFactory().obtainScriptEngine(context);
            try
            {
              // Evaluate the expression
              scriptEngine.prepareNodeParamExecution(param);
              Object value = scriptEngine.executeScript(expression, "exit parameter script", param.getQualifier().toString());
              scriptEngine.finishNodeParamExecution(param);

              // Assign the result to the parameter
              TokenContextUtil.setParamValue(context, param, value);
            }
View Full Code Here

        int n = list.size();
        ret = new String[n];

        for (int i = 0; i < n; ++i)
        {
          NodeParam param = (NodeParam) list.get(i);
          ret[i] = param.getName();
        }
      }
    }
    return ret;
  }
View Full Code Here

      if (it.hasNext())
      {
        // Iterate all parameters of the exit socket
        while (it.hasNext())
        {
          NodeParam nodeParam = (NodeParam) it.next();

          bindInputParameter(context, nodeParam, inputParamValues);
        }
      }
    }
View Full Code Here

    if (socket == null)
      return;

    for (Iterator it = socket.getParams(); it.hasNext();)
    {
      NodeParam param = (NodeParam) it.next();

      Object value = TokenContextUtil.getParamValue(context, param);
      outputParamValues.put(param.getName(), value);
    }
  }
View Full Code Here

  private void fillBean(Object target, HandlerContext hc)
  {
    // Iterate all entry socket parameters
    for (Iterator params = hc.getCurrentSocket().getParams(); params.hasNext();)
    {
      NodeParam param = (NodeParam) params.next();
      String memberName = param.getName();

      if (memberName.equals(PARAM_BEAN))
      {
        // Skip the TypeName parameter
        continue;
View Full Code Here

  {
    List foundObject = new ArrayList();
    Iterator parameter = socket.getParams();
    while (parameter.hasNext())
    {
      NodeParam param = (NodeParam) parameter.next();
      DataTypeItem dataType = param.getDataType();
      addIfMatch(param, dataType, item, foundObject);
    }
    return foundObject;
  }
View Full Code Here

        LogUtil.trace(getClass(), "Continuing execution at error socket $0 after handling of exception. [{0}]", socket.getQualifier(), context, t);

        context.setCurrentSocket(socket);

        // Try to find an exception parameter at the socket we're going to start with.
        NodeParam exceptionParam = socket.getParamByName(CoreConstants.EXCEPTION_PARAM_NAME);
        if (exceptionParam != null)
        {
          // ...and set the exception to be handled.
          TokenContextUtil.setParamValue(context, exceptionParam, t);
        }
View Full Code Here

TOP

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

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.