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

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


      else
      {
        String regionStr = (String) regionId;
        String paramName = null;
        DataTypeItem paramType = null;
        ProcessVariable processVariable = null;

        if (regionStr.startsWith(REGION_PARAM_BY_TYPE))
        {
          paramType = (DataTypeItem) data.getTransferData(ClientFlavors.TYPE_ITEM);
          paramName = paramType.getName();
        }
        else if (regionStr.startsWith(REGION_PARAM_BY_VARIABLE))
        {
          processVariable = (ProcessVariable) data.getTransferData(ClientFlavors.PROCESS_VARIABLE);
          paramType = processVariable.getDataType();
          paramName = processVariable.getName();
          if (socket.getParamByName(paramName) != null)
          {
            String msg = "The socket already has a parameter named '" + paramName
              + "'.\nPlease connect the process variable to the existing parameter.";
            JMsgBox.show(null, msg, JMsgBox.ICON_ERROR);
View Full Code Here


    if (variables != null)
    {
      int n = variables.size();
      for (int i = 0; i < n; ++i)
      {
        ProcessVariable param = (ProcessVariable) variables.get(i);

        boolean isPersistent = param.isPersistentVariable();
        context.createProcessVariable(param.getName(), isPersistent);
      }
    }
  }
View Full Code Here

    if (variables != null)
    {
      int n = variables.size();
      for (int i = 0; i < n; ++i)
      {
        ProcessVariable param = (ProcessVariable) variables.get(i);

        int paramScope = param.getScope();
        if (scope == ProcessVariable.SCOPE_PROCESS && paramScope == ProcessVariable.SCOPE_PROCESS)
        {
          // We found a process-local parameter, remove it from the token context
          context.removeProcessVariableValue(param.getName());
        }
      }
    }
  }
View Full Code Here

  public static void setParamValue(TokenContext token, Param param, Object value)
  {
    if (param instanceof ProcessVariable)
    {
      TokenContext context = token;
      ProcessVariable pv = (ProcessVariable) param;
      if (pv.isRootContextVariable())
      {
        context = TokenContextUtil.getRootContext(token);
      }
      context.setProcessVariableValue(param.getName(), value);
    }
View Full Code Here

    ProcessItem process = param.getProcess();

    for (Iterator itVar = process.getProcessVariables(); itVar.hasNext();)
    {
      ProcessVariable global = (ProcessVariable) itVar.next();

      for (Iterator itLink = global.getDataLinks(); itLink.hasNext();)
      {
        DataLink link = (DataLink) itLink.next();

        Param targetParam = link.getTargetParam();
        if (targetParam == param)
        {
          // We found a global that is connected to this parameter, execute the link
          executeDataLink(link);
          foundLink = true;
        }
      }
    }

    if (! foundLink)
    {
      // Try process variable auto-assignment
      ProcessVariable var = process.getProcessVariableByName(param.getName());
      if (var != null)
      {
        if (var.isAutoAssign())
        {
          Object value = context.getProcessVariableValue(param.getName());
          TokenContextUtil.setParamValue(context, param, value);
        }
      }
View Full Code Here

    }

    if (! foundDataLink)
    {
      // Try process variable auto-assignment
      ProcessVariable var = sourceParam.getProcess().getProcessVariableByName(sourceParam.getName());
      if (var != null)
      {
        if (var.isAutoAssign())
        {
          Object value = TokenContextUtil.getParamValue(context, sourceParam);
          context.setProcessVariableValue(sourceParam.getName(), value);
        }
      }
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

   * Creates a process variable and assigns a unique name to it to.
   * @return The new process variable
   */
  public ProcessVariable createProcessVariableListElement()
  {
    ProcessVariable param = new ProcessVariableImpl();

    // Create a unique id and attach the global to the process
    String name = NamedObjectCollectionUtil.createUniqueId(processVariableList, "ProcessVariable");
    param.setName(name);
    param.setProcess(process);

    // Assign it the Object type
    try
    {
      DataTypeItem type = (DataTypeItem) ModelConnector.getInstance().getModelByQualifier(CoreConstants.SYSTEM_MODEL_QUALIFIER).getItem("Object", ItemTypes.TYPE, false);
      param.setDataType(type);
      param.setTypeName("Object");
    }
    catch (ModelException e)
    {
      // Never happens
    }
View Full Code Here

      if (processVariableFigure == null)
      {
        // Drag of process variables onto a node param will create a process variable link
        try
        {
          ProcessVariable processVariable = (ProcessVariable) data.getTransferData(ClientFlavors.PROCESS_VARIABLE);

          int flags = DataLink.LINK_AUTOCONVERSION;
          if (mouseEvent != null && mouseEvent.isShiftDown())
          {
            flags = DataLink.LINK_OMIT_TYPE_CHECK;
View Full Code Here

    try
    {
      if (data.isDataFlavorSupported(ClientFlavors.PROCESS_VARIABLE))
      {
        // Drag of process variables onto a node param will create a process variable link
        ProcessVariable processVariable = (ProcessVariable) data.getTransferData(ClientFlavors.PROCESS_VARIABLE);

        getDrawing().getEditor().startUndo("Add Global Link");

        DataLink dataLink = getDrawing().getProcess().createDataLink();
View Full Code Here

TOP

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

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.