Create a Wizard Workflow

This tutorial demonstrates how to create a wizard workflow for EmpowerID. A wizard workflow allows users to navigate through a series of steps or conditions to execute a workflow. Creating a wizard aims to divide a workflow into multiple screens and easily instruct the user on completing the workflow. In this tutorial, you will be covering.

  • Create a form for the wizard.

  • Create wizard workflow and Add forms.

  • Publish the workflow into the EmpowerID environment.

  • Test the Workflow.

Create a Form

  1. In the Workspace tree of Solution Explorer, right-click the Package node in which you want to create the form and select New User Interface > Form from the context menu.

     

  2. A form will appear in the workspace with a default name.

     

  3. Let’s add some fields to the form. Click on the Other Objects → Add Object. In the Add Object window, select String and click on Add.


     

  4. Rename the object String1 to First Name, and drag and drop the object into the form.



     

  5. The Next & Back button must be enabled for a wizard. Expand the Approval Decisions and select the Back & Next Button.


     

  6. Save the form with a meaningful name. You must click on the Save icon and select the file path. Provide a meaningful name and click on save.




  7. After the form is saved, you will see the form loaded in the designer with the name you provided.

  8. Click on Compile and publish button, to publish the workflow. You can find more information about deploying here in https://dotnetworkflow.jira.com/wiki/spaces/EDGV21/pages/1606356947.

     

Create a Workflow

  1. In the Workspace tree of Solution Explorer, Navigate to the Package node and select Workflows Applications → New Workflow → Flow Chart Workflow from the context menu.

     

  2. The workflow will load with default shapes. Click on the Save icon to save it with a meaningful name.

     

  3. Select the file path. Provide a name and click on Save.

     

  4. Drag and drop the form we created earlier into the workflow. Expand the User Interface → Forms and select the form created earlier into the workflow.


     

  5. Repeat the above step two more times. For simplicity of the tutorial, we will use the same form three times in the wizard workflow.




  6. Connect the shapes with lines; the lines must be connected from the Start to the End shape.




  7. Select the first form added to the workflow. Open the Properties window and create a new Event Handler. Please provide an event name in the BeforeExecute events and double-click on it to open the code view.




  8. Paste the code in the event handler created in the earlier step. You can modify the code based on your requirements.

    CurrentWorkflow.UiSteps = new WorkflowUISteps(); var step1 = new UIStep(); step1.Name = this.CurrentWorkflow.myNewWizardFormActivity1.QualifiedName; step1.FriendlyName = "My First Step"; step1.Description = "My First Step"; var step2 = new UIStep(); step2.Name = this.CurrentWorkflow.myNewWizardFormActivity2.QualifiedName; step2.FriendlyName = "My Second Step"; step2.Description = "My Second Step"; var step3 = new UIStep(); step3.Name = this.CurrentWorkflow.myNewWizardFormActivity3.QualifiedName; step3.FriendlyName = "My Third Step"; step3.Description = "My Third Step"; CurrentWorkflow.UiSteps.Steps.Add(step1); CurrentWorkflow.UiSteps.Steps.Add(step2); CurrentWorkflow.UiSteps.Steps.Add(step3); CurrentWorkflow.UiSteps.CurrentStep = CurrentWorkflow.UiSteps.Steps[0];

     

  9. Select the second form. Open the properties window and paste the following code into the AfterExecute event handler.

     

    CurrentWorkflow.UiSteps.CurrentStep = CurrentWorkflow.UiSteps.Steps[1];

     

  10. Similarly, select the third form and paste the following code into the BeforeExecute event.




    CurrentWorkflow.UiSteps.CurrentStep = CurrentWorkflow.UiSteps.Steps[2];
  11. Click on Compile and publish button, to publish the workflow. Complete the publish wizard; you can find more information about deploying here in https://dotnetworkflow.jira.com/wiki/spaces/EDGV21/pages/1606356947.

Publish the Workflow

Once the workflow and forms are compiled and published, the published file items should be deployed into EmpowerID. All details about publishing the items are available on https://dotnetworkflow.jira.com/wiki/spaces/EDGV21/pages/1606357200. Please make sure that the “.pub” file for both form and workflow is published.

Test the Workflow

  1. Login into the EmpowerID.

  2. Navigate to Object Administration → Workflows, and search the workflow published in the previous step.

     

  3. Click on the name of the workflow to execute it. The UI of the workflow will appear on the screen.

IIS reset must be done after publishing the workflow, and the workflow might not appear in the listing above without the IIS reset.