Hi,
I'd like to bind a behavior to a custom property update policy.
The issue is that the callback function is never called.
I'm likely not using the appropriate policy, but I can't find any example on this.
Binding behavior to a custom type or aspect is working fine.
Code used:
private PolicyComponent eventManager;
...
// this works
eventManager.bindClassBehaviour(NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME, MY_QNAME_URI.ASPECT_BUSINESSPROPERTIES, new JavaBehaviour(this, "onUpdateProperties", Behaviour.NotificationFrequency.TRANSACTION_COMMIT));
// this does not work (onUpdateProperties2 never called)
eventManager.bindPropertyBehaviour(NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME, MY_QNAME_URI.ASPECT_BUSINESSPROPERTIES, MY_QNAME_URI.PROP_VENDORID , new JavaBehaviour(this,"onUpdateProperties2", NotificationFrequency.TRANSACTION_COMMIT));
...
public void onUpdateProperties(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after) {...}
...
public void onUpdateProperties2(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after) {...}
Any suggestion / example on how to use bindPropertyBehaviour ?
Thanks,
Vincent
Solved! Go to Solution.
You simply cannot bind onUpdateProperties on any specific property. The interface OnUpdatePropertiesPolicy extends from ClassPolicy,and thus does not support use of the bindPropertyBehaviour operation. In fact, there current does not exist ANY policy which extends from PropertyPolicy, and thus the operation bindPropertyBehaviour is not supported for any policy. The concept of a PropertyPolicy and binding on individual properties was an architectural idea / concept which was implemented "in case" it was needed in the future, but was - as far as I know - never utilized by any feature.
You simply cannot bind onUpdateProperties on any specific property. The interface OnUpdatePropertiesPolicy extends from ClassPolicy,and thus does not support use of the bindPropertyBehaviour operation. In fact, there current does not exist ANY policy which extends from PropertyPolicy, and thus the operation bindPropertyBehaviour is not supported for any policy. The concept of a PropertyPolicy and binding on individual properties was an architectural idea / concept which was implemented "in case" it was needed in the future, but was - as far as I know - never utilized by any feature.
Clear. Thanks.
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.