WorkOrder driver giving error -9040 on an add-association operation

  • 7004898
  • 20-Nov-2009
  • 26-Apr-2012

Environment

Novell Identity Manager 3.6.1 WorkOrder driver

Situation

Customizations were made following the driver documentation to add a new WorkOrder object every time a user get created or changed in eDirectory. After the customization, the WorkOrder objects get created but the user does not receive an DirXML-Associations value, and an IDM driver trace shows the following error:

DirXML Log Event -------------------
     Driver:   \NTSLABTREE\nts\driverset\WorkOrder
     Channel:  Subscriber
     Object:   \NTSLABTREE\nts\labuser
     Status:   Error
     Message:  Code(-9040) <add-association> operation does not have dest-dn.

Resolution

When a driver shim creates a new object in a connected application, it sends back an add-association event back to eDirectory. That add-association event will have its dest-dn XML attribute built from the original event's src-dn XML attribute.

To fix this issue the custom event generated by the driver has to contain an src-dn XML attribute, and that attribute need to contain the value of the src-dn from the original event.

The DirXML-Script code below performs that function for the WorkOrder driver, and should be placed in its own policy. That policy should be the very last one in the Subscriber Command Transformation Policy set:

<policy>
<rule>
        <description>Set Synthesized WorkOrders Source DN</description>
        <conditions>
            <and>
                <if-operation op="equal">add</if-operation>
                <if-class-name op="equal">DirXML-WorkOrder</if-class-name>
                <if-src-dn op="not-available"/>
            </and>
        </conditions>
        <actions>
            <do-set-op-src-dn>
                <arg-dn>
                    <token-attr name="Description"/>
                </arg-dn>
            </do-set-op-src-dn>
            <do-add-dest-attr-value class-name="DirXML-WorkOrder" name="DirXML-nwoSendToPublisher">
                <arg-value type="string">
                    <token-text xml:space="preserve">true</token-text>
                </arg-value>
            </do-add-dest-attr-value>
            <do-add-dest-attr-value class-name="DirXML-WorkOrder" name="DirXML-nwoStatus">
                <arg-value type="string">
                    <token-text xml:space="preserve">pending</token-text>
                </arg-value>
            </do-add-dest-attr-value>
        </actions>
</rule>
</policy>

Additional Information

The actual meaning of the error -9040 is "E_XDS_ELEMENT_MISSING_ATTR". XDS is the XML vocabulary used by IDM to represent the events that are synchronized between 2 connected systems.

The IDM main documentation has the definition of its XML tags (also called elements) and attributes, listing what is mandatory and what is optional in the XML document.

Every time a -9040 error occurs on any driver, check the XML right above the error against the definitions provided in IDM documentation, and find which XML attributes are missing. Adding the missing XML attributes via Driver logic should fix the issue. The documentation for all Novell products can be found at https://www.novell.com/documentation .

Just for reference, here is the relevant portion of an IDM trace for the issue described in this TID. Notice that the original add event (highlighted below) does not contain a src-dn XML attribute:

[11/12/09 21:35:28.244]:WorkOrder ST:Submitting document to subscriber shim:
[11/12/09 21:35:28.245]:WorkOrder ST:
<nds dtdversion="3.5" ndsversion="8.x">
  <source>
    <product version="3.6.10.4747">DirXML</product>
    <contact>Novell, Inc.</contact>
  </source>
  <input>
    <add class-name="WorkOrder" dest-dn="\WorkOrder\Scheduled Disable - labuser" event-id="wolinux#20091113043528#1#1">
      <add-attr attr-name="Description">
        <value type="string">\NTSLABTREE\nts\labuser</value>
      </add-attr>
      <add-attr attr-name="Content">
        <value type="string">nts\labuser</value>
      </add-attr>
      <add-attr attr-name="DueDate">
        <value type="string">1357836300</value>
      </add-attr>
      <add-attr attr-name="Status">
        <value type="string">pending</value>
      </add-attr>
      <add-attr attr-name="Other1">
        <value type="string">True</value>
      </add-attr>
      <add-attr attr-name="SendToPublisher">
        <value type="string">TRUE</value>
      </add-attr>
      <add-attr attr-name="DoItNowFlag">
        <value type="string">FALSE</value>
      </add-attr>
    </add>
  </input>
