Interface FormEngineSession


  • public interface FormEngineSession
    Represents a session with the Form Engine. Such a session lives for the duration of filling out a form. It contains - amongst others - the state of the current form flow.
    • Method Detail

      • getFormVersion

        BasicFormVersion getFormVersion()
        Returns the FormVersion to which this session belongs.
        Returns:
        the FormVersion to which this session belongs
      • getIdentifier

        String getIdentifier()
        Returns the internal identifier of this session.
        Returns:
        the internal identifier of this session
      • getFormScope

        FormScope getFormScope()
        Returns the FormScope, holding the state of the form.
        Returns:
        A HashMap that contains
        See Also:
        FormScope
      • getLastAccessTime

        long getLastAccessTime()
        Returns the last access time, represented as the number of milliseconds since January 1, 1970, 00:00:00 GMT. This is reset by invoking updateFormState, validatorForm or handleForm.
        Returns:
        the last access time, represented as the number of milliseconds since January 1, 1970, 00:00:00 GMT
      • updateLastAccessTime

        void updateLastAccessTime()
        Updates the last access time.
      • getLastStepIdentifier

        String getLastStepIdentifier()
        Returns the identifier of the step that was most recently submitted.
        Returns:
        the identifier of the step that was most recently submitted
      • setLastStepIdentifier

        void setLastStepIdentifier​(String stepIdentifier)
        Updates the identifier of the step that was most recently submitted.
        Parameters:
        stepIdentifier - the identifier of step that was most recently submitted
      • getContext

        FormSessionContext getContext()
        Returns the context for this session. The FormSessionContext contains additional information required by the FormEngine.
        Returns:
        the FormSessionContext related to this FormEngineSession
      • setContext

        void setContext​(FormSessionContext context)
        Sets the FormEngineSession context.
        Parameters:
        context - the context for this FormEngineSession
      • registerRouting

        void registerRouting​(String fromStep,
                             String toStep)
        Should be invoked whenever the user is routed from one step to the next. This information is used to determine the "previous" step.
        Parameters:
        fromStep - the identifier of step where the user came from
        toStep - the identifier of step where the user was sent
      • clearStep

        void clearStep​(String stepIdentifier)
        Removes all information of a step from the form scope and the routing (= allowed steps) list.
        Parameters:
        stepIdentifier - the identifier of step that should be cleared
        Since:
        10.31.0
      • getPreviousStep

        String getPreviousStep​(String currentStep)
        Returns the identifier of the previous step for the given step.
        Parameters:
        currentStep - the identifier current step
        Returns:
        the identifier of the previous step or null if the information is not available
      • getAllowedSteps

        List<String> getAllowedSteps()
        Returns a list of step identifiers the user is allowed to view and submit. Those steps are the first step plus all steps to which was routed.
        Returns:
        a list of step identifiers the user is allowed to view and submit
      • cleanPreviousStepMap

        void cleanPreviousStepMap​(String formStepIdentifier,
                                  boolean deleteSelf)
        Removes the references in the previous step map from the step with the provided identifier.
        Parameters:
        formStepIdentifier - The id of the formstep for which all step history should be removed
        deleteSelf - delete the formstep with the provided id from the previousStepMap
        Since:
        10.35.0