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 classExternalFlow.ExecutionTypeDetermines how the flow is executed.
-
Field Summary
Fields Modifier and Type Field Description protected FlowFilem_ActorFilethe file the external flow is stored in.protected List<RunnableWithLogging>m_Asynchronousthe background processes launched.protected ExternalFlow.ExecutionTypem_ExecutionTypehow to execute the flow.protected Actorm_ExternalFlowthe external flow itself.protected booleanm_FlowFileChangedwhether the external flow file has changed.protected Booleanm_FlowFileIsVariableindicates whether a variable is attached to the external file.protected Stringm_FlowFileVariablethe variable attached to the external file.protected booleanm_HeadlessModewhether to run in headless mode.protected booleanm_NonInteractiveModewhether 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 StringactorFileTipText()Returns the tip text for this property.voidcleanUp()Cleans up after the execution has finished.voidcleanUpExternalActor()Cleans up the external actor.voiddefineOptions()Adds options to the internal list of options.protected StringdoExecute()Executes the flow item.StringexecutionTypeTipText()Returns the tip text for this property.FlowFilegetActorFile()Returns the file containing the external flow.ExternalFlow.ExecutionTypegetExecutionType()Returns how to execute the flow.booleangetHeadlessMode()Returns whether to execute the flow in headless mode.booleangetNonInteractiveMode()Returns whether to run the flow in non-interactive mode.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.StringglobalInfo()Returns a string describing the object.StringheadlessModeTipText()Returns the tip text for this property.protected voidinitialize()Initializes the members.StringnonInteractiveModeTipText()Returns the tip text for this property.voidsetActorFile(FlowFile value)Sets the file containing the external actor.voidsetExecutionType(ExternalFlow.ExecutionType value)Sets how to execute the flow.voidsetHeadlessMode(boolean value)Sets whether to execute the flow in headless mode.voidsetNonInteractiveMode(boolean value)Sets whether to run the flow in non-interactive mode.StringsetUp()Initializes the item for flow execution.StringsetUpExternalActor()Sets up the external actor.voidstopExecution()Stops the execution.voidvariableChanged(VariableChangeEvent e)Gets triggered when a variable changed (added, modified, removed).voidwrapUp()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:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractActor
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractActor
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfoin interfaceActor- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin 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:
setActorFilein interfaceExternalActorFileHandler- Parameters:
value- the flow file
-
getActorFile
public FlowFile getActorFile()
Returns the file containing the external flow.- Specified by:
getActorFilein 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:
variableChangedin interfaceActor- Specified by:
variableChangedin interfaceVariableChangeListener- Overrides:
variableChangedin 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:AbstractActorInitializes the item for flow execution. Also calls the reset() method first before anything else.- Specified by:
setUpin interfaceActor- Overrides:
setUpin classAbstractActor- Returns:
- null if everything is fine, otherwise error message
- See Also:
AbstractActor.reset()
-
doExecute
protected String doExecute()
Executes the flow item.- Specified by:
doExecutein classAbstractActor- Returns:
- null if everything is fine, otherwise error message
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecutionin interfaceActor- Specified by:
stopExecutionin interfaceStoppable- Overrides:
stopExecutionin classAbstractActor
-
wrapUp
public void wrapUp()
Cleans up after the execution has finished. Graphical output is left untouched.- Specified by:
wrapUpin interfaceActor- Overrides:
wrapUpin classAbstractActor
-
cleanUp
public void cleanUp()
Cleans up after the execution has finished.- Specified by:
cleanUpin interfaceActor- Specified by:
cleanUpin interfaceCleanUpHandler- Overrides:
cleanUpin classAbstractActor
-
-