AnsweredAssumed Answered

JavaScript for showing/manipulating rules

Question asked by lercherl on Apr 22, 2016
Latest reply on Jun 8, 2018 by msroth
I want to automate a few checks concerning rules (e.g. check whether rules are disabled, apply to subfolders etc.). It seems there is no JavaScript API for showing/manipulating rules. Starting from hints found in this discussion:
I could do most of what I need to do using the general node API. Starting from the rule folder and recursively traversing its children I can find all the rules, its conditions, actions and parameters.

But there is one exception: If a rule executes a script I cannot get the UUID or some other unique identifier of the script. Here's an example: I list all of the nodes' properties and find one like this:

{}node-dbid: 239416
{}parameterName: script-ref
{}parameterValue: Node Type: {}content, Node Aspects: [{}indexControl, {}versionable, {}auditable, {}referenceable, {}localized]

The value of the parameter named "script-ref" is not a reference to a script, but rather a list of its aspects. This is very strange, since querying the database directly gives the node UUID as expected:

select q.local_name, p.string_value from alf_node_properties p, alf_qname q  where p.qname_id = and p.node_id = 239416;
   local_name   |                         string_value                        
parameterValue | workspace://SpacesStore/f1a5113c-8a95-497d-aac1-378f41e9b547
parameterName  | script-ref

Is this a bug or a feature?