I'm working on a creating a scripted rule for a folder that should update a counter (integer) property defined on an aspect associated with the folder.
The idea is that someone drops a file/document into the folder, some business logic runs then the document is moved to another folder. The final steps read the current value of the "counter", increments that value by 1, then saves the value.
Is there a way to ensure that if 2 or more documents are dropped into the folder at the same time that the counter is updated correctly? If Alfresco is running the rule for each of the dropped documents concurrently, is it possible that they obtain the same current value of the counter and then increment it, causing the counter to have the wrong value?
Solved! Go to Solution.
As long as you do not specify that your rule(s) run "in the background", then the rule(s) will be run sequentially (in the order they are triggered, not the order they are listed in the "Manage Folder Rules" action). Any rule run in the background (asynchronously after commit) may run concurrently with other such rules (or may not - depending on how much load is on the system and if asynchronous processing threads are sufficiently available).
As long as you do not specify that your rule(s) run "in the background", then the rule(s) will be run sequentially (in the order they are triggered, not the order they are listed in the "Manage Folder Rules" action). Any rule run in the background (asynchronously after commit) may run concurrently with other such rules (or may not - depending on how much load is on the system and if asynchronous processing threads are sufficiently available).
Thanks Axel Faust. That answers my question.
The folder rule will help for the near future. I may try re-implementing this as a behavior for version 2 of this solution.
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.