I need to start new workflow when one of the custom properties of existing document is changed.
Is there any way to execute server-side javascript when editing metadata and how I can get which property changed.
Hello.
If I were you, I would create a custom behaviour, just like described in the following tutorial: Implementing Custom Behaviors in Alfresco | ECMArchitect | Alfresco Developer Tutorials
It will not be appropriate to trigger the workflow from server side js as you will also require to compare the previous and new value for the properties/property. I would suggest to implement a behavior by implementing org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy interface.
This policy provide a method where you can easily compare old and new value on a property.
@Override
public void onUpdateProperties(final NodeRef nodeRef, final Map<QName, Serializable> before,
final Map<QName, Serializable> after) {
....
}
In the above implementation you can add your code to trigger the workflow on value change.
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.