Another Approach to Handling an IDM -9063 Error

0 Likes
over 13 years ago

Problem



Sometimes you get data from a client's system that is not so clean. OK, most times. If the data you are using for association was accidentally matched to the wrong object, the right object fails in the match rule with a message similar to this:


DirXML Log Event -------------------
Driver: \CWTIDVAULT\CWTny\services\CWTFLAT\CSG
Channel: Subscriber
Object: \CWTIDVAULT\CWTny\employees\active\Colon
Status: Error
Message: Code(-9063) Object matching policy found an object that is already associated.



In my current project, we are using objects to represent help desk work orders to take actions in IDM. We need to be able to feed back to those objects when a creation or match fails. But if the engine just stops at the error condition, we can't return anything.

Solution



The IDM rule below pre-emptively queries for the association value. If it finds that there is already another object with this association, it can take actions before the match rule ends with the above error condition.

Please note that the code that follows the query to return results is really specific to this particular solution; your implementation (and mileage) may vary.


<rule>
<description>[CWT] Find Incorrect Matches</description>
<conditions>
<and>
<if-class-name op="equal">User</if-class-name>
<if-op-attr name="Employee ID" op="available"/>
</and>
</conditions>
<actions>
<do-set-local-variable name="Q-RESULTS">
<arg-node-set>
<token-query class-name="User" datastore="src">
<arg-match-attr name="DirXML-Associations">
<arg-value type="structured">
<arg-component name="nameSpace">
<token-text xml:space="preserve">1</token-text>
</arg-component>
<arg-component name="volume">
<token-text xml:space="preserve">\CWTIDVAULT\CWTny\services\CWTFLAT\CSG</token-text>
</arg-component>
<arg-component name="path">
<token-op-attr name="Employee ID"/>
</arg-component>
</arg-value>
</arg-match-attr>
</token-query>
</arg-node-set>
</do-set-local-variable>
<do-if>
<arg-conditions>
<and>
<if-xpath op="not-true">count($Q-RESULTS) = 0</if-xpath>
</and>
</arg-conditions>
<arg-actions>
<do-set-local-variable name="WO">
<arg-string>
<token-attr name="CWTCSGWorkOrderDN"/>
</arg-string>
</do-set-local-variable>
<do-add-src-attr-value name="DirXML-Other2">
<arg-dn>
<token-local-variable name="WO"/>
</arg-dn>
<arg-value type="string">
<token-text xml:space="preserve">Object matching policy would have found an object (</token-text>
<token-xpath expression="$Q-RESULTS/@src-dn"/>
<token-text xml:space="preserve">) that is already associated.</token-text>
</arg-value>
</do-add-src-attr-value>
<do-add-src-attr-value name="DirXML-nwoStatus">
<arg-dn>
<token-local-variable name="WO"/>
</arg-dn>
<arg-value type="string">
<token-text xml:space="preserve">error</token-text>
</arg-value>
</do-add-src-attr-value>
<do-add-src-attr-value name="DirXML-Other1">
<arg-dn>
<token-local-variable name="WO"/>
</arg-dn>
<arg-value type="string">
<token-text xml:space="preserve">error</token-text>
</arg-value>
</do-add-src-attr-value>
<do-veto/>
</arg-actions>
</do-if>
</actions>
</rule>

Labels:

How To-Best Practice
Comment List
Anonymous
Related Discussions
Recommended