How to make the "documentCreated" event waiting for a blob to be attached before processing
I want to handle routing for documents according to the name of the file they are carrying.
What I done is:
Trigger the creation of a document on the repository with httpAutomationClient when a file is created on the client side AND THEN attach blob to this document
This part works (my file is finding its way to the nuxeo platform)
In the target folder i attached a listener as when a document is created, it's moved to a particuliar target according to it's name.
The problem is as it's configured to be launched for each “documentCreated” event, my blob attach operation is failing as the document is moved and what I get at the end is an empty document :(
Is there a way to ensure there's no more blob attach operation pending on the document before moving it ? Kind of lock or something ?
Thanks and thanks again
I'd say implementing a listener triggered when documentUpdate event is raised and checking if the blob is attached or not.
As mentioned in comments documentModified event allows to trigger the operation when the blob is attached rather than when the document is created.