@KFStep(name="SetVariables", category="Flow", toolTipText="Assign default values for static variables, if not already set, and for dynamic variables. Static variables are guaranteed to be available to all other steps at initialization as the Knowledge Flow makes sure that SetVariables is invoked first first. Dynamic variables can have their values set using the values of attributes from incoming instances. Dynamic variables are *not* guaranteed to be available to other steps in the flow - instead, they are intended for use by a directly connected \'Job\' step, which will execute a specified sub-flow for each \'variables\' data object received.", iconPath="weka/gui/knowledgeflow/icons/SetVariables.gif") public class SetVariables extends BaseStep
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
m_dynamicInternalRep
Holds dynamic variables in internal representation
|
protected java.lang.String |
m_internalRep
Holds static variables in internal representation
|
protected boolean |
m_raiseErrorWhenValueMissing
True if an exception should be raised when an attribute value being used to
set a variable is missing, instead of using a default value
|
protected boolean |
m_structureCheckComplete
True if the structure has been checked
|
protected boolean |
m_structureOK
OK if there is at least one specified attribute in the incoming instance
structure
|
protected java.util.Map<java.lang.String,java.lang.String> |
m_varsToSet
Map of variables to set with fixed values
|
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
m_varsToSetFromIncomingInstances
Map of variables to set based on the values of attributes in incoming
instances
|
static java.lang.String |
SEP1
Separators for internal variable specification
|
static java.lang.String |
SEP2 |
static java.lang.String |
SEP3 |
m_stepIsResourceIntensive, m_stepManager, m_stepName| Constructor and Description |
|---|
SetVariables() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkStructure(Instances structure) |
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.lang.String |
getDynamicVarsInternalRep() |
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.util.List<java.lang.String>> |
internalDynamicToMap(java.lang.String internalRep) |
static java.util.Map<java.lang.String,java.lang.String> |
internalToMap(java.lang.String internalRep)
Convert a string in the internal static variable representation to a map of
variables + values
|
Instances |
outputStructureForConnectionType(java.lang.String connectionName)
If possible, get the output structure for the named connection type as a
header-only set of instances.
|
void |
processIncoming(Data data)
Process an incoming data payload (if the step accepts incoming connections)
|
protected void |
processInstance(Instance inst,
Data existingEnv) |
void |
setDynamicVarsInternalRep(java.lang.String rep) |
void |
setVarsInternalRep(java.lang.String rep)
Set the static variables to set (in internal representation)
|
void |
stepInit()
Initialize the step.
|
environmentSubstitute, getDefaultSettings, getInteractiveViewers, getInteractiveViewersImpls, getName, getStepManager, globalInfo, isResourceIntensive, isStopRequested, setName, setStepIsResourceIntensive, setStepManager, setStepMustRunSingleThreaded, start, stepMustRunSingleThreaded, stoppublic static final java.lang.String SEP1
public static final java.lang.String SEP2
public static final java.lang.String SEP3
protected java.lang.String m_internalRep
protected java.lang.String m_dynamicInternalRep
protected java.util.Map<java.lang.String,java.lang.String> m_varsToSet
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> m_varsToSetFromIncomingInstances
protected boolean m_structureOK
protected boolean m_structureCheckComplete
protected boolean m_raiseErrorWhenValueMissing
@ProgrammaticProperty public void setVarsInternalRep(java.lang.String rep)
rep - the variables to setpublic java.lang.String getVarsInternalRep()
@ProgrammaticProperty public void setDynamicVarsInternalRep(java.lang.String rep)
public java.lang.String getDynamicVarsInternalRep()
public void stepInit()
throws WekaException
WekaException - if a problem occurs during initializationpublic void processIncoming(Data data) throws WekaException
BaseStepprocessIncoming in interface BaseStepExtenderprocessIncoming in interface StepprocessIncoming in class BaseStepdata - the payload to processWekaException - if a problem occursprotected void processInstance(Instance inst, Data existingEnv) throws WekaException
WekaExceptionprotected void checkStructure(Instances structure)
public java.util.List<java.lang.String> getIncomingConnectionTypes()
public java.util.List<java.lang.String> getOutgoingConnectionTypes()
public Instances outputStructureForConnectionType(java.lang.String connectionName) throws WekaException
BaseStepoutputStructureForConnectionType in interface StepoutputStructureForConnectionType in class BaseStepconnectionName - the name of the connection type to get the output
structure forWekaException - if a problem occurspublic java.lang.String getCustomEditorForStep()
getCustomEditorForStep in interface StepgetCustomEditorForStep in class BaseSteppublic static java.util.Map<java.lang.String,java.util.List<java.lang.String>> internalDynamicToMap(java.lang.String internalRep)
public static java.util.Map<java.lang.String,java.lang.String> internalToMap(java.lang.String internalRep)
internalRep - the variables in internal represenation