07-23-2021 06:17 AM
We are making a call from CMIS API to alfresco to upload documents. Here we are having a rule to move documents from document library into different folders based on metadata. As we are uploading files in bulk, rule gets executed concurrently on multiple files. Due to this, it is trying to create the same folder multiple times. As a result, some of the files are not moving into the destined folder. On a few occasions, all the files are getting uploaded correctly and sometimes, only one or two gets uploaded correctly. If the folder already exists, it shouldn't look to create the folder again but it is trying to do so here. In logs, we see the error "File or folder already exists".
07-23-2021 09:57 AM
You might have to use a custom rule script or behavior where you can check whether the folder you are trying to create already exists, if not then create the folder else get the nodeRef of the existing folder on intended path and move the file accordingly.
07-26-2021 03:27 AM
Thanks for your response!
We have a custom rule where we check if the folder already exists or not by using the childByNamePath() in JavaScript. If it returns null, we are creating the folder.
Explore our Alfresco products with the links below. Use labels to filter content by product module.