Package 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 Description ExecuteProcess()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetCustomEditorForStep()Get the name of the editor dialog for this stepjava.lang.StringgetDynamicArgsField()Get the name of the attribute in the incoming instance structure that contains the arguments to the command to executejava.lang.StringgetDynamicCmdField()Get the name of the attribute in the incoming instance structure that contains the command to executejava.lang.StringgetDynamicWorkingDirField()Get the name of the attribute in the incoming instance structure that containst the working directory for the command to executejava.util.List<java.lang.String>getIncomingConnectionTypes()Get the acceptable incoming connection types at this point in timejava.util.List<java.lang.String>getOutgoingConnectionTypes()Get a list of possible outgoing connection types at this point in timebooleangetRaiseExceptionOnCommandFailure()Get to raise an exception when a command fails completely (i.e.java.lang.StringgetStaticArgs()Get the arguments for the static commandjava.lang.StringgetStaticCmd()Get the static command to be executedjava.lang.StringgetStaticWorkingDir()Get the working directory for the static commandbooleangetUseDynamic()Get whether to execute dynamic commandsInstancesoutputStructureForConnectionType(java.lang.String connectionName)Get, if possible, the outgoing instance structure for the supplied incoming connection typevoidprocessIncoming(Data data)Process an incoming Data objectvoidsetDynamicArgsField(java.lang.String argsField)Set the name of the attribute in the incoming instance structure that contains the arguments to the command to executevoidsetDynamicCmdField(java.lang.String cmdField)Set the name of the attribute in the incoming instance structure that contains the command to executevoidsetDynamicWorkingDirField(java.lang.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(java.lang.String args)Set the arguments for the static commandvoidsetStaticCmd(java.lang.String cmd)Set the static command to be executedvoidsetStaticWorkingDir(java.lang.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 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
-
-
-
-
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 WekaExceptionInitialize the step- Throws:
WekaException- if a problem occurs
-
start
public void start() throws WekaExceptionStart 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
public void processIncoming(Data data) throws WekaException
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
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:
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
public java.lang.String 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
-
-