AnsweredAssumed Answered

Format property before commit using Behavior

Question asked by vincent-kali on May 25, 2019
Latest reply on May 27, 2019 by vincent-kali

I'd like to ensure that a given property is always set as uppercase string.

I tried to use a java Behavior to update property value before commit, but this has no effect (see below). 

Any 

 

 

behavior declaration:

<code>

eventManager.bindClassBehaviour(
NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME,
myModel.myAspect, 
new JavaBehaviour(this, "onUpdateProperties", Behaviour.NotificationFrequency.FIRST_EVENT)
);

...

public void onUpdateProperties(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after) {

// modifying property value of 'after' map has no effect

}

</code>

 

Idea suggestion ?

 

Thanks

Outcomes