02-27-2017 06:05 AM
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
02-27-2017 07:09 AM
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.
02-27-2017 12:01 PM
Hi Axel Faust,
Thanks for your reply can give some reference or sample to disable that , I don't want disable
Thanks
Param
Explore our Alfresco products with the links below. Use labels to filter content by product module.