04-11-2017 12:35 AM
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]
04-13-2017 08:52 PM
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
04-13-2017 08:52 PM
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
04-14-2017 04:03 AM
Hi Douglas,
Thank you to pointing out -- to that blog.
Explore our Alfresco products with the links below. Use labels to filter content by product module.