Monday, November 26, 2007

Voyages with BlackPearl - 1. KPRX size

I've create a process in K2 BlackPearl that is quite large. The file size of the KPRX is about 8MB. The trouble is that every time I save it, even if I make no changes, the file size increases - this is with Hotfix 2.01 applied.
I started investigating and found that some redundant nodes are created when a KPRX file is saved. These nodes are used to define the layout of lines and activities but ghost copies are created every time you save.
These nodes are:
/Process/Views/DocumentView/LinesLayoutData/DocumentViewLineLayoutData and
/Process/Views/DocumentView/ActivitiesLayoutData/DocumentViewActivityLayoutData
Each time I save the KPRX I found that it created another copy of the nodes, each has a different Guid but the Name element (amongst others is blank).
This may sound trivial but with some 25 activities and over 50 lines each time I saved the KPRX it would increase the file size by 100KB.
So I wrote a utility that iterates through all these redundant nodes and removes them from the KPRX. I've used it many times and it has no adverse effect on the KPRX file, but the benefit is that it loads quicker and is less likely to give me an out of memory error.
If you want a copy of this KPRX cleaner ping me an email and I'll send it to you. It's a simple .Net Windows application that will prompt for the location of your KPRX file and creates a copy of the cleansed version.

No comments: