Update, Outcome and Infopath Data

  • 27 December 2007
  • 1 reply
  • 0 views

Badge +3

One of the things that looked intriguing and as an improvement over 2003 was the use of of "update outcomes" rather than having to use looping lines as one did in 2003.  However, in my testing of update outcomes it seems that the infopath data is not retained upon update (i.e user input data is wiped blank in form after each update).  Obviously, this won't work.. When I tested using a looping line of type "finish outcome", data was retained in the form as desired/expected.


 Question: Why does this happen?  Is it by design, a bug, or am I doing something wrong?


 Thanks,


Jason


1 reply

Badge +9

I believe this is specific to InfoPath forms integration.  To answer your question I think it helpful to understand how K2 handles InfoPath files without the new Update functionality.  As I understand it, when a K2 process in integrated with an InfoPath form that is published to a MOSS Form Library, K2 creates the actual XML instance of the InfoPath form on the fly when the InfoPath client event is reached within the activity.  At this point, there is a physical XML document residing within a SharePoint Form Library.  When the destination user opens this form (via the emailed link, K2 workspace or directly from within SharePoint) and enters data, selects an action (at this point we are not discussing 'Update' yet) and clicks Submit, K2 will finish this client event and check to see if this activitiy instance is complete.  This is handled within the Activity Succeeding Rule.  If K2 determines this activity instance is complete, then it will "clean up" (i.e. delete) the InfoPath XML documents it created in the SharePoint form library.  Thus the only times K2 actually touches the physical InfoPath XML documents is at creation within the Client Event and clean up within the Activity succeeding rule.


Ok, now to factor in Update... when the Update action is used, it will save the data back to K2 and that's it.  It does not force the succeeding rule to execute because the infopath client event is still active.  In my recreation of your scenario I can open a infopath client event task, modify some data on the form and  i select Update then Submit.  If I then go to K2 workspace and view the XML data for this process instance (either via the Worklist, or reporting) i see the updated data, which confirms the XML is being sent back to K2.  However if i look at the file in the SharePoint form library it has not changed.


Now let's compare to the "looping" scenario you mention.  If you create an Action/Outcome called "Update", when selected it will be treated just like any other action which means it completes the individual task and then forces the activity instance succeeding rule to fire.  If it determines this activity instance can be completed (which would probably be the case), K2 then automatically cleans up the XML files it created in the Form Library.  It will then follow the loop back outcome line to this same activity and then fire the infopath client event.  At this point, the K2 infopath client event creates a new XML file in the SharePoint form library with the updated data.


I hope this answers your question as to why this happens. 


If anyone can fill in any gaps in my explanation and/or correct some areas I may have mis-spoke please feel free to jump in.

Reply