05-01-2019 06:30 AM
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
05-01-2019 07:58 AM
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.
05-01-2019 07:58 AM
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.
05-01-2019 01:37 PM
Clear. Thanks.
Explore our Alfresco products with the links below. Use labels to filter content by product module.