Is the "Save to Repository" service task Synchronous? That is, if I save a document to repository in a service task, then immediately run a workflow in another service task, is it possible that the workflow will start while the "save to repository" task is still running? Or can I safely write the workflow to depend on the saved document being present in the repository?
Question
Question
Is "Save to Repository" synchronous?
Answer
Unlike Workflow service tasks, where you can tell Forms either to wait for completion or not, the Save to Repository service task always waits for completion before moving to the next step. I have several Forms processes that save the document and then call a Workflow to act on the document and these are quite successful.
But in many other cases, I have Forms save the document to a central location which Workflow monitors, then it manipulates and moves the document where it needs to go. So Forms isn’t calling Workflow, but the repository trigger events are. This is extremely fast and reliable because Workflow is designed around that and is purpose built for efficiency in that regard.
Replies
Timothy, is the workflow you plan to run after the document is saved in the repository just going to run against that one document or is it gathering multiple documents? Either way, I would create the workflow to have a starting rule to watch a folder that the document will get saved into and so it will kickoff once the document is saved in the repository. My rule of thumb is to have Forms save into some kind of incoming folder and have Workflow move the document where it needs to go. I do that for several reasons, including the fact that Workflow is more powerful with tokens to dynamically move the documents where they need to go as well as I always know that Forms only saves the documents to an incoming folder and not anywhere else. This is important for troubleshooting. If the document doesn't make it to the incoming folder more than likely it is a Forms issue. If the document makes it there but it doesn't move to where I expected, it's probably a Workflow issue. I hope that helps.
Thank you Blake. I like your idea, but in my particular case, it still leaves the potential for timing issues since the forms process saves both the form and supporting documents (of which there will normally be one, but could be none or multiple). Then the workflow has to process both. It copies the pages from the attachments onto the end of the form document.
If I set a starting rule to fire the workflow when the form appeared, I would be afraid that the attachments might not all be present.
In this case, if I learn that "Save to Repository" is not synchronous, I'll have to insert a time delay into the workflow and hope for the best.
So have your Workflow trigger on both documents, the form and any attachments. Put all the same metadata on both, other than one field and make it say something like Form Name on the form and Form Name Attachment on the attachment. Then have your workflow check for that field and handle any slight differences you have with how it needs to be handled. If Forms applied a link between the documents, Workflow won’t break that, even if it is renaming or moving the items.
I have a Workflow I’ve been tweaking and adding to for years that we call our “Member Document Importer”. It’s used to allow staff to scan documents to a central location and Workflow moves and renames it based on metadata (or flags it as an error if some important metadata is missing or doesn’t match to the database). It has something like 70 different paths for handling different kinds of documents and some of those paths are specifically for Attachments. I now send more items from Forms and other automation sources through the Importer than we have staff running through it.
That's the great thing with Laserfiche, there's always more than 1 way to fiche a document.