cancel
Showing results for 
Search instead for 
Did you mean: 

Which policy to implement for this behavior ?

zomurn
Champ in-the-making
Champ in-the-making
Hi,

I coded a policy very similar to the SDK example "customAspect". The problem is : can we apply the policy "onUpdateNode" recursively ?
My case :

inside userhome folder I have the folder of an alfresco registered user, call it "manager".
Inside "manager" folder I have two folders : "Mail" and "Wait".
For "Mail" and "Wait" folders, they have incoming documents from somewhere. Everytime these nodes are updated, the policy "onUpdateNode" is called which keep up to date the "counter" property of "countable" aspect applied on each folder. That's good !
The same policy is applied to "manager" folder to keep up to date the total number of document (sum of "Mail" and "Wait" counter).
But when I directly move a document into "Mail" for example, only the policy of "Mail" folder is called and NOT the one of "manager" where as the "Mail" has been updated internaly (one document arrived) and even renamed as "Mail(1)".
I need that from one move of document into "Mail" , the "Mail" and "Manager" folder have their "counter" property updated (=> calling two times the policy for one move only).

Thanks for your help !
2 REPLIES 2

zomurn
Champ in-the-making
Champ in-the-making
I'am afraid that I need to code it manually…but on the other hand, it prevents from executing as many transactions as necessary.

zomurn
Champ in-the-making
Champ in-the-making
Hello,

I'am wondering which policy to implement for the following event : fileFolderService.move(srcRef,destRef,newname);
The scenario is folder A contains MyDoc.pdf
And MyDoc.pdf if moved to B which has the aspect cm:countable.
And I have a behavior linked to this aspect but it never executes ! Why ? I tried to implement onUpdateNodePolicy but after the move, the method overrided named onUpdateNode is never called ?
Which is the policy to implement ?

Thanks