cancel
Showing results for 
Search instead for 
Did you mean: 

Define rules inside a script

blackout
Champ in-the-making
Champ in-the-making
Good day everyone,

simple question as stated in the subject: is it possible to define rules inside a script?
I'm asking this because I'm using a script to create a template into "Company Home" -> "Data Dictionary" -> "Space Templates" folder, so that I can pack up everything for an easier deploy on other machines.

Thanks
3 REPLIES 3

kevinr
Star Contributor
Star Contributor
There is no API to do this no. However, in theory it is possible as rules (like 99% of all objects and concepts in Alfresco) are defined as nodes, aspects and properties. Therefore you would need to work out how rules are defined as aspects/properties and create the same objects against your space nodes. It will probably take some investigation!

Thanks,

Kevin

kevinr
Star Contributor
Star Contributor
Actually that's not quite true. You need the createAssoc() method support added to the JavaScript API in Alfresco 2.1 to create the associations between the rule/action nodes. So the answer is "yes you can in Alfresco 2.1, but it's still quite involved" Smiley Happy I expect we will wire up specific method to call the RuleService from JavaScript in a later release also.

Thanks,

Kevin

blackout
Champ in-the-making
Champ in-the-making
Looking forward for it Smiley Very Happy

Thanks