Share via


ILM: How to Get Attribute Data from a Referenced Object

Some background information:

When ILM directly imports a reference attribute (CS>MV), it tries to maintain the reference, using the technique of referential integrity.
ILM automatically translates the link between the two objects (user > manager) from CS to Metaverse.
The MV object does not have a DN, but an ObjectGUID.
ILM translates the reference from CS DN to MV GUID.

A small example:

https://uyl8dg.bay.livefilestore.com/y1mPmLftL-wOXzC_L-fpoKtQe2IT1LvAWEVjhMHuIJVAoak6t9mGuvx_mhm87hjymLpYYwJ39T2fRbrr3s7Z9vfOnfCkWETOJD4S4EUMYeOJO1EYFqxWvy0oGWbTdEhVlz_WbUT-EnWQ-6cR4X2cgxDbQ/clip_image002_thumb.jpg

In MV the reference is translated to:

https://uyl8dg.bay.livefilestore.com/y1mIGkEE9cEfDU9nzd-6Btd6Gc3W-F9tImpvY9edvng7g2EHkZfnSbAo24lZBbAn4T9eYPfQZnxtWulwd3gJoDD-d-x835ITDK4ZtTh52RMg0WdE5IIVKVixQT07lPRoVF0pRYWwlLWZNJfF7Xz7qiJyg/clip_image004_thumb.jpg

So you can’t use the CSEntry.DN value to search the metaverse directly. Neither can you search the connector space in extension code. There is no FindMVentries equivalent for the connector space.

Also, you can’t access a MVEntry reference attribute.

More information:

This import flow code will fail:

Public Sub MapAttributesForImport( _
 ByVal FlowRuleName As String, _
 ByVal csentry As CSEntry, _
 ByVal mventry As MVEntry) _
 Implements IMASynchronization.MapAttributesForImport

 Select Case FlowRuleName
  Case "cd.user:manager->mv.user:department"
   ‘can’t search in connector space
   ‘trying to search metaverse
   If mventry("manager").IsPresent Then
    Dim findResultList() As MVEntry = _
     Utils.FindMVEntries("ObjectGUID", mventry("manager").Value.ToString, 1)
    If findResultList.Length > 0 Then
     Dim firstMVEntryFound As MVEntry = findResultList(0)
     mventry("department").Value = firstMVEntryFound("department").Value.ToString
    End If
   End If
  Case Else
   Throw New EntryPointNotImplementedException()
 End Select

End Sub  

Error message: ”System.InvalidOperationException: Unable to access attribute manager. Reference values not accessible on MV objects.”

https://uyl8dg.bay.livefilestore.com/y1mg51Wb059AEx8kVDInshqB9NclGl1J4iJ9q1bm4AbPj2K5lVvgzttBVMEMtaI4zT0AAtE30_lsd1-lsjVN1ODTsD5SRwM1INeBc9RzJC3RJVtZPCUjv6CmlTDeM_reEHTUxZb3RrhQm2y7ZUdpN6YFw/clip_image006_thumb.jpg

So we need another approach.

We need some (non-referential) link to the manager, to be able to search the MV.

To document this it was using an AD MA. The only link between the user and manager in AD is still a reference (by DN) and you can’t change that.  (There is no other attribute linking them…)

As an example:

https://uyl8dg.bay.livefilestore.com/y1m_KsCgIb5JdcSrkQcv8H-QF7IJwhjk3YCdkGoA-Ym-rmAiTtV8JBYvdpdNtQlgyjUyGAwoPtWnJxy4iMoMM6wIMLXgJMFe_QHoiUspGpHGahy-MdCn72HMWGJF0wueYqCWwvcbwwSasqTBcQhqvTN7w/clip_image008_thumb.jpg

But you can store the DN as string value in an additional attribute like “ADdn” (string).

So: flow the CS <DN> into the MV.
https://uyl8dg.bay.livefilestore.com/y1mOqZesxRSz5EKo0V2xIzVQd_AO-px4A3MUQ4GKwyL0J1F8MLdGftL5Jm_9XHoAN_l5_LlBh3b-uuZ27UB5piOkLaQKclLH0Pdhni4gBkeORWvIzsItpL4X8Z2mdfj5JJn-kANHIPwoPQDeRcqQ6QdLw/clip_image009_thumb.png

