cancel
Showing results for 
Search instead for 
Did you mean: 

bindPropertyBehaviour not functioning correctly

hagak
Champ in-the-making
Champ in-the-making
I set up the following Behaviour


this.onUpdateProperties = new JavaBehaviour(this, "onUpdateProperties", NotificationFrequency.TRANSACTION_COMMIT);
this.policyComponent.bindPropertyBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onUpdateProperties"), QNAME_TYPE,this.onUpdateProperties);


And the method this.onUpdateProperties is never called when any property of the QNAME_TYPE is modified.  Is there something that I am doing incorrectly?  I have been succesful with other behavious such as onDeleteNode, onCreateNode and onCreateAssoc, and onDeleteAssoc, nit not the "onUpdatePropertietis".
6 REPLIES 6

romschn
Star Collaborator
Star Collaborator
Can you try changing the frequency to EVERY_EVENT and see the result? also, can you try binding the behavior this way and see if it works for you or not.

 policyComponent.bindClassBehaviour(OnUpdatePropertiesPolicy.QNAME, ContentModel.TYPE_CONTENT, OnUpdateProperties); 

hagak
Champ in-the-making
Champ in-the-making
Interesting the bindClassBehaviour works.  Why does the bindPropertyBehaviour not work?  Is this something broken in Alfresco or am I misreading the Javadocs?

hagak
Champ in-the-making
Champ in-the-making
Note I did try EVERY_EVENT with the bindPropertyBehaviour and no result.

romschn
Star Collaborator
Star Collaborator
Glad it worked for you. You may want to debug through to find out why bindPropertyBehaviour is not working/at which point it is failing while execution. This will help us to know if something is broken or not.


hagak
Champ in-the-making
Champ in-the-making
Well I can tell you that the callback is never happening which makes me think it is not binding the event correctly.  I would have to get into the alfresco code to figure why this is the case if it appears that my code is registering the bind event properly.

s_palyukh
Star Contributor
Star Contributor
I have the same issue on Alfresco Enterprise 4.1.5.

bindClassBehaviour and bindAssociationBehaviour methods work correctly, but registerPropertyBehaviour doesn't work…