Anonymous_User Absent Member.
Absent Member.
131 views

Re: Recursive policy

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>
Labels (1)
0 Likes
1 Reply
Anonymous_User Absent Member.
Absent Member.

Re: Recursive policy

Lothar Haeger wrote:

> <do-set-local-variable name="current-object" scope="policy">
> <arg-string>
> <token-local-variable name="current-node"/>
> </arg-string>
> </do-set-local-variable>


should be

<do-set-local-variable name="current-object" scope="policy">
<arg-string>
<token-xpath expression="$current-node/@src-dn"/>
</arg-string>
</do-set-local-variable>

of course

--

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.