Recursive overview of Rules in Alfresco

During an implementation project, more and more Rules are added into the Spaces structure. Some act recursively, some act on the Inbound event, some add an Aspect… How to keep the overview of what is happening where? I frequently use this presentation template (in Alfresco Explorer) to find out how the Rules are set.

(I guess the credits for this template go to the Alfresco wiki, but I cannot find the exact page.)

  1. Store this script at Company Home/Data Dictionary/Presentation Templates
  2. Go to the detailed view of a Space (the script goes recursively down the Spaces-tree from here). In the Custom View area (top section), apply a new view by selecting the icon next to trash in the right upper corner, or enlarge the section and select Apply template
  3. Select the template you just added in step 1 from the pull down list, and confirm your selection.
  4. In the detailed view as well as the default view the new template can be visible (toggle by selecting the grey triangle before Custom view. (It can be removed again in the Detailed view.).

The result could look something like:

The following Freemarker template does the trick:

<tr>
<td align="left">0) &gt; . ${node.properties.name}</td>
<td align="center">
<!-- traverse childs in ruleFolder (type name="rule:rule" from ruleModel.xml) -->
<!-- traverse child-assocs type name="act:compositeaction" from actionModel.xml -->
<!-- traverse type name="act:action" from actionModel.xml -->
<table><!-- traverse systemfolders met Rules from ruleModel.xml-->
<tbody>
<tr>
<th colspan="2">${t.properties["cm:title"]!"no title"}</th>
</tr>
<tr>
<td>RuleType:</td>
<td>${rt}</td>
</tr>
<tr>
<td>Asynchronously:</td>
<td>${t.properties["rule:executeAsynchronously"]?string("yes","no")}</td>
</tr>
<tr>
<td>ApplyToChildren</td>
<td>${t.properties["rule:applyToChildren"]?string("ja","nee")}</td>
</tr>
<tr>
<td>Disabled:</td>
<td>${t.properties["rule:disabled"]?string("yes","no")}</td>
</tr>
<tr>
<td>Type trigger</td>
<td>${param.properties["act:parameterValue"]!""?split("}")[1]?cap_first}</td>
</tr>
<tr>
<td>Add Aspect</td>
<td>${param.properties["act:parameterValue"]!""?split("}")[1]?cap_first}</td>
</tr>
<tr>
<td>Execute Script</td>
<td>${child.name}</td>
</tr>
<tr>
<td>Type trigger</td>
<td>${param.properties["act:parameterValue"]!""?split("}")[1]?cap_first}</td>
</tr>
<tr>
<td>Add Aspect</td>
<td>${param.properties["act:parameterValue"]?split("}")[1]?cap_first}</td>
</tr>
<tr>
<td>Execute Script</td>
<td>${child.name}</td>
</tr>
</tbody>
</table>
nee</td>
</tr>
<table border="1">
<tbody>
<tr>
<th> Name of space</th>
<th>Rule Info</th>
</tr>
</tbody>
</table>

Advertisements

1 Response to “Recursive overview of Rules in Alfresco”


  1. 1 bgm21vi March 7, 2011 at 10:58

    Dear Sir!

    Thank you for your friendly support of the Alfresco community. Unfortunately I have, some problems with the Template, Recursive overview of Rules in Alfresco. Every time appears as result:
    0) > .

    Could it be that I make a general mistake?

    I am grateful for each assistance for this problem


Comments are currently closed.