weka.knowledgeflow.steps

## Class ExecuteProcess

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

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

      @KFStep(name="ExecuteProcess",
              category="Tools",
              toolTipText="Execute either static or dynamic processes. Dynamic processes can have commands, arguments and working directories specified in the values of incoming string/nominal attributes in data-based or environment connections.",
              iconPath="weka/gui/knowledgeflow/icons/ExecuteProcess.gif")
      public class ExecuteProcess
      extends BaseStep

  Knowledge Flow step that can execute static system commands or commands that are dynamically defined by the values of attributes in incoming instance or environment connections.
  Version:
    $Revision: $
  Author:
    Mark Hall (mhall{[at]}pentaho{[dot]}com)
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExecuteProcess()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getCustomEditorForStep()` Get the name of the editor dialog for this step
    `java.lang.String` | `getDynamicArgsField()` Get the name of the attribute in the incoming instance structure that contains the arguments to the command to execute
    `java.lang.String` | `getDynamicCmdField()` Get the name of the attribute in the incoming instance structure that contains the command to execute
    `java.lang.String` | `getDynamicWorkingDirField()` Get the name of the attribute in the incoming instance structure that containst the working directory for the command to execute
    `java.util.List<java.lang.String>` | `getIncomingConnectionTypes()` Get the acceptable incoming connection types at this point in time
    `java.util.List<java.lang.String>` | `getOutgoingConnectionTypes()` Get a list of possible outgoing connection types at this point in time
    `boolean` | `getRaiseExceptionOnCommandFailure()` Get to raise an exception when a command fails completely (i.e.
    `java.lang.String` | `getStaticArgs()` Get the arguments for the static command
    `java.lang.String` | `getStaticCmd()` Get the static command to be executed
    `java.lang.String` | `getStaticWorkingDir()` Get the working directory for the static command
    `boolean` | `getUseDynamic()` Get whether to execute dynamic commands
    `Instances` | `outputStructureForConnectionType(java.lang.String connectionName)` Get, if possible, the outgoing instance structure for the supplied incoming connection type
    `void` | `processIncoming(Data data)` Process an incoming Data object
    `void` | `setDynamicArgsField(java.lang.String argsField)` Set the name of the attribute in the incoming instance structure that contains the arguments to the command to execute
    `void` | `setDynamicCmdField(java.lang.String cmdField)` Set the name of the attribute in the incoming instance structure that contains the command to execute
    `void` | `setDynamicWorkingDirField(java.lang.String workingDirField)` Set the name of the attribute in the incoming instance structure that containst the working directory for the command to execute
    `void` | `setRaiseExceptionOnCommandFailure(boolean raiseExceptionOnCommandFailure)` Set to raise an exception when a command fails completely (i.e.
    `void` | `setStaticArgs(java.lang.String args)` Set the arguments for the static command
    `void` | `setStaticCmd(java.lang.String cmd)` Set the static command to be executed
    `void` | `setStaticWorkingDir(java.lang.String workingDir)` Set the working directory for the static command
    `void` | `setUseDynamic(boolean useDynamic)` Set whether to execute dynamic commands
    `void` | `start()` Start processing if operating as a start point in a flow
    `void` | `stepInit()` Initialize the step

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

      `environmentSubstitute, getDefaultSettings, getInteractiveViewers, getInteractiveViewersImpls, getName, getStepManager, globalInfo, isResourceIntensive, isStopRequested, setName, setStepIsResourceIntensive, setStepManager, setStepMustRunSingleThreaded, stepMustRunSingleThreaded, stop`

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

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

- - ### Constructor Detail

    - #### ExecuteProcess

          public ExecuteProcess()

  - ### Method Detail

    - #### getRaiseExceptionOnCommandFailure

          public boolean getRaiseExceptionOnCommandFailure()

      Get to raise an exception when a command fails completely (i.e. doesn't exist or something) vs the case of a non-zero exit status. If not raising an exception, then output indicating failure (with exist status = 1 in the case of instance connections) will be generated.
      Returns:
        true if an exception is to be generated on catastrophic command failure

    - #### setRaiseExceptionOnCommandFailure

          public void setRaiseExceptionOnCommandFailure(boolean raiseExceptionOnCommandFailure)

      Set to raise an exception when a command fails completely (i.e. doesn't exist or something) vs the case of a non-zero exit status. If not raising an exception, then output indicating failure (with exist status = 1 in the case of instance connections) will be generated.
      Parameters:
        `raiseExceptionOnCommandFailure` - if an exception is to be generated on catastrophic command failure

    - #### getUseDynamic

          public boolean getUseDynamic()

      Get whether to execute dynamic commands
      Returns:
        true if dynamic commands are to be executed

    - #### setUseDynamic

          public void setUseDynamic(boolean useDynamic)

      Set whether to execute dynamic commands
      Parameters:
        `useDynamic` - true if dynamic commands are to be executed

    - #### getStaticCmd

          public java.lang.String getStaticCmd()

      Get the static command to be executed
      Returns:
        the static command to be executed

    - #### setStaticCmd

          public void setStaticCmd(java.lang.String cmd)

      Set the static command to be executed
      Parameters:
        `cmd` - the static command to be executed

    - #### getStaticArgs

          public java.lang.String getStaticArgs()

      Get the arguments for the static command
      Returns:
        the arguments for the static command

    - #### setStaticArgs

          public void setStaticArgs(java.lang.String args)

      Set the arguments for the static command
      Parameters:
        `args` - the arguments for the static command

    - #### getStaticWorkingDir

          public java.lang.String getStaticWorkingDir()

      Get the working directory for the static command
      Returns:
        the working directory for the static command

    - #### setStaticWorkingDir

          public void setStaticWorkingDir(java.lang.String workingDir)

      Set the working directory for the static command
      Parameters:
        `workingDir` - the working directory for the static command

    - #### getDynamicCmdField

          public java.lang.String getDynamicCmdField()

      Get the name of the attribute in the incoming instance structure that contains the command to execute
      Returns:
        the name of the attribute containing the command to execute

    - #### setDynamicCmdField

          public void setDynamicCmdField(java.lang.String cmdField)

      Set the name of the attribute in the incoming instance structure that contains the command to execute
      Parameters:
        `cmdField` - the name of the attribute containing the command to execute

    - #### getDynamicArgsField

          public java.lang.String getDynamicArgsField()

      Get the name of the attribute in the incoming instance structure that contains the arguments to the command to execute
      Returns:
        the name of the attribute containing the command's arguments

    - #### setDynamicArgsField

          public void setDynamicArgsField(java.lang.String argsField)

      Set the name of the attribute in the incoming instance structure that contains the arguments to the command to execute
      Parameters:
        `argsField` - the name of the attribute containing the command's arguments

    - #### getDynamicWorkingDirField

          public java.lang.String getDynamicWorkingDirField()

      Get the name of the attribute in the incoming instance structure that containst the working directory for the command to execute
      Returns:
        the name of the attribute containing the command's working directory

    - #### setDynamicWorkingDirField

          public void setDynamicWorkingDirField(java.lang.String workingDirField)

      Set the name of the attribute in the incoming instance structure that containst the working directory for the command to execute
      Parameters:
        `workingDirField` - the name of the attribute containing the command's working directory

    - #### stepInit

          public void stepInit()
                        throws WekaException

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

    - #### start

          public void start()
                     throws WekaException

      Start processing if operating as a start point in a flow
      Specified by:
        `start` in interface `BaseStepExtender`
      Specified by:
        `start` in interface `Step`
      Overrides:
        `start` in class `BaseStep`
      Throws:
        `WekaException` - if a problem occurs

    - #### processIncoming

          public void processIncoming(Data data)
                               throws WekaException

      Process an incoming Data object
      Specified by:
        `processIncoming` in interface `BaseStepExtender`
      Specified by:
        `processIncoming` in interface `Step`
      Overrides:
        `processIncoming` in class `BaseStep`
      Parameters:
        `data` - the payload to process
      Throws:
        `WekaException` - if a problem occurs

    - #### getIncomingConnectionTypes

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

      Get the acceptable incoming connection types at this point in time
      Returns:
        a list of acceptable incoming connection types

    - #### getOutgoingConnectionTypes

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

      Get a list of possible outgoing connection types at this point in time
      Returns:
        a list of possible outgoing connection types

    - #### outputStructureForConnectionType

          public Instances outputStructureForConnectionType(java.lang.String connectionName)
                                                     throws WekaException

      Get, if possible, the outgoing instance structure for the supplied incoming connection type
      Specified by:
        `outputStructureForConnectionType` in interface `Step`
      Overrides:
        `outputStructureForConnectionType` in class `BaseStep`
      Parameters:
        `connectionName` - the name of the connection type to get the output structure for
      Returns:
        an Instances object or null if outgoing structure is not applicable or cannot be determined
      Throws:
        `WekaException` - if a problem occurs

    - #### getCustomEditorForStep

          public java.lang.String getCustomEditorForStep()

      Get the name of the editor dialog for this step
      Specified by:
        `getCustomEditorForStep` in interface `Step`
      Overrides:
        `getCustomEditorForStep` in class `BaseStep`
      Returns:
        the name of the editor dialog for this step