| | | |
| | InfoPath Design ConsiderationsKB Number:KB000193Date Published:8/3/2011 2:58:20 AMDate Modified:8/3/2011 2:58:20 AMIntroduction | | Special consideration is required when using a single InfoPath document in multiple workflow processes. This document is intended to explain the design considerations required to successfully implement an InfoPath workflow solution that uses a single form with multiple views in in two processes. |
 | Note: This document assumes some familiarity with setting multiple views and rules in Microsoft InfoPath 2007. |
Implementation Example | This is a basic scenario that uses a single InfoPath document in two workflow processes. Process 1 - The Parent ProcessThe first process will be started normally using a typical InfoPath view. Once the basic approval cycle has been completed, an IPC event will be used to start the second process to continue the approval process. To keep it simple, standard naming conventions will be used for Client activities and InfoPath views that will make it easy to match them up, for example: Activity Name | InfoPath View Name | | Approval - View 1 | View 1 | | Approval - View 2 | View 2 | | Approval - View 3 | View 3 | | Approval - View 4 | View 4 |
"Parent Process" Design:  [Figure 1. Parent Process Design]
Deploying the "Parent Process" will insert the following set of rules into the InfoPath document:
 [Figure 2. Rules after deploying the Parent Process]
The rules can be viewed in design mode of the InfoPath form template by clicking the Design button on the Workflow Form Templates page of the InfoPath Integration wizard after the process has been deployed. The rules allow multiple activities to use different views in a single form template. Process 2 - The Child Process"Child Process" design:
 [Figure 3. Child Process Design]
Deploying the "Child Process" will insert the following set of rules into the InfoPath document:
 [Figure 4. Child Process Rules]
Notice that the previous set of rules have been removed and replaced by the above set of rules. This is expected behavior. Only rules that contain "Set Workflow Task Action" as part of the name will be removed and replaced by the current configuration of the process. Custom rules will not be changed or removed.
Deploying the "Parent Process" will remove the rules above and replace them with the set of rules highlighted in Figure 2. Design ConsiderationsConfirm that the InfoPath document is published with all the required rules by checking the following: - Open the InfoPath Integration process wizard properties and compare the file location details for both the Parent and Child process. Both processes should reference the same document
Parent Process Settings: |  | Child Process Settings: |  |
- From the Data Browser compare the XML Field names. The XML Field contained by both processes should have the same name.
Parent Process Settings: | Child Process Settings: |  |  |
- Make a list of Views used in the two processes to identify the Views that were used in both the parent and child processes as well as the ones that is only used in the child process
Parent Process | Child Process | | View 1 | View 2 | | View 2 | View 4 | | View 3 | |
NOTE: Based on the example, we can see that the rule for "View 4" will be lost once the parent process is deployed.
 | Note: View 2 is a common View that is used by both processes. To insure that the rule representing this view is configured correctly, the same XML Element should be used in the document representing the Action field. |
- Configure the Child Process. This will update the InfoPath document with all the correct settings required for the actions and rules to work properly, as well as change the corresponding controls to Dropdown Lists. The view used in the Child Process but not in the Parent Process (View 4) and the associated rule will be removed as part of the configuration of the Parent Process. To make sure that the rules do not get removed, follow the steps below:
Step 1: Rerun the InfoPath Integration wizard. To open the InfoPath template in design mode, click the Design button on the Workflow Form Templates page.

Step 2: From the Tools menu, select Submit Options and then click the Rules button. Verify that the controls representing the Action on the views used for the Child Process have been updated and changed to a dropdown list.
Step 3: Save and Close the InfoPath document. In Visual Studio a message will be displayed stating that the document has been updated.
- For the Parent process, follow the steps below:
Step 1: Rerun the InfoPath Integration wizard. To open the InfoPath template in design mode, click the Design button on the Workflow Form Templates page.

Step 2: From the Tools menu, select Submit Options and then click the Rules button. Notice that the existing rules are configured, these are configured for the Views used in the Child Process. From the list of Views used in the table above identify the Views that are not used in the Parent Process.
Step 3: Rename the rules to ensure that they do not get removed, as an example rename “Set Workflow Task Action 4” to “Child Process View 4.”
Step 4: Repeat the above step for additional Views identified.
Step 5: Close the Rules dialog and save the document before closing InfoPath, in Visual Studio a message will be displayed stating that the document has been updated.
Step 6: To verify that the correct rules are inserted in the InfoPath document before actually deploying the process, open the file system location of the document via Windows Explorer, right- click on the InfoPath document and select Design. From the Tools menu, click the Submit Options followed by clicking the Rules button.
Step 7: Review the rules as displayed in the dialog to verify that each View used in the solution has a corresponding rule.

 | Note: "Child Process View 4" has not been removed as part of the configuration of the Parent Process. All rules that contain "Set Workflow Task Action" will be replaced during the configuration; renaming the rule will ensure that these rules remain. |
Step 8: If all the rules are present close the InfoPath document and deploy the Parent Process in the K2 Designer for Visual Studio.
- Create a new process instance and test the solution.
 | Note: Existing process instances will not be affected by the changes, and you will need to create a new process instance before testing. |
|
| |
| | | |
|
| | | |
| | PRODUCT K2 blackpearl K2 blackpoint
APPLIES TO Microsoft InfoPath | |
| | | |
|