Share via


How to: Handle Many Connector Space Objects to One Metaverse Object in the Same Management Agent

If you try to link multiple connector space objects to the same Forefront Identity Manager Synchronization Service (FIM Synchronization Service) database (metaverse) object, FIM Synchronization Service issues an ambiguous-import-flow-from-multiple-connectors error. To prevent this error, you must explicitly assign values from the connector space object attributes to the metaverse object attributes.

The following example shows how to handle the value of the samAccountName and mailNickName attributes from multiple connector space objects of the same management agent to the same MVEntry object. If the attributes exist in the connector space object and have at least one value, those values are assigned to the samAccountName and mailNickName attributes of the metaverse object.

Before you use this rule extension, you must modify the metaverse attribute flow precedence rules in the Metaverse Design window so that it allows manual precedence rules to be applied to this attribute.

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

    Select Case FlowRuleName
        Case "IAF_samAccountName"
            Replace(csentry, mventry, "samAccountName", "samAccountName")
        Case "IAF_mailNickName"
            Replace(csentry, mventry, "mailNickName", "mailNickName")
        Case Else

        ' TODO: Remove the following statement and add your code here.
        Throw New EntryPointNotImplementedException()

    End Select
End Sub

Public Sub Replace(ByVal csentry As CSEntry, _
    ByRef mventry As MVEntry, _
    ByVal csattr As String, _
    ByVal mvattr As String)

    If csentry(csattr).IsPresent Then
        If Not csentry(csattr).Values.Count = 0 Then
            mventry(mvattr).Values = csentry(csattr).Values
        End If
    End If
End Sub
void IMASynchronization.MapAttributesForImport( string FlowRuleName, 
                                                CSEntry csentry, 
                                                MVEntry mventry)
{
    switch (FlowRuleName)
    {
        case "IAF_samAccountName" :
            Replace(csentry, ref mventry, "samAccountName", 
                "samAccountName");
        break;
        case "IAF_mailNickName" :
            Replace(csentry, ref mventry, "mailNickName", 
                "mailNickName");
        break;

        default :
            throw new EntryPointNotImplementedException();
     }
}

void Replace(CSEntry csentry, ref MVEntry mventry, string csattr, string mvattr)
{
    if (csentry[csattr].IsPresent && csentry[csattr].Values.Count != 0)
    {
        mventry[mvattr].Values = csentry[csattr].Values;
    }
}

See Also

Reference

MVEntry

Concepts

Manual Precedence Examples