cancel
Showing results for 
Search instead for 
Did you mean: 

PolicyComponent and Association Behaviours

bremmington
Champ on-the-rise
Champ on-the-rise
I would like to have some custom behaviour invoked when an association is changed on an item that has a given aspect. I think that I need to use PolicyComponent.bindAssociationBehaviour(QName policy, QName className, QName assocName, Behaviour behaviour) but could use some advice regarding the arguments I need to pass.

I presume that:
- "className" should be the qualified name of the aspect on which the association is defined;
- "assocName" should be the qualified name of the association type as defined on the aspect;
- "behaviour" should be a JavaBehaviour that points at my code.

What I am less clear on is what I should be using for the "policy" argument. I think that the relevant policies are likely to be OnCreateAssociationPolicy and OnDeleteAssociationPolicy, but I have no idea what their QNames are.

Can anyone give me some guidance?


Regards
Brian
1 REPLY 1

bremmington
Champ on-the-rise
Champ on-the-rise
I've worked out the answer to this. The necessary QName is:

- QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateAssociation") for the create association notification

- QName.createQName(NamespaceService.ALFRESCO_URI, "onDeleteAssociation") for the delete association notification


Regards
Brian