Class FlowJepScriptlet

  • All Implemented Interfaces:
    adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.SizeOfHandler, adams.flow.core.FlowContextHandler, Serializable

    public class FlowJepScriptlet
    extends AbstractJepScriptlet
    Encapsulates Jep/Python scripts that are run in the flow.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Script

        protected String m_Script
        the script to execute.
      • m_ScriptFile

        protected File m_ScriptFile
        the script file to execute.
      • m_ExpandVariables

        protected boolean m_ExpandVariables
        whether to expand variables.
      • m_Inputs

        protected adams.flow.control.VariableNameStorageNamePair[] m_Inputs
        the inputs.
      • m_Outputs

        protected adams.flow.control.VariableNameStorageNamePair[] m_Outputs
        the outputs.
      • m_Forwards

        protected adams.core.base.BaseString[] m_Forwards
        the forwards.
      • m_ForwardsMap

        protected Map<String,​Object> m_ForwardsMap
        the forwards map.
    • Constructor Detail

      • FlowJepScriptlet

        public FlowJepScriptlet​(String id,
                                String script)
        Initializes the scriptlet.
        Parameters:
        id - the ID of the script
        script - the script to execute
      • FlowJepScriptlet

        public FlowJepScriptlet​(String id,
                                String script,
                                adams.flow.control.VariableNameStorageNamePair[] inputs,
                                adams.flow.control.VariableNameStorageNamePair[] outputs,
                                adams.core.base.BaseString[] forwards,
                                boolean expandVars)
        Initializes the scriptlet.
        Parameters:
        id - the ID of the script
        script - the script to execute
        inputs - the inputs for the script (from storage)
        outputs - the outputs from the script (to go back into storage)
        forwards - the variable values from the script to forward as map
      • FlowJepScriptlet

        public FlowJepScriptlet​(String id,
                                File scriptFile)
        Initializes the scriptlet.
        Parameters:
        id - the ID of the script
        scriptFile - the script file to execute
      • FlowJepScriptlet

        public FlowJepScriptlet​(String id,
                                File scriptFile,
                                adams.flow.control.VariableNameStorageNamePair[] inputs,
                                adams.flow.control.VariableNameStorageNamePair[] outputs,
                                adams.core.base.BaseString[] forwards,
                                boolean expandVars)
        Initializes the scriptlet.
        Parameters:
        id - the ID of the script
        scriptFile - the script file to execute
        inputs - the inputs for the script (from storage)
        outputs - the outputs from the script (to go back into storage)
        forwards - the variable values from the script to forward as map
      • FlowJepScriptlet

        public FlowJepScriptlet​(String id,
                                String script,
                                File scriptFile,
                                adams.flow.control.VariableNameStorageNamePair[] inputs,
                                adams.flow.control.VariableNameStorageNamePair[] outputs,
                                adams.core.base.BaseString[] forwards,
                                boolean expandVars)
        Initializes the scriptlet.
        Parameters:
        id - the ID of the script
        script - the script to execute, can be null
        scriptFile - the script file to execute, can be null
        inputs - the inputs for the script (from storage)
        outputs - the outputs from the script (to go back into storage)
        forwards - the variable values from the script to forward as map
    • Method Detail

      • getScriptContent

        public String getScriptContent()
        Returns the script content.
        Returns:
        the content
      • getInputs

        public adams.flow.control.VariableNameStorageNamePair[] getInputs()
        Returns the inputs to use (objects to retrieve from storage), if any.
        Returns:
        the inputs, can be null
      • getOutputs

        public adams.flow.control.VariableNameStorageNamePair[] getOutputs()
        Returns the outputs to use (objects to store back in storage), if any.
        Returns:
        the outputs, can be null
      • getForwards

        public adams.core.base.BaseString[] getForwards()
        Returns the variables to forward.
        Returns:
        the forwards, can be null
      • getForwardsMap

        public Map<String,​Object> getForwardsMap()
        Returns the parameter values to forward as map.
        Returns:
        the map, can be null
      • getExpandVariables

        public boolean getExpandVariables()
        Returns whether ADAMS variables get expanded in the script.
        Returns:
        true if expanded