Create rules programmatically

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

Create rules programmatically

Hello,

I want to create/assign hundreds of rules and i don't want to create/assign for every folder manually. How can i do this programatically? Are there any config file where i can define them?

PS: I'm using Alfresco Community - 5.2.0.

5 Replies
angelborroy
Alfresco Employee

Re: Create rules programmatically

This answer is still valid (afaik): https://community.alfresco.com/message/636634-re-how-to-create-rule-for-aspect-programmatically?comm... 

Hyland Developer Evangelist
radugabi93
Member II

Re: Create rules programmatically

And where should i place that code?

angelborroy
Alfresco Employee

Re: Create rules programmatically

This code is from the Java Foundation API, you can deploy it by using an Alfresco SDK project.

If you feel more comfortable, the same can be achieved also by using REST API.

Hyland Developer Evangelist
radugabi93
Member II

Re: Create rules programmatically

Sorry for my lack of knowledge but:

1) Do you have any tutorial about how to use/create an Alfresco SDK project?

2) I heard that REST API is deprecated, and i can't find a method for rules in here https://api-explorer.alfresco.com/api-explorer/

Repository REST API Remote
This is the older deprecated REST API based on web scripts. You should use the new REST API, which consist of the CMIS REST API and the Alfresco REST API.

DEPRECATED: use REST API instead.

angelborroy
Alfresco Employee

Re: Create rules programmatically

Best tutorial on how to start with Alfresco SDK is https://ecmarchitect.com/alfresco-developer-series-tutorials/maven-sdk/tutorial/tutorial.html from Jeff Potts

Currently, the new REST API (based in Swagger/OpenAPIs and available at api-explorer website) does not include rules support yet. You should use the old REST API to manage rules. Although this old REST API is deprecated, it will be available for a year or two.

Hyland Developer Evangelist