Interface WizardProvider

All Superinterfaces:
PluginProvider

public interface WizardProvider extends PluginProvider
Provides support for defining multi-step wizards with validation and final submission logic. Each wizard consists of multiple steps, where each step contains a form for data collection. Individual step forms handle their own validation, but final submission is handled by the wizard itself.
Since:
1.2.6
  • Method Details

    • getWizardName

      String getWizardName()
      Returns the display name for this wizard
      Returns:
      wizard display name
    • getWizardDescription

      default String getWizardDescription()
      Returns a description of this wizard's purpose
      Returns:
      wizard description
    • showReviewStep

      default boolean showReviewStep()
      Indicates whether a review step should be shown before final submission. When true, the wizard will display a review screen with data prepared by prepareReviewData() before calling submitWizard().
      Returns:
      true to show the review step, false to skip directly to submission
    • getWizard

      default Wizard getWizard()
      Returns a complete Wizard object representing this wizard provider. This method constructs a Wizard model from the provider's configuration, including the code, name, description, and steps.
      Returns:
      Wizard object representing this wizard
    • hasAccess

      default boolean hasAccess(User user)
      Determines whether the specified user has permission to access this wizard. This method allows providers to implement custom authorization logic based on user roles, permissions, or other criteria.
      Parameters:
      user - the user to check access for
      Returns:
      true if the user can access this wizard, false otherwise
    • getWizardSteps

      List<WizardStep> getWizardSteps()
      Returns the ordered list of wizard steps that make up this wizard flow. The steps will be presented to the user in the order returned by this list.
      Returns:
      List of WizardStep objects defining the wizard flow
    • prepareReviewData

      default Map prepareReviewData(Map wizardData, Map opts)
      Prepares and returns data to be displayed on a review screen before final submission. This method allows the wizard to transform, summarize, or format the collected data for user review. The returned map should contain data that will be displayed to the user for confirmation before submitting the wizard.
      Parameters:
      wizardData - map containing all data collected from all wizard steps, keyed by step code
      opts - additional options or context
      Returns:
      Map containing formatted data to display on the review screen
    • validateWizard

      ServiceResponse validateWizard(Map wizardData, Map opts)
      Validates all wizard data before final submission. This method can perform cross-step validation and business rule checks that span multiple steps. Individual step validation is handled by validateWizardStep(), but this method provides a final validation point for the complete wizard.
      Parameters:
      wizardData - map containing all data collected from all wizard steps, keyed by step code
      opts - additional options or context
      Returns:
      ServiceResponse containing validation results. If validation fails, the response should contain error messages explaining what went wrong.
    • validateWizardStep

      default ServiceResponse validateWizardStep(String stepCode, Map stepData, Map wizardData, Map opts)
      Validates the data submitted for a specific wizard step. This method is called when a user completes a step and before moving to the next step. It allows validation logic to consider the entire wizard state collected so far.
      Parameters:
      stepCode - the code of the step being validated
      stepData - map containing data submitted for this specific step
      wizardData - map containing all data collected from previous steps, keyed by step code
      opts - additional options or context
      Returns:
      ServiceResponse containing validation results. If validation fails, the response should contain error messages explaining what went wrong.
    • submitWizard

      ServiceResponse submitWizard(Map wizardData, Map opts)
      Processes and submits the completed wizard data after all steps have been completed and validated. This is the final submission point for the entire wizard flow.
      Parameters:
      wizardData - map containing all data collected from all wizard steps, keyed by step code
      opts - additional options or context
      Returns:
      ServiceResponse containing the result of the wizard submission, including any data that should be returned to the caller
    • prepareWizardData

      default Map prepareWizardData(Map wizardData, Map opts)
      Optional method to transform or prepare wizard data before validation. This can be used to merge data from multiple steps, set defaults, or perform conversions across the entire wizard dataset.
      Parameters:
      wizardData - map containing all data collected from all wizard steps
      opts - additional options or context
      Returns:
      the prepared wizard data
    • afterSubmit

      default void afterSubmit(Map wizardData, ServiceResponse submitResponse, Map opts)
      Optional method called after successful wizard submission. Useful for cleanup, notifications, or triggering dependent actions after the wizard completes.
      Parameters:
      wizardData - map containing all data collected from all wizard steps
      submitResponse - the response from submitWizard()
      opts - additional options or context
    • shouldShowStep

      default boolean shouldShowStep(WizardStep step, Map previousStepData, Map opts)
      Optional method to determine if a specific step should be shown based on data collected in previous steps. This allows for conditional wizard flows.
      Parameters:
      step - the wizard step to evaluate
      previousStepData - map containing data from all previously completed steps
      opts - additional options or context
      Returns:
      true if the step should be shown, false to skip it