Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Enable a rule and set it to run on sub-folders in Alfresco through CMIS by leveraging cmis:item support in CMIS 1.1
rs = session.query("select R.cmis:objectId from rule:rule as R join cm:titled as T on R.cmis:objectId = T.cmis:objectId where T.cm:title = 'add classifiable aspect'", false)
if (rs.getTotalNumItems() == 0) {
println("Couldn't find a rule that matched your query")
return
}
for (res in rs) {
ruleId = res.getPropertyValueById('cmis:objectId')
rule = session.getObject(ruleId)
props = new HashMap<String, Object>()
props['rule:applyToChildren'] = true
props['rule:disabled'] = false
rule.updateProperties(props)
}
println("Done")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment