Interface ConfigurationWorkflowProvider

All Superinterfaces:
PluginProvider

public interface ConfigurationWorkflowProvider extends PluginProvider
Provides support for defining complex multi-step configuration workflow workflows. Each configuration workflow consists of multiple steps, where each step contains a wizard for configuration. The orchestrator maintains state across all steps and coordinates with a parent object to persist the configuration workflow state. Final submission triggers a long-running process that executes the orchestrated workflow.
Since:
1.2.6
  • Method Details

    • getWorkflowName

      String getWorkflowName()
      Returns the display name for this configuration workflow
      Returns:
      configuration workflow display name
    • getWorkflowDescription

      default String getWorkflowDescription()
      Returns a description of this configuration workflow's purpose
      Returns:
      configuration workflow description
    • getConfigurationWorkflow

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

      default boolean hasAccess(User user)
      Determines whether the specified user has permission to access this configuration workflow. 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 configuration workflow, false otherwise
    • getWorkflowSteps

      List<ConfigurationWorkflowStep> getWorkflowSteps()
      Returns the ordered list of configuration workflow steps that make up this workflow. The steps will be presented to the user in the order returned by this list.
      Returns:
      List of ConfigurationWorkflowStep objects defining the configuration workflow
    • saveStepConfiguration

      ServiceResponse<?> saveStepConfiguration(String stepCode, Map<String,Object> stepData, Map<String,Object> currentState, Map<String,Object> opts)
      Saves the configuration from a completed step to the configuration workflow state. This method is called after each step's wizard is successfully completed, allowing the configuration workflow to accumulate configuration across all steps.

      The state map must use a flat structure: each step's data is stored at the top level keyed by step code.

      Example state after two steps complete:

       {
         "my-network-step":      { "managementIp": "10.0.0.1", ... },
         "my-credentials-step":  { "username": "admin", ... },
         "status":               "completed",
         "completed":            true,
         "lastCompletedStep":    "my-credentials-step"
       }
       

      The ServiceResponse data map must contain a workflowState key holding the updated state map: ServiceResponse.success([workflowState: newState]).

      Parameters:
      stepCode - the code of the step that was completed
      stepData - the configuration data collected from the step's wizard
      currentState - the current configuration workflow state before this update
      opts - additional options or context
      Returns:
      ServiceResponse whose data contains workflowState — the updated flat state map
    • updateParentState

      ServiceResponse<?> updateParentState(Object parentObject, Map<String,Object> configurationWorkflowState, Map<String,Object> opts)
      Updates the parent object with the current configuration workflow state. This method is called after each step configuration is saved, allowing the parent object to persist and track the configuration workflow progress.
      Parameters:
      parentObject - the parent object that holds the configuration workflow state
      configurationWorkflowState - the current complete state of the configuration workflow
      opts - additional options or context
      Returns:
      ServiceResponse indicating success or failure of the update
    • validateConfigurationWorkflow

      ServiceResponse<?> validateConfigurationWorkflow(Map<String,Object> configurationWorkflowState, Object parentObject, Map<String,Object> opts)
      Validates the complete configuration workflow state before final submission. This method performs cross-step validation and business rule checks that span multiple configuration workflow steps.

      The configurationWorkflowState map uses a flat structure: step data is stored at the top level keyed by step code (e.g. state["my-network-step"]). Metadata keys status, completed, and lastCompletedStep are also present at the top level.

      Parameters:
      configurationWorkflowState - flat map of all step data, keyed by step code, plus metadata keys
      parentObject - the parent object that holds the configuration workflow state
      opts - additional options or context
      Returns:
      ServiceResponse containing validation results. If validation fails, the response should contain error messages explaining what went wrong.
    • submitConfigurationWorkflow

      ServiceResponse<?> submitConfigurationWorkflow(Map<String,Object> configurationWorkflowState, Object parentObject, Map<String,Object> opts)
      Submits and executes the configuration workflow. This method is called after all steps are completed and validated. It should initiate the actual execution of the configuration workflow.

      The configurationWorkflowState map uses a flat structure: step data is stored at the top level keyed by step code.

      Setting system status: Set parentObject.status = "initialized" to signal that setup is complete.

      Since this method typically triggers another long-running process or method, it returns a synchronous ServiceResponse. The long-running execution should be handled by the method this calls.

      Parameters:
      configurationWorkflowState - flat map of all step data, keyed by step code, plus metadata keys
      parentObject - the parent object that holds the configuration workflow state
      opts - additional options or context
      Returns:
      ServiceResponse containing the result of the configuration workflow submission
    • getConfigurationWorkflowState

      default Map<String,Object> getConfigurationWorkflowState(Object parentObject, Map<String,Object> opts)
      Optional method to retrieve the current configuration workflow state from the parent object. This is useful for resuming an configuration workflow or reviewing its current progress.
      Parameters:
      parentObject - the parent object that holds the configuration workflow state
      opts - additional options or context
      Returns:
      Map containing the current configuration workflow state
    • shouldShowStep

      default boolean shouldShowStep(ConfigurationWorkflowStep step, Map<String,Object> configurationWorkflowState, Map<String,Object> opts)
      Optional method to determine if a specific step should be shown based on the current configuration workflow state. This allows for conditional configuration workflow flows.
      Parameters:
      step - the configuration workflow step to evaluate
      configurationWorkflowState - map containing the current state from all previously completed steps
      opts - additional options or context
      Returns:
      true if the step should be shown, false to skip it
    • afterSubmit

      default void afterSubmit(Map<String,Object> configurationWorkflowState, ServiceResponse<?> submitResponse, Object parentObject, Map<String,Object> opts)
      Optional method called after successful configuration workflow submission. Useful for cleanup, notifications, or triggering dependent actions after the configuration workflow process completes.
      Parameters:
      configurationWorkflowState - map containing all configuration data from all steps
      submitResponse - the response from submitConfigurationWorkflow()
      parentObject - the parent object that holds the configuration workflow state
      opts - additional options or context
    • cancelConfigurationWorkflow

      default ServiceResponse<?> cancelConfigurationWorkflow(Map<String,Object> configurationWorkflowState, Object parentObject, Map<String,Object> opts)
      Optional method to cancel or abort a running configuration workflow process.
      Parameters:
      configurationWorkflowState - map containing the current configuration workflow state
      parentObject - the parent object that holds the configuration workflow state
      opts - additional options or context
      Returns:
      ServiceResponse indicating success or failure of the cancellation