Entity Resolution for Entity and Reference Objects

Overview

The most important elements around the code to implement Entity Resolution logic can be found in /eagle_default/in/xml/include/entity_xref_resolution.inc include file

Entity Resolution is the process of determining Entity Id by Entity Xreference Identifiers: sets of Xref Account Id + Xref Account Id Type elements. Class Code element can also be specified.

The maximum amount of identifiers is 20.

Entity Identifiers have a separate section in the XSD called ‘Entity Common Id Model’ XSD Group. Refer to the Entity Common Id Model mapping for more details.

An example of Entity Xreference Identifiers in the incoming message:

...
<entityXrefs>
    <entityXref>
        <xrefAccountId>XREF_ID1</xrefAccountId>
        <xrefAccountIdType>XREF_TYPE1</xrefAccountIdType>
        <xrefClassCode>TF1</xrefClassCode>
    </entityXref>
    <entityXref>
        <xrefAccountId>XREF_ID2</xrefAccountId>
        <xrefAccountIdType>XREF_TYPE2</xrefAccountIdType>
        <xrefClassCode>TF2</xrefClassCode>
    </entityXref>
    <entityXref>
        <xrefAccountId>XREF_ID3</xrefAccountId>
        <xrefAccountIdType>XREF_TYPE3</xrefAccountIdType>
        <xrefClassCode>TF3</xrefClassCode>
    </entityXref>
</entityXrefs>
<entityResolutionOption>MATCH_ALL</entityResolutionOption>
<entityBattingOrder>XREF_TYPE2,XREF_TYPE3,XREF_TYPE1</entityBattingOrder>
...

Entity Xref element contains every Entity Identifier.  The Entity Xrefs element contains all Entity Xref elements.

Entity Id is defined by Entity Xreference Identifiers using the RULESDBO.ENTITY_XREFERENCE DB table.

Parameters For Entity Resolution

The resolution of Entity is controlled by two parameters:

  • Entity Batting Order
  • Entity Resolution Option.

Entity Resolution Option

Entity Resolution Option switches Entity Resolution to work in one of the following modes:

  • Find 1st Match (default mode, if Entity Resolution Option is not set)
    In Find 1st Match mode Entity Id will be calculated by the first identifier specified in Batting Order. If the Batting Order is null, the first entity identifier in incoming message will be used.
  • MATCH_ALL (if entityResolutionOption=MATCH_ALL)
    MATCH_ALL mode resolves the entity only if it matches ALL identifiers. If at least one identifier is not defined the entity id, the stream will return the following error: 'MATCH_ALL mode: failed. List of XREF Entity identifiers does not match for option MATCH_ALL' 

Entity Batting Order

The Entity Batting Order determines which entity xreference identifiers are used in the security resolution and their order for matching.

Note

If entity batting order is not specified in the incoming message, by default the order of entity identifier will be the same as in the incoming message.
Examples of SQL query if Batting Order is specified.

OCI:

select 
 x.entity_id as ENTITY_ID, 
 x.xref_account_id, 
 x.xref_account_id_type,
 case 
 when x.xref_account_id_type = 'XREF_TYPE2' then 1
 when x.xref_account_id_type = 'XREF_TYPE3' then 2
 when x.xref_account_id_type = 'XREF_TYPE1' then 3
 else 1000
 end as ORD 
from RULESDBO.ENTITY_XREFERENCE x 
where 
  ( ( x.xref_account_id = 'XREF_ID1' and x.xref_account_id_type = 'XREF_TYPE1') or
    ( x.xref_account_id = 'XREF_ID2' and x.xref_account_id_type = 'XREF_TYPE2') or
    ( x.xref_account_id = 'XREF_ID3' and x.xref_account_id_type = 'XREF_TYPE3') ) 
order by ord

OLEDB:

select 
 x.entity_id as ENTITY_ID, 
 x.xref_account_id, 
 x.xref_account_id_type,
 case 
 when x.xref_account_id_type = 'XREF_TYPE2' then 1
 when x.xref_account_id_type = 'XREF_TYPE3' then 2
 when x.xref_account_id_type = 'XREF_TYPE1' then 3
 else 1000
 end as ORD 
from RULES.DBO.ENTITY_XREFERENCE x 
where 
  ( ( x.xref_account_id = 'XREF_ID1' and x.xref_account_id_type = 'XREF_TYPE1') or
    ( x.xref_account_id = 'XREF_ID2' and x.xref_account_id_type = 'XREF_TYPE2') or
    ( x.xref_account_id = 'XREF_ID3' and x.xref_account_id_type = 'XREF_TYPE3') ) 
order by ord