weka.knowledgeflow.steps

## Class SetVariables

- java.lang.Object
- - weka.knowledgeflow.steps.BaseStep
  - - weka.knowledgeflow.steps.SetVariables

- All Implemented Interfaces:
    java.io.Serializable, BaseStepExtender, Step

      @KFStep(name="SetVariables",
              category="Flow",
              toolTipText="Assign default values for variables if they are not already set",
              iconPath="weka/gui/knowledgeflow/icons/DiamondPlain.gif")
      public class SetVariables
      extends BaseStep

  Step that can be used to set the values of environment variables for the flow being executed. Can be useful when testing flows that use environment variables (that would typically have values set appropriately at runtime in a production setting). This step is special in the sense the the Knowledge Flow checks for it and invokes its stepInit() method (thus setting variables) before initializing all other steps in the flow. This step does not accept any connections, nor does it produce any data. Just placing one in your flow is sufficient to ensure that variables get initialized.
  Version:
    $Revision: $
  Author:
    Mark Hall (mhall{[at]}pentaho{[dot]}com)
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `SEP1` Separators for internal variable specification
    `static java.lang.String` | `SEP2`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SetVariables()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getCustomEditorForStep()` Return the fully qualified name of a custom editor component (JComponent) to use for editing the properties of the step.
    `java.util.List<java.lang.String>` | `getIncomingConnectionTypes()` Get a list of incoming connection types that this step can accept.
    `java.util.List<java.lang.String>` | `getOutgoingConnectionTypes()` Get a list of outgoing connection types that this step can produce.
    `java.lang.String` | `getVarsInternalRep()` Get the variables to set (in internal representation)
    `static java.util.Map<java.lang.String,java.lang.String>` | `internalToMap(java.lang.String internalRep)` Convert a string in the internal variable representation to a map of variables + values
    `void` | `setVarsInternalRep(java.lang.String rep)` Set the variables to set (in internal representation)
    `void` | `stepInit()` Initialize the step.

    - ### Methods inherited from class weka.knowledgeflow.steps.BaseStep

      `environmentSubstitute, getDefaultSettings, getInteractiveViewers, getInteractiveViewersImpls, getName, getStepManager, globalInfo, isResourceIntensive, isStopRequested, outputStructureForConnectionType, processIncoming, setName, setStepIsResourceIntensive, setStepManager, start, stop`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SEP1

          public static final java.lang.String SEP1

      Separators for internal variable specification
      See Also:
        Constant Field Values

    - #### SEP2

          public static final java.lang.String SEP2

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SetVariables

          public SetVariables()

  - ### Method Detail

    - #### setVarsInternalRep

          @ProgrammaticProperty
          public void setVarsInternalRep(java.lang.String rep)

      Set the variables to set (in internal representation)
      Parameters:
        `rep` - the variables to set

    - #### getVarsInternalRep

          public java.lang.String getVarsInternalRep()

      Get the variables to set (in internal representation)
      Returns:
        the variables to set

    - #### stepInit

          public void stepInit()
                        throws WekaException

      Initialize the step.
      Throws:
        `WekaException` - if a problem occurs during initialization

    - #### getIncomingConnectionTypes

          public java.util.List<java.lang.String> getIncomingConnectionTypes()

      Get a list of incoming connection types that this step can accept. Ideally (and if appropriate), this should take into account the state of the step and any existing incoming connections. E.g. a step might be able to accept one (and only one) incoming batch data connection.
      Returns:
        a list of incoming connections that this step can accept given its current state

    - #### getOutgoingConnectionTypes

          public java.util.List<java.lang.String> getOutgoingConnectionTypes()

      Get a list of outgoing connection types that this step can produce. Ideally (and if appropriate), this should take into account the state of the step and the incoming connections. E.g. depending on what incoming connection is present, a step might be able to produce a trainingSet output, a testSet output or neither, but not both.
      Returns:
        a list of outgoing connections that this step can produce

    - #### getCustomEditorForStep

          public java.lang.String getCustomEditorForStep()

      Return the fully qualified name of a custom editor component (JComponent) to use for editing the properties of the step. This method can return null, in which case the system will dynamically generate an editor using the GenericObjectEditor
      Specified by:
        `getCustomEditorForStep` in interface `Step`
      Overrides:
        `getCustomEditorForStep` in class `BaseStep`
      Returns:
        the fully qualified name of a step editor component

    - #### internalToMap

          public static java.util.Map<java.lang.String,java.lang.String> internalToMap(java.lang.String internalRep)

      Convert a string in the internal variable representation to a map of variables + values
      Parameters:
        `internalRep` - the variables in internal represenation
      Returns:
        a map of variables + values