Package weka.knowledgeflow.steps

# Class ExecuteProcess

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

All Implemented Interfaces:
  `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
  Description
  `ExecuteProcess()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getCustomEditorForStep()`
  Get the name of the editor dialog for this step
  `String`
  `getDynamicArgsField()`
  Get the name of the attribute in the incoming instance structure that contains the arguments to the command to execute
  `String`
  `getDynamicCmdField()`
  Get the name of the attribute in the incoming instance structure that contains the command to execute
  `String`
  `getDynamicWorkingDirField()`
  Get the name of the attribute in the incoming instance structure that containst the working directory for the command to execute
  `List<String>`
  `getIncomingConnectionTypes()`
  Get the acceptable incoming connection types at this point in time
  `List<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.
  `String`
  `getStaticArgs()`
  Get the arguments for the static command
  `String`
  `getStaticCmd()`
  Get the static command to be executed
  `String`
  `getStaticWorkingDir()`
  Get the working directory for the static command
  `boolean`
  `getUseDynamic()`
  Get whether to execute dynamic commands
  `Instances`
  `outputStructureForConnectionType(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(String argsField)`
  Set the name of the attribute in the incoming instance structure that contains the arguments to the command to execute
  `void`
  `setDynamicCmdField(String cmdField)`
  Set the name of the attribute in the incoming instance structure that contains the command to execute
  `void`
  `setDynamicWorkingDirField(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(String args)`
  Set the arguments for the static command
  `void`
  `setStaticCmd(String cmd)`
  Set the static command to be executed
  `void`
  `setStaticWorkingDir(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, outputStructureForConnectionType, setName, setStepIsResourceIntensive, setStepManager, setStepMustRunSingleThreaded, stepMustRunSingleThreaded, stop`

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

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

- ## Constructor Details

  - ### ExecuteProcess

    public ExecuteProcess()

- ## Method Details

  - ### 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 String getStaticCmd()
    Get the static command to be executed
    Returns:
      the static command to be executed

  - ### setStaticCmd

    public void setStaticCmd(String cmd)
    Set the static command to be executed
    Parameters:
      `cmd` - the static command to be executed

  - ### getStaticArgs

    public String getStaticArgs()
    Get the arguments for the static command
    Returns:
      the arguments for the static command

  - ### setStaticArgs

    public void setStaticArgs(String args)
    Set the arguments for the static command
    Parameters:
      `args` - the arguments for the static command

  - ### getStaticWorkingDir

    public String getStaticWorkingDir()
    Get the working directory for the static command
    Returns:
      the working directory for the static command

  - ### setStaticWorkingDir

    public void setStaticWorkingDir(String workingDir)
    Set the working directory for the static command
    Parameters:
      `workingDir` - the working directory for the static command

  - ### getDynamicCmdField

    public 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(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 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(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 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(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 List<String> getIncomingConnectionTypes()
    Get the acceptable incoming connection types at this point in time
    Returns:
      a list of acceptable incoming connection types

  - ### getOutgoingConnectionTypes

    public List<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(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 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