Class BranchingComponent

    • Field Detail

      • branchingConfig

        protected BranchingConfig branchingConfig
        The configuration
      • value

        public java.lang.Object value
        The return value from script execution
    • Constructor Detail

      • BranchingComponent

        public BranchingComponent()
        Constructor.
      • BranchingComponent

        public BranchingComponent​(AssemblyLine parent,
                                  java.lang.String name,
                                  BranchingConfig config)
                           throws java.lang.Exception
        Constructor for the BranchingComponent object
        Parameters:
        parent - The AssemblyLine that contains this BranchingComponent
        name - The name of this BranchingComponent
        config - The configuration for this BranchingComponent
        Throws:
        java.lang.Exception - if problem occurs
    • Method Detail

      • initialize

        public void initialize()
                        throws java.lang.Exception
        Initializes the component.
        Overrides:
        initialize in class AssemblyLineComponent
        Throws:
        java.lang.Exception - Not really, but subclasses may throw Exceptions
      • close

        public void close()
                   throws java.lang.Exception
        This method closes the script engine.
        Overrides:
        close in class AssemblyLineComponent
        Throws:
        java.lang.Exception - if problem occurs
      • getType

        public int getType()
        Gets the type attribute of the BranchingComponent object
        Overrides:
        getType in class AssemblyLineComponent
        Returns:
        ServerConstants.TYPE_BRANCH
      • willExecute

        public boolean willExecute​(Entry work)
                            throws java.lang.Exception
        Return true or false, depending on what the expression in the branch evaluates to This method is called by the AssemblyLine.
        Overrides:
        willExecute in class AssemblyLineComponent
        Parameters:
        work - The work Entry
        Returns:
        The boolean value of the expression
        Throws:
        java.lang.Exception - Any Exception that might be thrown
      • checkWillExecute

        public boolean checkWillExecute​(Entry work)
                                 throws java.lang.Exception
        Evaluates the expression in this branch
        Parameters:
        work - The work Entry
        Returns:
        The boolean value of the expression
        Throws:
        java.lang.Exception - Any Exception that might be thrown during script execution
      • evaluateConditions

        public boolean evaluateConditions​(Entry work)
                                   throws java.lang.Exception
        Returns the result of the test conditions
        Parameters:
        work - The work Entry
        Returns:
        The evaluation of the simple test conditions *
        Throws:
        java.lang.Exception - if problem occurs
      • evaluateCondition

        public boolean evaluateCondition​(Entry work,
                                         BranchCondition c,
                                         int index)
                                  throws java.lang.Exception
        Returns the result of a single condition
        Parameters:
        work - The work Entry
        c - One BranchCondition
        index - The number of this BranchCondition, for error messages throws Exception if the left hand side of the condition is null
        Returns:
        the result of the conditions
        Throws:
        java.lang.Exception - if problem occurs
      • componentCount

        public int componentCount()
        Deprecated.
        Returns:
        an int count
      • add

        public void add​(Entry meta)
                 throws java.lang.Exception
        Do nothing in the add method
        Overrides:
        add in class AssemblyLineComponent
        Parameters:
        meta - parameter
        Throws:
        java.lang.Exception - if problem occurs
      • add1

        public void add1​(Entry meta)
                  throws java.lang.Exception
        This method executes the script.
        Parameters:
        meta - the work Entry
        Throws:
        java.lang.Exception - if problem occurs
      • trigger

        public boolean trigger​(java.lang.String oper)
        Calls the hook named oper.
        Overrides:
        trigger in class AssemblyLineComponent
        Parameters:
        oper - Name of the hook to call.
        Returns:
        True if the hook was executed, false if the hook is not defined or disabled.
      • trigger

        public boolean trigger​(java.lang.String oper,
                               Entry work)
        Calls the hook named oper, declaring work as the corresponding bean. The trigger function calls one of the AssemblyLine hooks defined for this Connector using the provided work.
        Overrides:
        trigger in class AssemblyLineComponent
        Parameters:
        oper - Name of the hook to call.
        work - This will be the work bean in the hook.
        Returns:
        True if the hook was executed, false if the hook is not defined or disabled.
      • trigger

        public boolean trigger​(java.lang.String oper,
                               Entry work,
                               Entry conn)
        Calls the hook named oper, declaring work and conn as the corresponding beans. The trigger function calls one of the AssemblyLine hooks defined for this Connector using the provided conn/work.
        Overrides:
        trigger in class AssemblyLineComponent
        Parameters:
        oper - Name of the hook to call.
        work - This will be the work bean in the hook.
        conn - This will be the conn bean in the hook
        Returns:
        True if the hook was executed, false if the hook is not defined or disabled.
      • getBranchType

        public int getBranchType()
        Returns the branch type.
        Returns:
        an int representing the configuration branch type, if the configuration is null returns -1.
      • isExecuted

        public boolean isExecuted()
        Determines whether the component has been executed.
        Returns:
        true if the component has been executed otherwise false.