cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing variables before and after a node update.

zezom
Champ in-the-making
Champ in-the-making
Hi,
I am trying to create a script which will run when a node is updated via "manage content rules" -> "Execute script".
I would like to know if there is a way to access the variables of a node which is being updated both "before" and "after" the update.
The reason is I need to know which variable is being updated for this particular script is because I need it to execute only when one type of node property is changed.

Thank you for any help on this.
1 REPLY 1

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
Hi zezom,

You can do so using JavaPolicies instead of rules… Check the OnUpdatePropertiesPolicy interface you would need to implement. You will need to implement the onUpdateProperties method which specification is the following:


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

Another option could be enabling versioning for property updates and access the previous version's metadata.