Hi there,

I want to add destination attribute to the current object based on the
results of query.

I've set a local variable to catch this but I'm only getting the first
instance and not subsequent hits from the query:

<rule>
<description>Find Direct Reports</description>
<comment xml:space="preserve">Check to see if a new user is someone's
manager. KM 5/6/13</comment>
<conditions>
<and>
<if-class-name mode="nocase" op="equal">User</if-class-name>
<if-op-attr name="workforceID" op="available"/>
<if-op-attr mode="nocase" name="workforceID" op="not-equal"/>
</and>
</conditions>
<actions>
<do-set-local-variable name="var-directReports" scope="policy">
<arg-node-set>
<token-resolve datastore="dest">
<arg-association>
<token-query class-name="User">
<arg-dn>
<token-global-variable name="idv.dit.data.users"/>
<token-text xml:space="preserve">\</token-text>
</arg-dn>
<arg-match-attr name="managerWorkforceID">
<arg-value type="string">
<token-attr name="workforceID"/>
</arg-value>
</arg-match-attr>
<arg-string>
<token-text xml:space="preserve">association</token-text>
</arg-string>
</token-query>
</arg-association>
</token-resolve>
</arg-node-set>
</do-set-local-variable>
The following is rubbish:
<do-for-each>
<arg-node-set>
<token-local-variable name="var-directReports"/>
</arg-node-set>
<arg-actions>
<do-add-dest-attr-value name="directReports" when="after">
<arg-value type="string">
<token-local-variable name="var-directReports"/>
</arg-value>
</do-add-dest-attr-value>
</arg-actions>
</do-for-each>

The query result is:
> <nds dtdversion="4.0" ndsversion="8.x">
> <source>
> <product edition="Advanced" version="4.0.2.0">DirXML</product>
> <contact>Novell, Inc.</contact>
> </source>
> <output>
> <instance class-name="User" event-id="0"
> qualified-src-dn="O=Meta\OU=Org\CN=5BJuneD"
> src-dn="\META_TREE2\Meta\Org\5BJuneD" src-entry-id="36710">
> <association state="associated">bogus177</association>
> </instance>
> <instance class-name="User" event-id="0"
> qualified-src-dn="O=Meta\OU=Org\CN=5CJuneD"
> src-dn="\META_TREE2\Meta\Org\5CJuneD" src-entry-id="36711">
> <association state="associated">notthere</association>
> </instance>
> <status event-id="0" level="success"></status>
> </output>
> </nds>


In very explicit terms, what is the action XPath to extract the src-dn
from each instance and pump it into an "add-Dest-attr"?

Sorry for XPath newbie question,
Kirk


--
kmaule
------------------------------------------------------------------------
kmaule's Profile: https://forums.netiq.com/member.php?userid=306
View this thread: https://forums.netiq.com/showthread.php?t=47904