Skip to main content

Hi.
I was wondering if it's possible to read the process template from the K2 Server. I know it's possible to get the export XML by opening one process in K2 2003 Studio and clicking Tools -> Export Process XML, but this must be done manually and only one process at a time. I need to do this programmatically to generate documentation and images from over 200 processes. The "K2 export" program at "K2 blackmarket" could be a good solution if it was possible to get the export XML instead of specifying a K2 server.  


Does anyone have a solution for this?


 

Hi jsk,


To be honest, I haven't played with this yet but have a look at the ViewProcessInstance method of the Connection class of K2ROM.  If this does not suffice, also have a look at the XML generated by the ViewFlow component.


HTH,


Ockert


Hi Ockert. First of all, thank you for your response. 


Yes, I have seen these classes, but they require an instance of a process. I need to get the latest process template without creating a instance of a process. How do i get information about the newest process and not creating an instance. In the K2.net 2003 Service Manager it is possible to see Process Version Manager, so the information is present. Is it possible to get the default process?


//JSK


I see the ViewProcessInstance method takes a Process ID as an argument and not a Process Instance ID.  You'll have to play around with this - passing integers of known process versions to the method.  I'm not sure what permissions the user will need - you will probably need to run this as the K2Server Service account.  Once you know that you do get the desired return value by passing a valid Process ID, you can explore the methods in K2Mng to bring back the defined ProcIDs in the database - specifically the Process class' ProcID property.


HTH,


Ockert


PS!  I'm sorry the answer is a bit vague - I'll try to play around with this when time permits.


Reply