start new workflow when one of the custom properties of existing document changed.

cancel
Showing results for 
Search instead for 
Did you mean: 
wayi
Member II

start new workflow when one of the custom properties of existing document changed.

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.

2 Replies
douglascrp
Advanced II

Re: start new workflow when one of the custom properties of existing document 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 

abhinavmishra14
Advanced

Re: start new workflow when one of the custom properties of existing document changed.

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. 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)