Document management in workflow


Badge +7

Hi Guys,

 

I have created a custom service broker that takes values from SmartForm entries and creates a document using the novacode docX classes.

 

So far so good but I don;t know how to process the bytestream in K2.

 

Ideally I want to create an attachment and add it to a mail event in studio. I don't really need to store the document as it will be stored by the recipient of the email in another system.

 

Having said that, the easiest way I can see would be to store the file in a database, create a smartobject for it and pass the row referrence in a datafield to studio in order to grab the blob and do something with it.

 

My question is really a discussion around this approach, does anyone feel this is completely the wrong approach for example?

How would you do it?

 

Thanks

 

 


2 replies

Userlevel 1
Badge +4

MrSafe,

I believe this is a good pattern that is used by other service brokers that create documents.  Here are some positive points:

 

  • Can augment the document with other fields you might need for the document management system
  • Store error or logging information on error
  • Failes safe so you can recover
  • Would allow users to see status for "partially" processed documents (for long running operations)

 

I also use this pattern for any multi step form submittions in K2.  This allows the user to partially complete the request or submittion and pick up where they left off.  Or at the very least let me know when people are only half finishing things.

 

Nathan

 

Badge +7

Byte stream is base64 with a couplke of tags for decoration, I ended up using the k2 file upload object in the end:

 

http://help.k2.com/onlinehelp/k2blackpearl/devref/current/default.htm#working_with_smartobjects_updload_file.html

 

Thanks for the input. 

Reply