Class SubProcess

    • Field Detail

      • m_OutputTokens

        protected transient List<Token> m_OutputTokens
        for storing generated output tokens.
      • m_AllowEmpty

        protected boolean m_AllowEmpty
        whether to allow no sub-actors.
    • Constructor Detail

      • SubProcess

        public SubProcess()
        Default constructor.
      • SubProcess

        public SubProcess​(String name)
        Initializes the actor with the specified name.
        Parameters:
        name - the name to use
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class Sequence
      • getOutputTokens

        protected List<Token> getOutputTokens()
        Initializes m_OutputTokens if necessary and returns it.
        Returns:
        m_OutputTokens
      • setAllowEmpty

        public void setAllowEmpty​(boolean value)
        Sets whether we can have no active sub-actors.
        Parameters:
        value - true if to allow no active sub-actors
      • getAllowEmpty

        public boolean getAllowEmpty()
        Returns whether it is possible to have no active sub-actors.
        Returns:
        true if no active sub-actors allowed
      • accepts

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Specified by:
        accepts in interface InputConsumer
        Overrides:
        accepts in class Sequence
        Returns:
        the Class of objects that can be processed
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        Specified by:
        generates in interface OutputProducer
        Returns:
        the Class of the generated tokens
      • input

        public void input​(Token token)
        The method that accepts the input token and then processes it.
        Specified by:
        input in interface InputConsumer
        Overrides:
        input in class Sequence
        Parameters:
        token - the token to accept and process
      • addOutputToken

        protected void addOutputToken​(Token output)
        Adds the given token to the list of available output tokens.
        Parameters:
        output - the token to add
        See Also:
        getOutputTokens()
      • execute

        public String execute()
        Executes the flow item.
        Specified by:
        execute in interface Actor
        Overrides:
        execute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message
      • output

        public Token output()
        Returns the generated token.
        Specified by:
        output in interface OutputProducer
        Returns:
        the generated token
      • hasPendingOutput

        public boolean hasPendingOutput()
        Checks whether there is pending output to be collected after executing the flow item.
        Specified by:
        hasPendingOutput in interface OutputProducer
        Returns:
        true if there is pending output