You are viewing limited content. For full access, please sign in.

Question

Question

Workflow adding document as new Version

asked on March 21, 2014

Hey,

 

Quick question from a customer - Is it possible to make Workflow add documents as a new versions, if it finds an existing document with the same name? I am aware that Workflow contains activities for placing a document under version control and retrieving document versions but as far as adding is this possible?

 

Thanks! - Dom

0 0

Answer

SELECTED ANSWER
replied on March 21, 2014

Hey there,

 

This can be done using SDK script. The code is long and the rules are many... I've done this for a customer already.

 

Rather than check the full name, document names can have the entry ID in them when exported:

 

Contract - Oil Rig Project {12312}.docx

 

In our solution, the customer drops the document into a personal folder monitored by Import Agent. Workflow picks up the document and adds the document as the next version (in the example above, of a document with entry id 12312).

 

There are a couple of gotcha's though:

  • Auditing the event. The version will be added by the workflow account.
  • To attempt to give some meaningful audit trail information, workflow picks up the name of the monitored folder and inserts that into the version comments. As the monitored folders are personal, it's named after the user who has access to it
  • Given that the name of the folder is the only real audit trail, the folder must be accessible by only one user. IT have a script that creates personal and secured network folders, so all OK.
  • Finally, the process has potential to be require a lot of recourses on the workflow server. If you consider that most activities can milliseconds then the 5 to 30 seconds it takes to import a version is something worth monitoring any given environment.
  • Handling exceptions, such as documents in use etc are messy. This script was provided as an addition to a solution and is not the main focus of the solution. It's for ad-hoc version control. "Users who regularly work with electronic documents must use full licenses not this method," was my caveat to the customer.

 

-Ben

1 0

Replies

replied on March 21, 2014

Hey Ben!

 

Thanks for the reply - I'm aiming to keep the system pretty quick and wouldn't want to impact server speed, if you only use this from time to time that would differ from the environment in this case, as this process would be occurring daily with about 50+ users initiating the process!

 

The documents are also being saved to Laserfiche via the Office Plugin, not by Import Agent, so I imagine I would have to add an extra step to export the documents out of Laserfiche too right?

 

I will have to think about the impacts it may have before going ahead with any further scripting. At least I know it's possible now though so thanks!

 

Dom

0 0
replied on March 21, 2014 Show version history

Hi Dom,

 

No probs.

 

I'm not sure at what step you envision exporting the documents. In the process I use:

 

  1. Full User: Creates a document in Laserfiche
  2. Limited User: Exports the document out for editing
  3. Limited User: Places the document in the monitored folder
  4. Import Agent: Imports the document to a hold folder in Laserfiche
  5. Workflow: Reads the entry ID from the document name to identify the destination/original document
  6. SDK in the Workflow: Read the document into a System.IO.MemoryStream object
  7. SDK in the Workflow: Updates the original document with the new version from the memory stream. No need to export the document to disk or anything first.

 

It sounds like you're using a very different procedure so I don't know how to answer your question.

 

-Ben

0 0
replied on March 21, 2014

Hi Ben,

 

Sorry I just misunderstood part of the initial response! I thought that as part of the process the document had to be exported first so that it could be imported as a new version. I was thinking about the way in which the Client works for adding "New Documents" into Laserfiche.

 

Excluding the whole export business it seems fairly straightforward (in theory!), may have a play around this afternoon !

 

Thanks again, Dom

0 0
replied on March 21, 2014

No worries. I see you're in Isle of Man. Say Hi to the gang for me ;)

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.