Hello,
I have a local variable nodeset (resut from query) and a local variable
string.
Now I need to test if the string is part of the nodeset, but my test
only evaluates the first nodeset.
Any idea what I need to change? BTW, I don't want to loop throught the
nodeset as I expect it to be large as well as the list of
groupMemberships I have to process.


That's my policy:

Code:
--------------------
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE policy PUBLIC "policy-builder-dtd" "C:\NetIQ\Designer\plugins\com.novell.idm.policybu ilder_4.0.0.201404231247\DTD\dirxmlscript4.0.2.dtd "><policy>
<rule notrace="true">
<description>Policy Filter</description>
<conditions>
<or>
<if-class-name mode="nocase" op="not-equal">User</if-class-name>
<if-op-attr name="Group Membership" op="not-changing"/>
</or>
</conditions>
<actions>
<do-break/>
</actions>
</rule>
<rule>
<description>Setup local variable</description>
<conditions>
<and/>
</conditions>
<actions>
<do-set-local-variable name="lv_APPL-ManageGroups" scope="policy">
<arg-node-set>
<token-query class-name="Organizational Unit" datastore="src" scope="subordinates">
<arg-dn>
<token-text xml:space="preserve">de\company\subdomain\Group\AP PL</token-text>
</arg-dn>
<arg-match-attr name="APPL-ManageGroups">
<arg-value type="string">
<token-text xml:space="preserve">TRUE</token-text>
</arg-value>
</arg-match-attr>
<arg-string>
<token-text xml:space="preserve">ou</token-text>
</arg-string>
</token-query>
</arg-node-set>
</do-set-local-variable>
</actions>
</rule>
<rule>
<description>Add values (add)</description>
<comment xml:space="preserve">this is also true for a sync event</comment>
<conditions>
<and>
<if-xpath op="true">add-attr[@attr-name="Group Membership"]/value/text()</if-xpath>
</and>
</conditions>
<actions>
<do-for-each>
<arg-node-set>
<token-xpath expression='add-attr[@attr-name="Group Membership"]/value/text()'/>
</arg-node-set>
<arg-actions>
<do-set-local-variable name="lv_APPL" scope="policy">
<arg-string>
<token-parse-dn length="1" start="6">
<token-local-variable name="current-node"/>
</token-parse-dn>
</arg-string>
</do-set-local-variable>
<do-if>
<arg-conditions>
<and>
<if-xpath op="true">contains($lv_APPL-ManageGroups,$lv_APPL)</if-xpath>
</and>
</arg-conditions>
<arg-actions>
<do-set-local-variable name="lv_APPL-Attribute" scope="policy">
<arg-string>
<token-text xml:space="preserve">pbAPPL-</token-text>
<token-local-variable name="lv_APPL"/>
<token-text xml:space="preserve">-MemberOf</token-text>
</arg-string>
</do-set-local-variable>
<do-add-src-attr-value name="$lv_APPL-Attribute$">
<arg-value type="string">
<token-local-variable name="current-node"/>
</arg-value>
</do-add-src-attr-value>
</arg-actions>
<arg-actions/>
</do-if>
</arg-actions>
</do-for-each>
</actions>
</rule>
</policy>
--------------------



That's my XDS document I process on:


Code:
--------------------
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Evaluation" version="4.0.2.5">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<add class-name="User" qualified-src-dn="dc=de\dc=company\dc=subdomain\OU=Group\OU=User s\OU=PROD\CN=UserName" src-dn="\TREE\de\company\subdomain\Group\Users\PROD\Us erName">
<add-attr attr-name="Group Membership">
<value type="dn">\TREE\de\company\subdomain\Group\APPL\AP PL2\GroupName</value>
</add-attr>
</add>
</input>
</nds>
--------------------


That's the query result:


Code:
--------------------
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product version="4.0.2.5">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<output>
<instance class-name="Organizational Unit" qualified-src-dn="dc=de\dc=company\dc=subdomain\OU=Group\OU=APPL \OU=APPL1" src-dn="\TREE\de\company\subdomain\Group\APPL\APPL1" src-entry-id="101854">
<attr attr-name="OU">
<value type="string">APPL1</value>
</attr>
</instance>
<instance class-name="Organizational Unit" qualified-src-dn="dc=de\dc=company\dc=subdomain\OU=Group\OU=APPL \OU=APPL2" src-dn="\TREE\de\company\subdomain\Group\APPL\APPL2" src-entry-id="101855">
<attr attr-name="OU">
<value type="string">APPL2</value>
</attr>
</instance>
<status level="success"></status>
</output>
</nds>
--------------------


and that's where it goes wrong for the example provided (trace snippet).


Code:
--------------------
(if-xpath true "contains($lv_APPL-ManageGroups,$lv_APPL) ") = FALSE.
--------------------



Thanks in advance
Steffen


--
skoehler
------------------------------------------------------------------------
skoehler's Profile: https://forums.netiq.com/member.php?userid=1419
View this thread: https://forums.netiq.com/showthread.php?t=52895