I want to match on users in the following order:
1. Social Security Number
2. Workforce ID
3. Combination of Last Name, Department Number, and Job Code

My issue is when an attempt is made on #3, both associated and
non-associated user objects are returned. How can I add the condition
to only look at objects that are not associated?

Also, I read in one of the threads that multiple find matches can be
used. What if more than one record is a match? Will the next find
matching object command be executed until there is a single match?

Here is my current code which works other than matching on item #3
where I don't want to match on users that are already associated.

<rule>
<description>Search for SSN</description>
<conditions>
<and>
<if-class-name op="equal">user</if-class-name>
<if-operation op="equal">add</if-operation>
</and>
</conditions>
<actions>
<do-set-local-variable disabled="true" name="LVMatchSSN">
<arg-string>
<token-op-attr name="socialSecurityNumber"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="LVQueryResultSSN">
<arg-node-set>
<token-query class-name="User">
<arg-match-attr name="socialSecurityNumber"/>
</token-query>
</arg-node-set>
</do-set-local-variable>
<do-set-local-variable name="LVDESTDNSSN">
<arg-string>
<token-xpath expression="$LVQueryResultSSN[1]/@src-dn"/>
</arg-string>
</do-set-local-variable>
<do-trace-message level="1">
<arg-string>
<token-text xml:space="preserve">Result of SSN search
is:</token-text>
<token-xpath expression="count($LVQueryResultSSN) "/>
<token-xpath expression="$LVDESTDNSSN"/>
</arg-string>
</do-trace-message>
</actions>
</rule>
<rule>
<description>Match on SSN if one record found</description>
<comment name="author" xml:space="preserve">GK</comment>
<comment name="version" xml:space="preserve">1.0</comment>
<comment name="lastchanged"
xml:space="preserve">2007-06-18</comment>
<conditions>
<and>
<if-operation op="equal">add</if-operation>
<if-class-name op="equal">User</if-class-name>
<if-xpath op="true">count($LVQueryResultSSN) = 1</if-xpath>
</and>
</conditions>
<actions>
<do-find-matching-object scope="subtree">
<arg-dn>
<token-text xml:space="preserve">IDVAULT\USERS</token-text>
</arg-dn>
<arg-match-attr name="socialSecurityNumber"/>
</do-find-matching-object>
<do-add-dest-attr-value class-name="User" name="roomNumber">
<arg-value type="string">
<token-text xml:space="preserve">1</token-text>
</arg-value>
</do-add-dest-attr-value>
<do-break/>
</actions>
</rule>
<rule>
<description>Search for workforceID if no match on SSN</description>
<conditions>
<and>
<if-xpath op="not-true">count($LVQueryResultSSN) = 1</if-xpath>
<if-class-name op="equal">user</if-class-name>
<if-operation op="equal">add</if-operation>
</and>
</conditions>
<actions>
<do-set-local-variable disabled="true" name="LVMatchWFID">
<arg-string>
<token-op-attr name="workforceID"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="LVQueryResultWFID">
<arg-node-set>
<token-query>
<arg-match-attr name="workforceID"/>
</token-query>
</arg-node-set>
</do-set-local-variable>
<do-trace-message level="1">
<arg-string>
<token-text xml:space="preserve">Result of Workforce ID search
is:</token-text>
<token-xpath expression="count($LVQueryResultWFID) "/>
<token-xpath expression="$LVDESTDNWFID"/>
</arg-string>
</do-trace-message>
</actions>
</rule>
<rule>
<description>Match on workforceID if one record found</description>
<comment name="author" xml:space="preserve">GK</comment>
<comment name="version" xml:space="preserve">1.0</comment>
<comment name="lastchanged"
xml:space="preserve">2007-06-18</comment>
<conditions>
<and>
<if-operation op="equal">add</if-operation>
<if-class-name op="equal">User</if-class-name>
<if-xpath op="true">count($LVQueryResultWFID) = 1</if-xpath>
</and>
</conditions>
<actions>
<do-find-matching-object scope="subtree">
<arg-dn>
<token-text xml:space="preserve">IDVAULT\USERS</token-text>
</arg-dn>
<arg-match-attr name="workforceID"/>
</do-find-matching-object>
<do-add-dest-attr-value class-name="User" name="roomNumber">
<arg-value type="string">
<token-text xml:space="preserve">1</token-text>
</arg-value>
</do-add-dest-attr-value>
<do-break/>
</actions>
</rule>
<rule>
<description>Find match based on Surname, JobCode, DepartmentNumber
if no match for SSN or WorkfoceID</description>
<conditions>
<and>
<if-xpath op="not-true">count($LVQueryResultWFID) = 1</if-xpath>
<if-xpath op="not-true">count($LVQueryResultSSN) = 1</if-xpath>
</and>
</conditions>
<actions>
<do-find-matching-object>
<arg-match-attr name="Surname"/>
<arg-match-attr name="jobCode"/>
<arg-match-attr name="departmentNumber"/>
</do-find-matching-object>
</actions>
</rule>

Any help will be greatly appreciated!

Thank you,

Cindy


--
cj_hayes
------------------------------------------------------------------------
cj_hayes's Profile: http://forums.novell.com/member.php?userid=5206
View this thread: http://forums.novell.com/showthread.php?t=336407