Hi!

I am writing a matching rule that could give several matches but I do
not understand how to determine if there are several matches. My
matching rules are like this:


Code:
--------------------

<policy>
<rule>
<description>Match based on brfkAGRessursnummer in Ansatt</description>
<conditions>
<or>
<if-class-name op="equal">User</if-class-name>
</or>
</conditions>
<actions>
<do-find-matching-object scope="subtree">
<arg-dn>
<token-text xml:space="preserve">rfk-meta\Personer\Ansatt</token-text>
</arg-dn>
<arg-match-attr name="brfkAGRessursnummer"/>
</do-find-matching-object>
<do-if>
<arg-conditions>
<and>
<if-dest-dn op="available"/>
<if-dest-dn op="not-equal">&amp;#xFFFD;</if-dest-dn>
<if-dest-dn disabled="true" op="not-equal">&amp;#xFFFC;</if-dest-dn>
</and>
</arg-conditions>
<arg-actions>
<do-add-dest-attr-value direct="true" name="Object Class">
<arg-value>
<token-text xml:space="preserve">brfkInfo</token-text>
</arg-value>
</do-add-dest-attr-value>
<do-add-dest-attr-value direct="true" name="Object Class">
<arg-value>
<token-text xml:space="preserve">sbasInfo</token-text>
</arg-value>
</do-add-dest-attr-value>
<do-set-dest-attr-value class-name="brfkInfo" direct="true" name="brfkCreateGroupWiseAccount">
<arg-value>
<token-map dest="GroupWise" src="ArbeidsSted" table="..\..\rfkUtils\mtPlasseringAgresso">
<token-attr name="brfkAGArbeidssted"/>
</token-map>
</arg-value>
</do-set-dest-attr-value>
<do-set-dest-attr-value class-name="sbasInfo" direct="true" name="sbasAktivStatus">
<arg-value>
<token-text xml:space="preserve">0</token-text>
</arg-value>
</do-set-dest-attr-value>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">DEBUG (PublisherMatchingRule) ==> Match found based on brfkAGRessursnummer in Ansatt</token-text>
</arg-string>
</do-trace-message>
<do-break/>
</arg-actions>
<arg-actions/>
</do-if>
</actions>
</rule>
<rule>
<description>Match based on norEduPersonNIN in Ansatt</description>
<conditions>
<or>
<if-class-name op="equal">User</if-class-name>
</or>
</conditions>
<actions>
<do-find-matching-object scope="subtree">
<arg-dn>
<token-text xml:space="preserve">rfk-meta\Personer\Ansatt</token-text>
</arg-dn>
<arg-match-attr name="norEduPersonNIN"/>
</do-find-matching-object>
<do-if>
<arg-conditions>
<and>
<if-dest-dn op="available"/>
<if-dest-dn op="not-equal">&amp;#xFFFD;</if-dest-dn>
<if-dest-dn disabled="true" op="not-equal">&amp;#xFFFC;</if-dest-dn>
</and>
</arg-conditions>
<arg-actions>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">DEBUG (PublisherMatchingRule) ==> DestDN = </token-text>
<token-dest-dn/>
</arg-string>
</do-trace-message>
<do-add-dest-attr-value direct="true" name="Object Class">
<arg-value>
<token-text xml:space="preserve">brfkInfo</token-text>
</arg-value>
</do-add-dest-attr-value>
<do-add-dest-attr-value direct="true" name="Object Class">
<arg-value>
<token-text xml:space="preserve">sbasInfo</token-text>
</arg-value>
</do-add-dest-attr-value>
<do-set-dest-attr-value class-name="brfkInfo" direct="true" name="brfkCreateGroupWiseAccount">
<arg-value>
<token-map dest="GroupWise" src="ArbeidsSted" table="..\..\rfkUtils\mtPlasseringAgresso">
<token-attr name="brfkAGArbeidssted"/>
</token-map>
</arg-value>
</do-set-dest-attr-value>
<do-set-dest-attr-value class-name="sbasInfo" direct="true" name="sbasAktivStatus">
<arg-value>
<token-text xml:space="preserve">0</token-text>
</arg-value>
</do-set-dest-attr-value>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">DEBUG (PublisherMatchingRule) ==> Match found based on norEduPersonNIN in Ansatt</token-text>
</arg-string>
</do-trace-message>
<do-break/>
</arg-actions>
<arg-actions/>
</do-if>
</actions>
</rule>
<rule>
<description>Match based on brfkAGRessursnummer in Arkiv</description>
<conditions>
<or>
<if-class-name op="equal">User</if-class-name>
</or>
</conditions>
<actions>
<do-find-matching-object scope="subtree">
<arg-dn>
<token-text xml:space="preserve">rfk-meta\Personer\Arkiv</token-text>
</arg-dn>
<arg-match-attr name="brfkAGRessursnummer"/>
</do-find-matching-object>
<do-if>
<arg-conditions>
<and>
<if-dest-dn op="available"/>
<if-dest-dn op="not-equal">&amp;#xFFFD;</if-dest-dn>
<if-dest-dn disabled="true" op="not-equal">&amp;#xFFFC;</if-dest-dn>
</and>
</arg-conditions>
<arg-actions>
<do-add-dest-attr-value direct="true" name="Object Class">
<arg-value>
<token-text xml:space="preserve">brfkInfo</token-text>
</arg-value>
</do-add-dest-attr-value>
<do-add-dest-attr-value direct="true" name="Object Class">
<arg-value>
<token-text xml:space="preserve">sbasInfo</token-text>
</arg-value>
</do-add-dest-attr-value>
<do-set-dest-attr-value class-name="brfkInfo" direct="true" name="brfkCreateGroupWiseAccount">
<arg-value>
<token-map dest="GroupWise" src="ArbeidsSted" table="..\..\rfkUtils\mtPlasseringAgresso">
<token-attr name="brfkAGArbeidssted"/>
</token-map>
</arg-value>
</do-set-dest-attr-value>
<do-set-dest-attr-value class-name="sbasInfo" direct="true" name="sbasAktivStatus">
<arg-value>
<token-text xml:space="preserve">0</token-text>
</arg-value>
</do-set-dest-attr-value>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">DEBUG (PublisherMatchingRule) ==> Match found based on brfkAGRessursnummer in Arkiv</token-text>
</arg-string>
</do-trace-message>
<do-break/>
</arg-actions>
<arg-actions/>
</do-if>
</actions>
</rule>
<rule>
<description>Match based on norEduPersonNIN in Arkiv</description>
<conditions>
<or>
<if-class-name op="equal">User</if-class-name>
</or>
</conditions>
<actions>
<do-find-matching-object scope="subtree">
<arg-dn>
<token-text xml:space="preserve">rfk-meta\Personer\Arkiv</token-text>
</arg-dn>
<arg-match-attr name="norEduPersonNIN"/>
</do-find-matching-object>
<do-if>
<arg-conditions>
<and>
<if-dest-dn op="available"/>
<if-dest-dn op="not-equal">&amp;#xFFFD;</if-dest-dn>
<if-dest-dn disabled="true" op="not-equal">&amp;#xFFFC;</if-dest-dn>
</and>
</arg-conditions>
<arg-actions>
<do-add-dest-attr-value direct="true" name="Object Class">
<arg-value>
<token-text xml:space="preserve">brfkInfo</token-text>
</arg-value>
</do-add-dest-attr-value>
<do-add-dest-attr-value direct="true" name="Object Class">
<arg-value>
<token-text xml:space="preserve">sbasInfo</token-text>
</arg-value>
</do-add-dest-attr-value>
<do-set-dest-attr-value class-name="brfkInfo" direct="true" name="brfkCreateGroupWiseAccount">
<arg-value>
<token-map dest="GroupWise" src="ArbeidsSted" table="..\..\rfkUtils\mtPlasseringAgresso">
<token-attr name="brfkAGArbeidssted"/>
</token-map>
</arg-value>
</do-set-dest-attr-value>
<do-set-dest-attr-value class-name="sbasInfo" direct="true" name="sbasAktivStatus">
<arg-value>
<token-text xml:space="preserve">0</token-text>
</arg-value>
</do-set-dest-attr-value>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">DEBUG (PublisherMatchingRule) ==> Match found based on norEduPersonNIN in Arkiv</token-text>
</arg-string>
</do-trace-message>
<do-break/>
</arg-actions>
<arg-actions/>
</do-if>
</actions>
</rule>
<rule>
<description>If several matches is found</description>
<conditions>
<and>
<if-dest-dn op="available"/>
<if-dest-dn op="equal">&amp;#xFFFD;</if-dest-dn>
</and>
</conditions>
<actions>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">DEBUG (PublisherMatchingRule) ==> Matching returned several objects for norEduPersonNIN value = </token-text>
<token-attr name="norEduPersonNIN"/>
<token-text xml:space="preserve">. Vetoing operation.</token-text>
</arg-string>
</do-trace-message>
<do-send-email id="idm@rogfk.no" server="localhost" type="text">
<arg-string name="to">
<token-text xml:space="preserve">frode.sjovatsen@rogfk.no</token-text>
</arg-string>
<arg-string name="subject">
<token-text xml:space="preserve">Multiple matches found on object </token-text>
<token-src-name/>
</arg-string>
<arg-string name="message">
<token-text xml:space="preserve">Hva gjør vi da?</token-text>
</arg-string>
</do-send-email>
<do-veto/>
</actions>
</rule>
</policy>

--------------------


Even if I have multiple matches the Dest DN is not &#xFFFD; but ?. I
want to check if I have a singel match, set some attribs on the object
directly and break out of the matching policy set. If I have multiple
matches I want the last rule to fetch that an send a email.

Attatched is a level 3 trace with a match that returns two matches.
(2734)

--
Frode


+----------------------------------------------------------------------+
|Filename: match.txt |
|Download: http://forums.novell.com/attachment....achmentid=2734 |
+----------------------------------------------------------------------+

--
fsjovatsen
------------------------------------------------------------------------
fsjovatsen's Profile: http://forums.novell.com/member.php?userid=9767
View this thread: http://forums.novell.com/showthread.php?t=371374