Class OptionalFlowExecution

  • All Implemented Interfaces:
    Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<TestCondition>, SizeOfHandler, TestCondition, Serializable, Comparable

    public class OptionalFlowExecution
    extends FileExists
    Checks whether a specified file exists. If not, then the specified flow is run. After the flow finishes, the check is performed once again, whether the file exists or not.

    Valid options are:

    -D <int> (property: debugLevel)
        The greater the number the more additional info the scheme may output to 
        the console (0 = off).
        default: 0
        minimum: 0
     
    -file <adams.core.io.PlaceholderFile> (property: file)
        The file to look for.
        default: ${CWD}
     
    -invert (property: invert)
        If set to true, then the matching sense is inverted.
     
    -headless (property: headless)
        If set to true, the actor is run in headless mode without GUI components.
     
    -flow <adams.core.io.FlowFile> (property: flowFile)
        The flow to run if the file doesn't exist.
        default: ${CWD}
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_FlowFile

        protected FlowFile m_FlowFile
        the flow to run.
      • m_Headless

        protected boolean m_Headless
        whether the execution is to be headless, i.e., no GUI components.
    • Constructor Detail

      • OptionalFlowExecution

        public OptionalFlowExecution()
    • Method Detail

      • setHeadless

        public void setHeadless​(boolean value)
        Sets whether the actor is to be run in headless mode, i.e., suppressing GUI components.
        Parameters:
        value - if true then GUI components will be suppressed
      • isHeadless

        public boolean isHeadless()
        Returns whether the actor is run in headless mode.
        Returns:
        true if GUI components are suppressed
      • headlessTipText

        public String headlessTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setFlowFile

        public void setFlowFile​(FlowFile value)
        Sets the flow to run if necessary.
        Parameters:
        value - the flow file
      • getFlowFile

        public FlowFile getFlowFile()
        Returns the flow to run if necessary.
        Returns:
        the flow file
      • flowFileTipText

        public String flowFileTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui
      • performTest

        protected String performTest()
        Performs the actual testing of the condition.
        Overrides:
        performTest in class FileExists
        Returns:
        the test result, null if everything OK, otherwise the error message