From within a K2 Process the fields from an InfoPath form can be updated by accessing the InfoPath XML Field from the K2 Object Browser.
When trying to do this from within an activity containing an InfoPath client event, you will find that your changes are not being persisted to the InfoPath form when the activity completes. This happens because each destination user gets their own copy of the InfoPath XML which they interact with at an Activity Instance level. When the activity completes, the XML is copied back to the Process-level XML field. When you have a data event in the same activity as an InfoPath Client Event, use the Activity-level XML field values when trying to read/write to the InfoPath form. This ensures that when the activity completes, your changes are persisted to the InfoPath form when the next person opens their InfoPath form.
You only need to do this on any event after a InfoPath Client Event, just before an InfoPath Client Event or in an activity without any InfoPath Client Events you should continue using the Process XML field.
Mon, Apr 16 2012 6:05 PM