marieno2 wrote:

> I have a hierarchy of objects in my directory and when a
> specific attribute is updated on my object at the top of the hierarchy,
> I want to do the same updates on my root object than on all objects in
> the hierarchy.
> Is it possible with a DirXML policy and if yes how to do it?


<rule>
<description>Clone description changes to whole subtree</description>
<comment xml:space="preserve">Use in a subscriber event/command transform
policy (e.g. on a NULL driver)</comment>
<conditions>
<and>
<if-op-attr name="Description" op="changing"/>
</and>
</conditions>
<actions>
<do-for-each>
<arg-node-set>
<token-query datastore="src">
<arg-dn>
<token-src-dn/>
</arg-dn>
</token-query>
</arg-node-set>
<arg-actions>
<do-set-local-variable name="current-object" scope="policy">
<arg-string>
<token-local-variable name="current-node"/>
</arg-string>
</do-set-local-variable>
<do-for-each>
<arg-node-set>
<token-removed-attr name="Description"/>
</arg-node-set>
<arg-actions>
<do-remove-src-attr-value name="Description">
<arg-dn>
<token-text xml:space="preserve">$current-object$</token-text>
</arg-dn>
<arg-value type="string">
<token-text xml:space="preserve">$current-node$</token-text>
</arg-value>
</do-remove-src-attr-value>
</arg-actions>
</do-for-each>
<do-for-each>
<arg-node-set>
<token-op-attr name="Description"/>
</arg-node-set>
<arg-actions>
<do-add-src-attr-value name="Description">
<arg-dn>
<token-text xml:space="preserve">$current-object$</token-text>
</arg-dn>
<arg-value type="string">
<token-text xml:space="preserve">$current-node$</token-text>
</arg-value>
</do-add-src-attr-value>
</arg-actions>
</do-for-each>
</arg-actions>
</do-for-each>
</actions>
</rule>