From my own personal experience and hearing the frustration of others, there are some times when integrating an InfoPath form that it won’t display the correct view on certain activities. Usually, this is a random occurrence and will result in the form displaying the default view instead of the desired one.

Well, now, this problem can be resolved with a very easy fix! More then likely, at one point in the process, you were creating views, and either created, renamed or deleted a view. As a result of this, entries should be either modified in the manifest.xsf of the Form template. However, for some reason, this doesn’t always occur and will cause inconsistencies.

If you are experiencing the problem of the correct view not displaying, more then likely a RULE is not configured properly in the open behavior of the form. To verify this, you can go to the form option and select the Open and Save category from the options and select the Rules button in the Open behavior section. This will give you a list of rules that will fire upon opening of the form. K2 sets these rules based upon your configuring of the InfoPath client event in each activity.  While you have these rules open, copy the template file from the K2 InfoPath Form Template folder and rename it with a .cab extensions. This way, you can extract out the manifest.xsf file locally.  Search for the ruleSet section named "ruleSet_OnLoad” and you will more then likely see a discrepency between the rules displaying in the form options and the ones in the manifest.xsf.

The Fix (K2 blackpearl or K2 blackpoint)

Here are the steps you need to take to resolve the problem:

  • Open up the InfoPath Integration process wizard in either K2 blackpearl or blackpoint
  • Click on the Design button
  • When the form loads, go to Tools/Form Options select the category Open and Save
  • Click the Rules button under the Open behavior section
  • Select one of the rules and select “Modify”.
  • Click OK
  • Click OK again until you are out of the Form Options
  • Save the form
  • Close the form
  • K2 will tell you the form template has been successfully been updated

What this does is resets the rules for the form options and cleans out the ones that are empty in the manifest. (I actually added an generic rule and then went back and deleted it and this also force the form to refresh).

At this point, you can go back to the InfoPath client events and associate the event with the correct view and finish the wizards. If you go back and open the form, it should have the new rules associated with the views that you just associated with in the wizard.

Deploy the process as usual.