Turns out you do not need it!!!
Just so you know, the number is a serial number that is generated for the event instance. In the past others have tried to find out how it is generated (including myself) and came to the conclusion that it was not possible and that I need to move on :-)
However what you need is a common thing. If you noticed the InfoPath xml with all the funky random information is deleted from the library when the infopath client event completes but the XML value is still in the K2 process instance. So all you need to do is add the SharePoint Document event. Select Upload Documents. Then on the Upload Documents step, press the down arrow next to the Add button and select K2 Field. Then on the Document Upload Source select the elipse, find the XML Fields node, select the top most node of the XML document (screenshot 1). Then fill out the rest of the wizard selecting the destination document library. When you assign the name for the file you are uploading, make sure you use put ".xml" right after the unique name (screenshot 2).
Jason
Hi Jason,
many thanks for spelling this out, I've been having exactly the same problem as Simon
Martin
thanks Jason, that's worked perfectly!
Simon