Often is the case when a desired and usually complex business logic must be implemented everywhere in the system or an application. Wizards are no exception. For this purpose workflows are introduced on wizards. With workflows desirable business logic can be implemented and it can be triggered on many different events on each page.
Workflows can be managed for individual page. Workflows can be added or removed. Each workflow has properties that define its behaviour. Following commands are available for managing diagrams and workflows.
Command | Description |
---|---|
Add Selected Workflow | Adds a workflow, selected in the list Available Workflows, to the end of the list Existing Workflows. |
Remove | Removes selected workflow from the list Existing Workflows. |
Clear | Removes all workflows from the list Existing Workflows. |
When a workflow is added to the list of Existing Workflows, properties are generated which can be used to customize the workflow’s behaviour. Property DiagramName defines the name of the workflow. Property Container defines the MxDiagram which contains the selected workflow. Property ActivityType defines when the workflow is invoked. Three options are available.
Option | Description |
---|---|
Next | Workflow is triggered when Next button is clicked. But the workflow is executed before the Next Rule is evaluated. Therefore the workflow can influence the next condition or rule. |
Previous | Workflow is triggered when Previous button is clicked. But the workflow is executed before the Previous Rule is evaluated. Therefore the workflow can influence the previous condition or rule. |
Enter | Workflow is executed at the moment a page is displayed. It is executed no matter which button was clicked, Next or Previous. |
Example (MxSpace)
To see the implementation of workflow on a wizard page in MxSpace application click Production -> Create.
To add a workflow
- Open desirable wizard (WorkOrderCreateWizard) in Solution Explorer.
- Add MxDiagram component (WorkOrderCreateWizardDiagram), which contains the workflow, to the wizard by selecting it from the Toolbox under Project.Components section.
- In property window select current wizard from drop down list.
- Edit property Pages for the selected wizard.
- Expand the page (Work Order General Information) to which you want to add the workflow.
- Click on the Workflows node.
- Select the desired workflow (EndEdit) from the list of available workflows.
- Click Add Selected Workflow in Add section. Workflow is added to the list Existing Workflows. Its properties are displayed on the right.
- Set ActivityType property to Next.
MxWizard
MxWizard
Designing a Wizard