Hi,
I developed a script which triggered when items created or deleted. Its function is only to check whether a folder (container) is having a document (isDocument) or not. I use the traverse/recursive method to check.
After do some iterate checks and read my logs, I found that the behavior on how the sequence of "file/document activities" and "script is executed".
- When items is created, the activities of file created or moved into a directory is running first then the script will run afterwards;
- When items is deleted, the script will run first (and will capture whole the structures), then file activities will run (deleted or move into another places)
With above situations, I have a trouble when there's 1 (one) file inside a folder, I delete it, next the script will run and reported that it's still found one file inside that folder. Instead of no file found in that folder.
If items are created is working fine as expected.
What is the right method or approach of my problem above?
My script is attached.
Thanks,
[bayu]
Solved! Go to Solution.
If what you need is to execute your code only after the node is really deleted, then you should consider using behaviours.
You can find value information about this topic in this blog post Alfresco – Implementing delete behavior | Programming and So
If what you need is to execute your code only after the node is really deleted, then you should consider using behaviours.
You can find value information about this topic in this blog post Alfresco – Implementing delete behavior | Programming and So
Hi Douglas,
Thank you to pointing out -- to that blog.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.