Class ValidationService

java.lang.Object
formflow.library.ValidationService

@Service public class ValidationService extends Object
A service that validates flow inputs based on input definition.

Flow inputs come from screen POST submissions to the server.

Input definitions are located in formflowstarter/app/inputs/<flow-name>.

  • Constructor Details

    • ValidationService

      public ValidationService(jakarta.validation.Validator validator, ActionManager actionManager, @Value("${form-flow.inputs: \'formflow.library.inputs.\'}") String inputConfigPath)
      Autoconfigured constructor.
      Parameters:
      validator - Validator from Jakarta package.
      actionManager - the ActionManager that manages the logic to be run at specific points
      inputConfigPath - the package path where inputs classes are located
  • Method Details

    • validate

      public Map<String,List<String>> validate(ScreenNavigationConfiguration currentScreen, String flowName, FormSubmission formSubmission, Submission submission)
      Validates client inputs with java bean validation based on input definition.
      Parameters:
      currentScreen - The screen we are currently validating form data from
      flowName - The name of the current flow, not null
      formSubmission - The input data from a form as a map of field name to field value(s), not null
      submission - The submission that we are cross validating with
      Returns:
      a HashMap of field to list of error messages, will be empty if no field violations