Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to enable/disable Alfresco folder rules using JavaScript
var context = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
var ruleService = context.getBean('RuleService', Packages.org.alfresco.service.cmr.rule.RuleService);
logger.warn("Before disabling: " + ruleService.isEnabled());
logger.warn("Disabling rules");
ruleService.disableRules();
logger.warn("After disabling: " + ruleService.isEnabled());
try {
logger.warn("Nothing to see here!");
} finally {
logger.warn("Before enabling: " + ruleService.isEnabled());
logger.warn("Enabling rules");
ruleService.enableRules();
logger.warn("After enabling: " + ruleService.isEnabled());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.