Hi All,
I am facing a issue not able to disable the afterCreateVersionPolicy in my custom service is not working.
In my project we are defined the policy afterCreateVersionPolicy and doing some bussiness logic, in my custom service i need to execute that policy when node is creating version so i am disabling it through behaviour filter that is not working code as below.
behaviourFilter.disableBehaviour(nodeRef,ContentModel.ASPECT_VERSIONABLE);
Map<QName, Serializable> versionProperties = new HashMap<QName, Serializable>();
versionProperties.put(ContentModel.PROP_INITIAL_VERSION, true);
versionProperties.put(ContentModel.PROP_AUTO_VERSION, false);
version=versionService.createVersion(nodeRef, versionProperties);
even though we disabled the version policy it is executing.
Thanks
Param
With your call to disableBehaviour you are only disabling behaviours for that particular node that have been bound on the aspect cm:versionable. You are not disabling afterCreateVersion itself - you are just disabling any behaviour using that aspect during the call to policyComponent.bindClassBehaviour(). If you want to disable a very specific behaviour, you can use the JavaBehaviour object to explicitly disable/re-enable it.
Hi Axel Faust,
Thanks for your reply can give some reference or sample to disable that , I don't want disable
Thanks
Param
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.