Introduction

The default behavior when integrating a Form with a workflow has been enhanced. The integration wizard initially creates a state called Workflow Task which will be reused in all subsequent user tasks that appear in the workflow. This enhancement reduces the duplication of rules and allows the same state to be used for either multiple steps in the same workflow, or even steps in different workflows. Previously the wizard always created a new state and replicated the rules. Existing workflows will continue to function as before and any existing configured rules that contain the relevant actions will not be modified.

Implementation Details

The Create a new State and Use an existing State options are available on the User Form screen of the User Task wizard. The integration wizard creates a default state called Workflow Task which can subsequently be used in other User Tasks.
Image
A condition is added to the rules to identify the specific workflow activity linked to the worklist item to open.
Image
When viewed in the rule designer, the different workflow activities are displayed separately and additional rule actions can be added per workflow activity.
Image

Example Scenario

In the scenario below we are using a Form with two Views. The Form contains two text boxes for comments that will be used differently in two separate user tasks using the same state.    

Follow the steps below to set up the scenario:

  1. Create a Form and use one or more Views on the Form. We used a Sales Item View and a Sales List View.
  2. Drag two Label controls and two Text Box controls onto the Form.
  3. Change the text properties of the Label controls to Sales Notes and Manager Notes as shown below.
    Image
  4. Finish the Form.
  5. Select to Design a new workflow on the Finish screen.
  6. Complete the Workflow Name screen details as shown below.
    Image
  7. Click Next.
  8. Select the rule when create button is clicked as shown below
    Image
  9. Click Finish.
  10. Drag a User Task onto the canvas.
  11. Type the name Sales Approval and provide actions as shown below. Click Next.
    Image
  12. On the User Form screen expand the arrow next to Form, note the state Workflow Task is added by default.
    Image
  13. Click Next.
  14. Note the condition and action added to the rules for the specific activity. The new condition and action are displayed with orange icons indicating that the workflow has not been deployed yet.
    Image
  15. Click Next.
  16. Add a participant(s) and click Finish.
  17. Drag another User task onto the Yes outcome.
  18. Type the name Manager Approval and provide actions as shown below. Click Next.
    Image
  19. On the User Form screen expand the arrow next to Form, note the default Workflow Task state has been selected. Click Next.
    Image
  20. A condition and action is yet again added for the current workflow activity. The Sales Approval workflow activity as mentioned in step 14 is not listed here as the workflow has not been deployed yet. Click Next.
    Image
  21. Add a participant(s) and click Finish.
  22. Drag Placeholders into the rest of the outcomes as we don’t need to configure those for the purpose of this exercise.
    Image
  23. Save and deploy the workflow.
  24. Edit the Sales Form and navigate to the Rules step.
  25. Select the Workflow Task state and edit the When the Form is Initializing rule.
  26. The newly created conditions and actions are listed for the workflow activities used in the workflow.
    Image
  27. Select the if current Workflow Activity is Manager Approval condition and add the actions as shown below.
    Image
  28. Select the if current Workflow Activity is Sales Approval condition and add the actions as shown below.
    Image
  29. Click Finish to save the rule.
  30. Click Finish to save the Form.
  31. Run the Form.
  32. Provide information in the Sales Item View and click Create.
  33. Open the worklist of the participant who will receive the Sales Approval worklist item and open the related worklist item.
  34. Note that the Manager Notes fields are hidden and the Sales Notes fields are displayed.
    Image