## Overview

The Wizard Activation widget enables the deactivation/activation of a Forms Wizard. It provides a simple interface for administrators to control the availability of Forms Wizards. It displays either an "Activate" or "Deactivate" button depending on the wizard's current state, allowing administrators to toggle whether end users can start new wizards or continue existing wizard instances.

The widget implements important safety checks before allowing activation, including configuration validation and permission verification. Deactivation requires explicit confirmation to prevent accidental disruption of user workflows.

## Use Cases

### Wizard Lifecycle Management

Administrators use this widget to control Forms Wizard availability throughout its lifecycle:

- **During Configuration**: Keep the wizard inactive while configuring steps, transitions, and localization to prevent users from accessing incomplete wizards
- **Pre-Activation Validation**: Verify all configuration is valid using the Wizard Analysis widget before enabling the wizard
- **Activation**: Once fully configured and validated, activate the wizard to make it available to end users
- **Maintenance**: Deactivate the wizard when changes are needed or to temporarily disable it without deleting configuration
- **Retirement**: Deactivate wizards that are no longer needed while preserving historical data

### Typical Workflow

1. Administrator creates a new Forms Wizard page (inactive by default)
2. Administrator configures wizard steps, transitions, and settings using other widgets
3. Administrator reviews the Wizard Analysis widget to check for configuration issues
4. Once all validation checks pass, the Activate button becomes enabled
5. Administrator clicks Activate to make the wizard available to end users
6. If changes are needed later, administrator clicks Deactivate (with confirmation) to modify the wizard safely

## Design Considerations

### Activation States

The widget manages two mutually exclusive states:
- **ACTIVE**: The wizard is available for use by end users who can start new instances and continue existing ones
- **INACTIVE**: The wizard is disabled; users cannot start new instances or continue existing ones

### Configuration Validation

Before allowing activation, the widget enforces strict validation:
- Consults the Wizard Analysis Service to verify complete and valid configuration
- Disables the Activate button if configuration is incomplete or invalid
- Displays an explanatory message directing administrators to the Wizard Analysis widget for details

### Safety Mechanisms

The widget implements several safety features:
- **Confirmation Dialog**: Deactivation requires explicit confirmation with a warning that users can neither start new wizards nor continue existing ones
- **Permission Check**: Only allows state changes if the user has edit permissions on the wizard page
- **Automatic Refresh**: Listens for configuration change events and updates the activation state automatically when step relationships or configurations are modified

### Embedding Constraints

This widget can only be embedded on pages of type `cf.cplace.formsWizard.wizard`. Attempting to embed it on other page types will fail validation.

## Related Widgets

This widget is typically used alongside other Forms Wizard widgets on a wizard configuration page:

- **Wizard Analysis Widget** (`cf.cplace.formsWizard.wizardAnalysis`): Validates wizard configuration and determines whether activation is allowed; provides detailed information about configuration issues
- **Step Manager Widget** (`cf.cplace.formsWizard.stepManager`): Manages the list of wizard steps
- **Wizard Localizations Widget** (`cf.cplace.formsWizard.wizardLocalizations`): Configures multi-language support for wizard interface elements
- **Step Editor Widgets**: Configure individual step properties, transitions, and behaviors

The widget automatically refreshes when these related widgets make changes that affect wizard configuration validity.

## Common Pitfalls

- **Activating without validation**: Attempting to activate a wizard without first resolving all configuration issues will fail; always check the Wizard Analysis widget first
- **Missing deactivation confirmation**: Users may be surprised by the confirmation dialog when deactivating; this is intentional to prevent accidental disruption of active wizard instances
- **Permission confusion**: If the Activate/Deactivate button is not visible, check that the current user has edit permissions on the wizard page
