Class RouteByStepName

  • All Implemented Interfaces:
    Configurable, Router

    public class RouteByStepName
    extends RouterBase
    A router that sends documents to subsequent steps by comparing the value in a standard field in the document to the name of subsequent steps. Only the first value in the standard field is consulted, and only one step may be returned (because all steps must hae a unique value for name). Therefore this router will never duplicate the document. Also note that if this router does not find a next destination it will cause an error for the document.
    • Field Detail

      • JESTERJ_NEXT_STEP_NAME

        public static final java.lang.String JESTERJ_NEXT_STEP_NAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • RouteByStepName

        public RouteByStepName()
    • Method Detail

      • isDeterministic

        public boolean isDeterministic()
        Description copied from interface: Router
        Indicates if this router will always route an identical document to the same downstream step or steps. It is important to understand that this attribute refers to determinism with respect to document content and anything that depends on the order in which documents are fed, is NOT deterministic.
        Returns:
        True if the document's destination is deterministic, false if it may vary.
      • isConstantNumberOfOutputDocs

        public boolean isConstantNumberOfOutputDocs()
        Description copied from interface: Router
        Indicates if the number documents entering this router have a constant linear relationship to the number of documents exiting the router. This relationship need only be constant for a particular plan configuration, and may vary when configured differently in different plans. A document may be considered to have exited the router if it records a terminal status (i.e. Status.DROPPED, or if it is included in the NextSteps object returned from Router.route(Document)
        Returns:
        True if one document in produces a constant number of documents out.
      • getNumberOfOutputCopies

        public int getNumberOfOutputCopies()
        Description copied from interface: Router
        Indicates how many copies of a document may be omitted by this router. If Router.isConstantNumberOfOutputDocs() returns false this number represents the maximum output. A negative value indicates that there is no constraint on the number of copies that may be omitted.
        Returns:
        the number of output copies expected.
      • route

        public NextSteps route​(Document doc)
        Description copied from interface: Router
        Decide where to send this document. The result may represent some or all of the steps down stream. Note that it is illegal for a router not to select at least one destination, and this will cause errors. It is also prohibited for the router to select a destination not listed on the document.
        Parameters:
        doc - The document to route
        Returns:
        An object encapsulating the destinations to which the document (or copies of it) will be sent.
        See Also:
        Step.getEligibleNextSteps(Document)
      • getName

        public java.lang.String getName()
        Description copied from interface: Configurable
        A name for this object to distinguish it from other objects. This value is generally supplied by the plan author. Every object in a plan must have a unique name, begin with a letter and only contain letters, digits, underscores and periods.
        Returns:
        The user supplied name for this step
      • getKeyFieldName

        public java.lang.String getKeyFieldName()
      • setKeyFieldName

        protected void setKeyFieldName​(java.lang.String keyFieldName)
      • getValueToStepNameMap

        public java.util.Map<java.lang.String,​java.lang.String> getValueToStepNameMap()