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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the name of the editor dialog for this stepGet the name of the attribute in the incoming instance structure that contains the arguments to the command to executeGet the name of the attribute in the incoming instance structure that contains the command to executeGet the name of the attribute in the incoming instance structure that containst the working directory for the command to executeGet the acceptable incoming connection types at this point in timeGet a list of possible outgoing connection types at this point in timebooleanGet to raise an exception when a command fails completely (i.e.Get the arguments for the static commandGet the static command to be executedGet the working directory for the static commandbooleanGet whether to execute dynamic commandsoutputStructureForConnectionType(String connectionName) Get, if possible, the outgoing instance structure for the supplied incoming connection typevoidprocessIncoming(Data data) Process an incoming Data objectvoidsetDynamicArgsField(String argsField) Set the name of the attribute in the incoming instance structure that contains the arguments to the command to executevoidsetDynamicCmdField(String cmdField) Set the name of the attribute in the incoming instance structure that contains the command to executevoidsetDynamicWorkingDirField(String workingDirField) Set the name of the attribute in the incoming instance structure that containst the working directory for the command to executevoidsetRaiseExceptionOnCommandFailure(boolean raiseExceptionOnCommandFailure) Set to raise an exception when a command fails completely (i.e.voidsetStaticArgs(String args) Set the arguments for the static commandvoidsetStaticCmd(String cmd) Set the static command to be executedvoidsetStaticWorkingDir(String workingDir) Set the working directory for the static commandvoidsetUseDynamic(boolean useDynamic) Set whether to execute dynamic commandsvoidstart()Start processing if operating as a start point in a flowvoidstepInit()Initialize the stepMethods inherited from class weka.knowledgeflow.steps.BaseStep
environmentSubstitute, getDefaultSettings, getInteractiveViewers, getInteractiveViewersImpls, getName, getStepManager, globalInfo, isResourceIntensive, isStopRequested, outputStructureForConnectionType, setName, setStepIsResourceIntensive, setStepManager, setStepMustRunSingleThreaded, stepMustRunSingleThreaded, stop
-
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
Get the static command to be executed- Returns:
- the static command to be executed
-
setStaticCmd
Set the static command to be executed- Parameters:
cmd- the static command to be executed
-
getStaticArgs
Get the arguments for the static command- Returns:
- the arguments for the static command
-
setStaticArgs
Set the arguments for the static command- Parameters:
args- the arguments for the static command
-
getStaticWorkingDir
Get the working directory for the static command- Returns:
- the working directory for the static command
-
setStaticWorkingDir
Set the working directory for the static command- Parameters:
workingDir- the working directory for the static command
-
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
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
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
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
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
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
Initialize the step- Throws:
WekaException- if a problem occurs
-
start
Start processing if operating as a start point in a flow- Specified by:
startin interfaceBaseStepExtender- Specified by:
startin interfaceStep- Overrides:
startin classBaseStep- Throws:
WekaException- if a problem occurs
-
processIncoming
Process an incoming Data object- Specified by:
processIncomingin interfaceBaseStepExtender- Specified by:
processIncomingin interfaceStep- Overrides:
processIncomingin classBaseStep- Parameters:
data- the payload to process- Throws:
WekaException- if a problem occurs
-
getIncomingConnectionTypes
Get the acceptable incoming connection types at this point in time- Returns:
- a list of acceptable incoming connection types
-
getOutgoingConnectionTypes
Get a list of possible outgoing connection types at this point in time- Returns:
- a list of possible outgoing connection types
-
outputStructureForConnectionType
Get, if possible, the outgoing instance structure for the supplied incoming connection type- Specified by:
outputStructureForConnectionTypein interfaceStep- Overrides:
outputStructureForConnectionTypein classBaseStep- 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
Get the name of the editor dialog for this step- Specified by:
getCustomEditorForStepin interfaceStep- Overrides:
getCustomEditorForStepin classBaseStep- Returns:
- the name of the editor dialog for this step
-