Class RoutingResult


  • public class RoutingResult
    extends Object
    Represents a routing result; this is to be used to indicate where to send the user next.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ROUTE_BACK
      Indicates a routing to the previous FormStep.
      static int ROUTE_CURRENT
      Indicates a routing to the current FormStep.
      static int ROUTE_FORWARD
      Indicates a routing to the next FormStep.
      static int ROUTE_HTTP_ERROR
      Indicates an error occured.
      static int ROUTE_TO_PAGE
      Indicates a routing to a specific Page.
      static int ROUTE_TO_SPECIALPAGE
      Indicates a routing to a so called "Special Page".
      static int ROUTE_TO_STEP
      Indicates a routing to a specific FormStep of the current Form/FormVersion.
      static int ROUTE_TO_URL
      Indicates a routing to a specific URL.
    • Constructor Summary

      Constructors 
      Constructor Description
      RoutingResult()
      Default constructor for the RoutingResult.
    • Field Detail

      • ROUTE_TO_URL

        public static final int ROUTE_TO_URL
        Indicates a routing to a specific URL.
        See Also:
        Constant Field Values
      • ROUTE_TO_PAGE

        public static final int ROUTE_TO_PAGE
        Indicates a routing to a specific Page.
        See Also:
        Constant Field Values
      • ROUTE_TO_STEP

        public static final int ROUTE_TO_STEP
        Indicates a routing to a specific FormStep of the current Form/FormVersion.
        See Also:
        Constant Field Values
      • ROUTE_BACK

        public static final int ROUTE_BACK
        Indicates a routing to the previous FormStep.
        See Also:
        Constant Field Values
      • ROUTE_CURRENT

        public static final int ROUTE_CURRENT
        Indicates a routing to the current FormStep.
        See Also:
        Constant Field Values
      • ROUTE_FORWARD

        public static final int ROUTE_FORWARD
        Indicates a routing to the next FormStep.
        See Also:
        Constant Field Values
      • ROUTE_TO_SPECIALPAGE

        public static final int ROUTE_TO_SPECIALPAGE
        Indicates a routing to a so called "Special Page".
        See Also:
        Constant Field Values
      • ROUTE_HTTP_ERROR

        public static final int ROUTE_HTTP_ERROR
        Indicates an error occured.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RoutingResult

        public RoutingResult()
        Default constructor for the RoutingResult. Sets the type to route back to the current step.
    • Method Detail

      • setType

        public void setType​(int type)
        Sets the type of this RoutingResult.
        Parameters:
        type - the type of this RoutingResult
      • getType

        public int getType()
        Returns the type of this RoutingResult.
        Returns:
        the type of this RoutingResult
      • isEndOfFlow

        public boolean isEndOfFlow()
        Indicates whether the FormSession should be terminated.
        Returns:
        whether the FormSession should be terminated
      • setIsEndOfFlow

        public void setIsEndOfFlow​(boolean eof)
        Sets whether the FormSession should be terminated
        Parameters:
        eof - whether the FormSession should be terminated
      • getUrl

        public String getUrl()
        Returns the URL to route to in case the type is ROUTE_TO_URL.
        Returns:
        the URL to route to
      • setUrl

        public void setUrl​(String url)
        Sets the URL to route to in case the type is ROUTE_TO_URL
        Parameters:
        url - the URL to route to in case the type is ROUTE_TO_URL
      • getPage

        public Page getPage()
        Returns the Page to route to in case the type is ROUTE_TO_PAGE.
        Returns:
        the Page to route to in case the type is ROUTE_TO_PAGE
      • setPage

        public void setPage​(Page page)
        Sets the Page to route to in case the type is ROUTE_TO_PAGE.
        Parameters:
        page - the Page to route to in case the type is ROUTE_TO_PAGE
      • getFormStep

        public BasicFormStep getFormStep()
        Returns the FormStep to route to in case the type is ROUTE_TO_STEP.
        Returns:
        the FormStep to route to in case the type is ROUTE_TO_STEP
      • setFormStep

        public void setFormStep​(BasicFormStep formStep)
        Sets the FormStep to route to in case the type is ROUTE_TO_STEP.
        Parameters:
        formStep - the FormStep to route to in case the type is ROUTE_TO_STEP
      • setSpecialPageLabel

        public void setSpecialPageLabel​(String label)
        Sets the label of the Special Page to route to in case the type is ROUTE_TO_SPECIALPAGE.
        Parameters:
        label - the label of the Special Page to route to in case the type is ROUTE_TO_SPECIALPAGE
      • getSpecialPageLabel

        public String getSpecialPageLabel()
        Returns the label of the Special Page to route to in case the type is ROUTE_TO_SPECIALPAGE.
        Returns:
        the label of the Special Page to route to in case the type is ROUTE_TO_SPECIALPAGE
      • setHttpErrorCode

        public void setHttpErrorCode​(int code)
        Sets the HTTP error code to be used in case the type is ROUTE_HTTP_ERROR.
        Parameters:
        code - the HTTP error code to be used in case the type is ROUTE_HTTP_ERROR
      • getHttpErrorCode

        public int getHttpErrorCode()
        Returns the HTTP error code to be used in case the type is ROUTE_HTTP_ERROR.
        Returns:
        the HTTP error code to be used in case the type is ROUTE_HTTP_ERROR
      • setHttpErrorMessage

        public void setHttpErrorMessage​(String message)
        Sets the HTTP error message to be used in case the type is ROUTE_HTTP_ERROR.
        Parameters:
        message - the HTTP error message to be used in case the type is ROUTE_HTTP_ERROR
      • getHttpErrorMessage

        public String getHttpErrorMessage()
        Returns the HTTP error message to be used in case the type is ROUTE_HTTP_ERROR.
        Returns:
        the HTTP error message to be used in case the type is ROUTE_HTTP_ERROR
      • hasErrors

        public boolean hasErrors()
        Indicates whether the routing was the result of errors in the FormScope.
        Returns:
        whether the routing was the result of errors in the FormScope
      • hasErrors

        public void hasErrors​(boolean hasErrors)
        Sets whether the routing was the result of errors in the FormScope.
        Parameters:
        hasErrors - whether the routing was the result of errors in the FormScope
      • getJSONRepresentation

        public String getJSONRepresentation()
        Returns the routing result in JSON format.
        Returns:
        the routing result in JSON format