Package adams.flow.standalone
Class ExternalFlow
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.core.AbstractActor
-
- adams.flow.standalone.ExternalFlow
-
- All Implemented Interfaces:
AdditionalInformationHandler
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<Actor>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,VariablesInspectionHandler
,VariableChangeListener
,Actor
,ErrorHandler
,ExternalActorFileHandler
,Serializable
,Comparable
public class ExternalFlow extends AbstractActor implements ExternalActorFileHandler
Allows to execute a complete external Flow rather than just an external actor.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-name <java.lang.String> (property: name) The name of the actor. default: ExternalFlow
-annotation <adams.core.base.BaseAnnotation> (property: annotations) The annotations to attach to this actor. default:
-skip <boolean> (property: skip) If set to true, transformation is skipped and the input token is just forwarded as it is. default: false
-stop-flow-on-error <boolean> (property: stopFlowOnError) If set to true, the flow execution at this level gets stopped in case this actor encounters an error; the error gets propagated; useful for critical actors. default: false
-silent <boolean> (property: silent) If enabled, then no errors are output in the console; Note: the enclosing actor handler must have this enabled as well. default: false
-file <adams.core.io.FlowFile> (property: flowFile) The file containing the external flow. default: ${CWD}
-execution-type <SYNCHRONOUS|SYNCHRONOUS_IMMEDIATE_CLEANUP|ASYNCHRONOUS> (property: executionType) Determines how the flow is executed. default: SYNCHRONOUS
-headless-mode <boolean> (property: headlessMode) Whether to execute the flow in headless mode. default: false
-non-interactive-mode <boolean> (property: nonInteractiveMode) Whether to run flow in non-interactive mode (disable interactivity of actors implementing adams.flow.core.AutomatableInteraction). default: false
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExternalFlow.ExecutionType
Determines how the flow is executed.
-
Field Summary
Fields Modifier and Type Field Description protected FlowFile
m_ActorFile
the file the external flow is stored in.protected List<RunnableWithLogging>
m_Asynchronous
the background processes launched.protected ExternalFlow.ExecutionType
m_ExecutionType
how to execute the flow.protected Actor
m_ExternalFlow
the external flow itself.protected boolean
m_FlowFileChanged
whether the external flow file has changed.protected Boolean
m_FlowFileIsVariable
indicates whether a variable is attached to the external file.protected String
m_FlowFileVariable
the variable attached to the external file.protected boolean
m_HeadlessMode
whether to run in headless mode.protected boolean
m_NonInteractiveMode
whether to run in non-interactive mode.-
Fields inherited from class adams.flow.core.AbstractActor
m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_Executing, m_ExecutionListeningSupporter, m_FullName, m_LoggingPrefix, m_Name, m_Parent, m_ScopeHandler, m_Self, m_Silent, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.flow.core.Actor
FILE_EXTENSION, FILE_EXTENSION_GZ
-
-
Constructor Summary
Constructors Constructor Description ExternalFlow()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
actorFileTipText()
Returns the tip text for this property.void
cleanUp()
Cleans up after the execution has finished.void
cleanUpExternalActor()
Cleans up the external actor.void
defineOptions()
Adds options to the internal list of options.protected String
doExecute()
Executes the flow item.String
executionTypeTipText()
Returns the tip text for this property.FlowFile
getActorFile()
Returns the file containing the external flow.ExternalFlow.ExecutionType
getExecutionType()
Returns how to execute the flow.boolean
getHeadlessMode()
Returns whether to execute the flow in headless mode.boolean
getNonInteractiveMode()
Returns whether to run the flow in non-interactive mode.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.String
globalInfo()
Returns a string describing the object.String
headlessModeTipText()
Returns the tip text for this property.protected void
initialize()
Initializes the members.String
nonInteractiveModeTipText()
Returns the tip text for this property.void
setActorFile(FlowFile value)
Sets the file containing the external actor.void
setExecutionType(ExternalFlow.ExecutionType value)
Sets how to execute the flow.void
setHeadlessMode(boolean value)
Sets whether to execute the flow in headless mode.void
setNonInteractiveMode(boolean value)
Sets whether to run the flow in non-interactive mode.String
setUp()
Initializes the item for flow execution.String
setUpExternalActor()
Sets up the external actor.void
stopExecution()
Stops the execution.void
variableChanged(VariableChangeEvent e)
Gets triggered when a variable changed (added, modified, removed).void
wrapUp()
Cleans up after the execution has finished.-
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, backupState, canInspectOptions, canPerformSetUpCheck, compareTo, configureLogger, destroy, equals, execute, finalUpdateVariables, findVariables, findVariables, forceVariables, forCommandLine, forName, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, handleException, hasErrorHandler, hasStopMessage, index, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, performVariableChecks, postExecute, preExecute, pruneBackup, pruneBackup, reset, restoreState, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setVariables, shallowCopy, shallowCopy, silentTipText, sizeOf, skipTipText, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.flow.core.Actor
toCommandLine
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager
-
-
-
-
Field Detail
-
m_ActorFile
protected FlowFile m_ActorFile
the file the external flow is stored in.
-
m_ExecutionType
protected ExternalFlow.ExecutionType m_ExecutionType
how to execute the flow.
-
m_HeadlessMode
protected boolean m_HeadlessMode
whether to run in headless mode.
-
m_NonInteractiveMode
protected boolean m_NonInteractiveMode
whether to run in non-interactive mode.
-
m_ExternalFlow
protected Actor m_ExternalFlow
the external flow itself.
-
m_FlowFileIsVariable
protected Boolean m_FlowFileIsVariable
indicates whether a variable is attached to the external file.
-
m_FlowFileVariable
protected String m_FlowFileVariable
the variable attached to the external file.
-
m_FlowFileChanged
protected boolean m_FlowFileChanged
whether the external flow file has changed.
-
m_Asynchronous
protected List<RunnableWithLogging> m_Asynchronous
the background processes launched.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractActor
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractActor
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceActor
- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractActor
- Returns:
- null if no info available, otherwise short string
-
setActorFile
public void setActorFile(FlowFile value)
Sets the file containing the external actor.- Specified by:
setActorFile
in interfaceExternalActorFileHandler
- Parameters:
value
- the flow file
-
getActorFile
public FlowFile getActorFile()
Returns the file containing the external flow.- Specified by:
getActorFile
in interfaceExternalActorFileHandler
- Returns:
- the flow file
-
actorFileTipText
public String actorFileTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setExecutionType
public void setExecutionType(ExternalFlow.ExecutionType value)
Sets how to execute the flow.- Parameters:
value
- the type
-
getExecutionType
public ExternalFlow.ExecutionType getExecutionType()
Returns how to execute the flow.- Returns:
- the type
-
executionTypeTipText
public String executionTypeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setHeadlessMode
public void setHeadlessMode(boolean value)
Sets whether to execute the flow in headless mode.- Parameters:
value
- true if headless
-
getHeadlessMode
public boolean getHeadlessMode()
Returns whether to execute the flow in headless mode.- Returns:
- true if headless
-
headlessModeTipText
public String headlessModeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNonInteractiveMode
public void setNonInteractiveMode(boolean value)
Sets whether to run the flow in non-interactive mode.- Parameters:
value
- true if non-interactive
-
getNonInteractiveMode
public boolean getNonInteractiveMode()
Returns whether to run the flow in non-interactive mode.- Returns:
- true if non-interactive
-
nonInteractiveModeTipText
public String nonInteractiveModeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
variableChanged
public void variableChanged(VariableChangeEvent e)
Gets triggered when a variable changed (added, modified, removed).- Specified by:
variableChanged
in interfaceActor
- Specified by:
variableChanged
in interfaceVariableChangeListener
- Overrides:
variableChanged
in classAbstractActor
- Parameters:
e
- the event
-
setUpExternalActor
public String setUpExternalActor()
Sets up the external actor.- Returns:
- null if everything is fine, otherwise error message
-
cleanUpExternalActor
public void cleanUpExternalActor()
Cleans up the external actor.
-
setUp
public String setUp()
Description copied from class:AbstractActor
Initializes the item for flow execution. Also calls the reset() method first before anything else.- Specified by:
setUp
in interfaceActor
- Overrides:
setUp
in classAbstractActor
- Returns:
- null if everything is fine, otherwise error message
- See Also:
AbstractActor.reset()
-
doExecute
protected String doExecute()
Executes the flow item.- Specified by:
doExecute
in classAbstractActor
- Returns:
- null if everything is fine, otherwise error message
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecution
in interfaceActor
- Specified by:
stopExecution
in interfaceStoppable
- Overrides:
stopExecution
in classAbstractActor
-
wrapUp
public void wrapUp()
Cleans up after the execution has finished. Graphical output is left untouched.- Specified by:
wrapUp
in interfaceActor
- Overrides:
wrapUp
in classAbstractActor
-
cleanUp
public void cleanUp()
Cleans up after the execution has finished.- Specified by:
cleanUp
in interfaceActor
- Specified by:
cleanUp
in interfaceCleanUpHandler
- Overrides:
cleanUp
in classAbstractActor
-
-