cancel
Showing results for 
Search instead for 
Did you mean: 

Define an order in which policies are applied

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

I have two modules in my alfresco.
Each one define a policy "onMoveNode".
How to set the order of this "same" policy bind behavior ?
For instance, "execute policy of moduleA first then the one of module2 for the "onMoveNode" policy".

Thx.
2 REPLIES 2

simon_white
Champ in-the-making
Champ in-the-making
*bump*

I know it's been a while, but am wondering if anyone has an answer to this?

I'm trying to write an onContentUpdate policy to reject and audit certain modifications to the Records Management caveat config, which is itself manipulated via an OOB onContentUpdate policy.  Ideally, I'd like to ensure my policy always runs after the pre-existing policy, but I'm not sure this is possible.

I could always change the existing behaviour to do two things, but it seems like it would be cleaner to have the two behaviours in two different classes, as they serve two different business goals.

mrogers
Star Contributor
Star Contributor
I don't think ordering of policies is supported.

If you have a dependency between events I suggest you combine them.

However the way I would approach this is to have the audit done by post commit (so your event just registers a post commit callback),  at that point you know all events have fired.   You also don't audit stuff that gets rolled back.