(Or another ‘simple’ attribute if you have one to link to the manager…)
Next create a import flow rule to import an attribute from a referenced object:

https://uyl8dg.bay.livefilestore.com/y1mWx-CrOm9dTqqDFysDU3HUDiauPRrSUNKd9ImyN6Tgl7ZTneMu3JAv_d-Dk22D3lXkX1GzPr2itOHOXSdBt0tRMSj91-v6XSm6ZC_PjvZvW9mfA6L3CBvXY-es1QI9VdHFNqn8ZEjMDtzT6CIapk64A/clip_image011_thumb.jpg

Public Sub MapAttributesForImport( _
ByVal FlowRuleName As String, _
ByVal userCSEntry As CSEntry, _
ByVal userMVEntry As MVEntry) _
Implements IMASynchronization.MapAttributesForImport
 Select Case FlowRuleName
 Case "cd.user:manager->mv.user:department"
   'simple sample code block to flow managers department into MV
  'can be made more complex to flow only when user is manager
  If userCSEntry("department").IsPresent Then
   userMVEntry("department").Value = userCSEntry("department").Value
  End If

   'code block to flow manager's department in user's department
  If userCSEntry("manager").IsPresent Then
   'search for the manager
   Dim findManagerResultList() As MVEntry = _
    Utils.FindMVEntries("ADdn", userCSEntry("manager").Value.ToString, 1)
   If findManagerResultList.Length > 0 Then
    'get first entry
    Dim mvManagerFound As MVEntry = findManagerResultList(0) 

    'if department filled, flow it
    If mvManagerFound("department").IsPresent Then
     userMVEntry("department").Value = mvManagerFound("department").Value
    End If
   End If
  End If
 Case Else
  Throw New EntryPointNotImplementedException()
 End Select
End Sub

Look at this example:

https://uyl8dg.bay.livefilestore.com/y1mT1TBG_deHK9IhEQGKCvplu2Ld-P42Po-SgMBtbHNWXEskDytS97WhTcmJykzskUAKhAtRJgaVuOaoUi84uzlyAoRHii5Gy82vsJYgqovnQu0k3NYYZ8HXBsWqp2e-oUxcZB4_nUWpAl-hiWVozGxrw/clip_image012_thumb.png

https://uyl8dg.bay.livefilestore.com/y1mfyBy3W8mT0a_HQykFT6FinvSppiupIXkQJ7Vi1Vtha4TXH1EGw8VFmN75-xjMAWZpGXinKlarrJHyEIELyyGxSKXoUl1koxNoGPmAMpUWH4I5yR-QyZ3wAmoXROeQuXfMskXEiG8kgyIc0XrIMBvHQ/clip_image013_thumb.png

First, sync the manager to have the department attribute available:

(Eg preview > Commit preview, like shown below)

https://uyl8dg.bay.livefilestore.com/y1m4CMGIDmiyOJ94kgBgu_QiLUDT0tgXkFe16X93S7m0intWT2KQ0n-kdWDDmvizOpcQiHkacSeYxuMzJnQiJHC1XdmVBa83CeYng-COdvqK6eG2M96O3vWxCINo5yQMdi_UpCPGm-mUr8h8odOGhWuBA/clip_image015_thumb.jpg

Next sync the user: preview > Commit preview, like shown below:

https://uyl8dg.bay.livefilestore.com/y1mLkD9rRMC0wOK7G7QVc1zSXRghWB9rTW6eVlNC-8Juo3JjsGi7D2pgP8SiQk9-jgZPvVxXbOSRoAxcNvP7p8fxjUnbJVKN1Lto5FkjWwCaSS9r4dPhu-iWeGaC5SlwOsv-RP_c3fYGsr58Y4JbAEy6g/clip_image017_thumb.jpg

The user department has now been filled with the Manager’s department.