</nds>
[11/12/09 21:35:28.247]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShimm execute
[11/12/09 21:35:28.248]:WorkOrder ST:##WorkOrder Sub -----:: commandClass = class com.novell.nds.dirxml.driver.xds.XDSAddElement
[11/12/09 21:35:28.249]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler driverDN = \WorkOrder\ Object DN =\WorkOrder\Scheduled Disable - labuser
[11/12/09 21:35:28.249]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler: class == 'WorkOrder'
[11/12/09 21:35:28.249]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler: AttrName == Description
[11/12/09 21:35:28.250]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler: AttrName = Description AttrValue == \NTSLABTREE\nts\labuser
[11/12/09 21:35:28.250]:WorkOrder ST:##WorkOrder Sub -----:: buildWorkOrder attrName = Description attrValue = \NTSLABTREE\nts\labuser
[11/12/09 21:35:28.251]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler: AttrName == Content
[11/12/09 21:35:28.251]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler: AttrName = Content AttrValue == nts\labuser
[11/12/09 21:35:28.251]:WorkOrder ST:##WorkOrder Sub -----:: buildWorkOrder attrName = Content attrValue = nts\labuser
[11/12/09 21:35:28.252]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler: AttrName == DueDate
[11/12/09 21:35:28.252]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler: AttrName = DueDate AttrValue == 1357836300
[11/12/09 21:35:28.252]:WorkOrder ST:##WorkOrder Sub -----:: buildWorkOrder attrName = DueDate attrValue = 1357836300
[11/12/09 21:35:28.252]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler: AttrName == Status
[11/12/09 21:35:28.253]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler: AttrName = Status AttrValue == pending
[11/12/09 21:35:28.253]:WorkOrder ST:##WorkOrder Sub -----:: buildWorkOrder attrName = Status attrValue = pending
[11/12/09 21:35:28.253]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler: AttrName == Other1
[11/12/09 21:35:28.253]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler: AttrName = Other1 AttrValue == True
[11/12/09 21:35:28.254]:WorkOrder ST:##WorkOrder Sub -----:: buildWorkOrder attrName = Other1 attrValue = True
[11/12/09 21:35:28.254]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler: AttrName == SendToPublisher
[11/12/09 21:35:28.254]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler: AttrName = SendToPublisher AttrValue == TRUE
[11/12/09 21:35:28.255]:WorkOrder ST:##WorkOrder Sub -----:: buildWorkOrder attrName = SendToPublisher attrValue = TRUE
[11/12/09 21:35:28.255]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler: AttrName == DoItNowFlag
[11/12/09 21:35:28.255]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim addHandler: AttrName = DoItNowFlag AttrValue == FALSE
[11/12/09 21:35:28.256]:WorkOrder ST:##WorkOrder Sub -----:: buildWorkOrder attrName = DoItNowFlag attrValue = FALSE
[11/12/09 21:35:28.259]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim dispatch send workorder to publisher?? workorder is not null
[11/12/09 21:35:28.259]:WorkOrder ST:##WorkOrder Sub -----:: WOSubscriptionShim dispatch send workorder to publisher do it now.
[11/12/09 21:35:28.259]:WorkOrder ST:SubscriptionShim.execute() returned:
[11/12/09 21:35:28.260]:WorkOrder ST:
<nds dtdversion="3.0">
  <source>
    <product build="20090520_1257" instance="WorkOrder" version="3.5.2">DirXML WorkOrder Driver (Java)</product>
    <contact>Novell, Inc.</contact>
  </source>
  <output>
    <add-association event-id="wolinux#20091113043528#1#1">\WorkOrder\Scheduled Disable - labuser 11/12/2009 21:35 (Pending)</add-association>
    <status event-id="wolinux#20091113043528#1#1" level="success" type="driver-general"/>
  </output>
</nds>
[11/12/09 21:35:28.261]:WorkOrder ST:No input transformation policies.
[11/12/09 21:35:28.261]:WorkOrder ST:Applying schema mapping policies to input.
[11/12/09 21:35:28.261]:WorkOrder ST:Applying policy: %+C%14Csmp%-C.
[11/12/09 21:35:28.261]:WorkOrder ST:Resolving association references.
[11/12/09 21:35:28.262]:WorkOrder ST:Processing returned document.
[11/12/09 21:35:28.262]:WorkOrder ST:Processing operation <add-association> for .
[11/12/09 21:35:28.263]:WorkOrder ST:
DirXML Log Event -------------------
     Driver:   \NTSLABTREE\nts\driverset\WorkOrder
     Channel:  Subscriber
     Object:   \NTSLABTREE\nts\labuser
     Status:   Error
     Message:  Code(-9040) <add-association> operation does not have dest-dn.

Feedback service temporarily unavailable. For content questions or problems, please contact Support.