Class LoopComponent

  • All Implemented Interfaces:
    java.util.Map

    public class LoopComponent
    extends BranchingComponent
    This class is used by an AssemblyLine to mark the beginning of a loop
    • Constructor Detail

      • LoopComponent

        public LoopComponent​(AssemblyLine parent,
                             java.lang.String name,
                             LoopConfig config)
                      throws java.lang.Exception
        Constructor for the LoopComponent object
        Parameters:
        parent - The AssemblyLine this LoopComponent belongs in
        name - The name of this LoopComponent
        config - The configuration for this LoopComponent
        Throws:
        java.lang.Exception - Any Exception that might be thrown
    • Method Detail

      • initialize

        public void initialize()
                        throws java.lang.Exception
        This method initializes the LoopComponent
        Overrides:
        initialize in class BranchingComponent
        Throws:
        java.lang.Exception - If this is a Collection Loop, and attribute names are missing
      • getNextEntry

        public Entry getNextEntry​(Entry meta)
                           throws java.lang.Exception
        Returns the next Entry if this is a Connector loop
        Parameters:
        meta - The work Entry
        Returns:
        The next Entry
        Throws:
        java.lang.Exception - Any Exception thrown by the Connector
      • setFirstLoop

        public void setFirstLoop​(boolean value)
        Set the internal firstLoop variable to the parameter value. Used to decide if this LoopComponent should begin a new Loop, or continue the old Loop
        Parameters:
        value - The value to set
      • getLoopType

        public int getLoopType()
        Returns the source for this loop component (e.g. LoopConfig.LOOP_CONDITIONS/CONNECTOR_FC/COLLECTION)
        Returns:
        An int containing the loop type.
      • willExecute

        public boolean willExecute​(Entry work)
                            throws java.lang.Exception
        This method will execute the Loop condition/connector and determine whether there are more loops to do.
        Overrides:
        willExecute in class BranchingComponent
        Parameters:
        work - The work Entry
        Returns:
        true if there are more loops to do
        Throws:
        java.lang.Exception - if a problem occurs
      • getType

        public int getType()
        Returns the type of this component.
        Overrides:
        getType in class BranchingComponent
        Returns:
        ServerConstants.TYPE_LOOP
      • checkLoopAttribute

        public void checkLoopAttribute​(Entry work)
        Copy values from work entry attribute
        Parameters:
        work - The work Entry
      • checkConnectorInit

        public void checkConnectorInit​(Entry work)
                                throws java.lang.Exception
        Check what to do with our connector when we enter the loop.
        Parameters:
        work - The work Entry
        Throws:
        java.lang.Exception - if a problem occurs
      • setConnectorParams

        public void setConnectorParams​(Entry work)
                                throws java.lang.Exception
        Executes the attribute map for the connector params
        Parameters:
        work - The work Entry
        Throws:
        java.lang.Exception - if a problem occurs
      • add

        public void add​(Entry meta)
                 throws java.lang.Exception
        If necessary, move a value from the stored Attribute values to the work Entry
        Overrides:
        add in class BranchingComponent
        Parameters:
        meta - The work Entry
        Throws:
        java.lang.Exception - if a problem occurs
      • close

        public void close()
                   throws java.lang.Exception
        Releases resource.
        Overrides:
        close in class BranchingComponent
        Throws:
        java.lang.Exception - if a problem occurs.
      • getAssemblyLineComponent

        public AssemblyLineComponent getAssemblyLineComponent()
        Returns the associated AssemblyLineComponent with the Connector. If this is not a Connector LoopComponent, returns null.
        Returns:
        an AssemblyLineComponent, or null
        Since:
        7.0
      • setConnectorParam

        public void setConnectorParam​(java.lang.String param,
                                      java.lang.Object value)
        Used for setting the connector Param.
        Overrides:
        setConnectorParam in class AssemblyLineComponent
        Parameters:
        param - The parameter name
        value - The parameter value
        Since:
        7.1.1.