Package com.morpheusdata.core.providers
Interface WizardProvider
- All Superinterfaces:
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.morpheusdata.core.providers.PluginProvider
PluginProvider.ConfigurationDriftCheckFacet<T>, PluginProvider.EventSubscriberFacet<E extends Event>, PluginProvider.UpdateFacet<T> -
Method Summary
Modifier and TypeMethodDescriptiondefault voidafterSubmit(Map wizardData, ServiceResponse submitResponse, Map opts) Optional method called after successful wizard submission.default WizardReturns a complete Wizard object representing this wizard provider.default StringReturns a description of this wizard's purposeReturns the display name for this wizardReturns the ordered list of wizard steps that make up this wizard flow.default booleanDetermines whether the specified user has permission to access this wizard.default MapprepareReviewData(Map wizardData, Map opts) Prepares and returns data to be displayed on a review screen before final submission.default MapprepareWizardData(Map wizardData, Map opts) Optional method to transform or prepare wizard data before validation.default booleanshouldShowStep(WizardStep step, Map previousStepData, Map opts) Optional method to determine if a specific step should be shown based on data collected in previous steps.default booleanIndicates whether a review step should be shown before final submission.submitWizard(Map wizardData, Map opts) Processes and submits the completed wizard data after all steps have been completed and validated.validateWizard(Map wizardData, Map opts) Validates all wizard data before final submission.default ServiceResponsevalidateWizardStep(String stepCode, Map stepData, Map wizardData, Map opts) Validates the data submitted for a specific wizard step.Methods inherited from interface com.morpheusdata.core.providers.PluginProvider
getCode, getMorpheus, getName, getPlugin
-
Method Details
-
getWizardName
String getWizardName()Returns the display name for this wizard- Returns:
- wizard display name
-
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
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
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
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 codeopts- additional options or context- Returns:
- Map containing formatted data to display on the review screen
-
validateWizard
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 codeopts- additional options or context- Returns:
- ServiceResponse containing validation results. If validation fails, the response should contain error messages explaining what went wrong.
-
validateWizardStep
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 validatedstepData- map containing data submitted for this specific stepwizardData- map containing all data collected from previous steps, keyed by step codeopts- additional options or context- Returns:
- ServiceResponse containing validation results. If validation fails, the response should contain error messages explaining what went wrong.
-
submitWizard
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 codeopts- additional options or context- Returns:
- ServiceResponse containing the result of the wizard submission, including any data that should be returned to the caller
-
prepareWizardData
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 stepsopts- additional options or context- Returns:
- the prepared wizard data
-
afterSubmit
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 stepssubmitResponse- the response from submitWizard()opts- additional options or context
-
shouldShowStep
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 evaluatepreviousStepData- map containing data from all previously completed stepsopts- additional options or context- Returns:
- true if the step should be shown, false to skip it
-