I recently encountered a situation with a customer where they used InfoPath processes in their environment and I noted that they had a large growth in their K2ServerLog database even though the number of process instances was relatively small.
Now this was puzzling until I did the math here.
e.g. 2000 form instances. Each form has on average roughly 200KB attachments per form. The process had a couple of approval stages and has about 2-3 slots per stage. Let's assume a figure of 7 slots here. Including the process instance data, this would result in 8 copies of the form data.
Also note the following:
- The InfoPath client event makes a copy of the InfoPath document per slot
- InfoPath file attachments need to be base64 encoded. This roughly multiplies the attachment size by 1.37 times.
This leads to 2000 X 200KB X 1.37 X 8 = 4.18GB of data.
Now this is a hefty size to manage for just 2000 instances (and it just multiplies as the process gets more complex and the number of instances grow over time).
If you are interested in finding out the table usage in your own K2 environment, you can run this following useful command on your K2ServerLog database.
EXEC sp_MSforeachtable @command1=”EXEC sp_spaceused ‘?’”
So from an InfoPath standpoint, putting in file attachments to the form is quite bad for storage purposes. Now there is a good workaround that involves SmartObjects. Basically the idea is to detach the file data from the form and store the attachment in a SharePoint document library. Once this is done, you can basically store only the document URL link into the InfoPath form.
Eric has a nice video of how this is done. It even has a sample form with the necessary rules required. However, it doesn't show you how to handle multiple attachments and how the initial configuration is done (which might be confusing for newbies).
I have created a document which shows how all this is done (with explanations) from the ground up. In conjunction with Eric's video, I hope this helps anybody out there who is looking at implementing this solution.
Enjoy!
Posted
Tue, Nov 3 2009 6:05 PM
by
johnny