Define Set Master Record Rules

This procedure demonstrates how to create a survivorship rule of the type Set Master Record.

You can determine survivorship at the record level using the set master record rule type. Set master rules are used in party merge to set a single record as the master record.

Create Set Master Record Rules

The input to the survivorship rule is given in the IF clause. In a set master rule, the input is a set of party records. The THEN clause contains the output that determines the master record. In the Set Master Record rule, the output is a result object that contains a specific Party ID. If multiple records with different Party IDs are returned, then it results in a conflict error. To create Set Master rules, you may perform the following steps:

To create Set Master rules, you perform the following steps:

  1. Navigate to the Manage Survivorship Rules task.

  2. Click Add. The Create Survivorship Rule page appears.

  3. Enter the information provided in the following table on the Create Survivorship Rule page.

    Field

    Value

    Rule Name

    PickOrganizationMasterRule

    Description

    Select the master organization record based on the specified criteria for setting the master record.

    Rule Type

    Set master record

    Object Type

    Organization

  4. Click Apply. You're taken to the Define Survivorship Rules: Select Master Record page.

In the Define Survivorship Rules: Select Master Record page, you specify criteria for picking the master record. The criteria that you define in this page determine the output of the rule.

The following topics contains three worked examples that show different ways of defining criteria in the Define Survivorship Rules: Select Master Record page to set a master records:

  • Set the Record with Oldest Creation Date as Master

  • Set the Record with D-U-N-S Number and Smallest Party ID as Master

  • Set the Record with D-U-N-S Number and Highest Number of Party Site as Master

How You Set the Record with the Oldest Creation Date as Master

This rule has a single condition to set a record that has the oldest creation date as the master.

  1. Navigate to the Define Survivorship Rules: Select Master Record page.

  2. Enter the information provided in the following table as IF/THEN rules condition in the Define Survivorship Rule: Select Master Record page.

Rule Condition

Value

IF Condition

IF master is an HZ_PERSON_FactType.PersonPartyVO
and there is no case where {nonmaster == HZ_PERSON_FactType.PersonPartyVO and master.PartyId isn't nonmaster.PartyId and master.creationDate is more than nonmaster.CreationDate}

THEN Condition

THEN Assert new Result (name:"masterId", value:" master.PartyId)
The following figure displays the Define Survivorship Rules: Select Master Record page with completely filled IF and THEN rules conditions for setting a record that has the oldest creation date as the master.
Completely filled Define Survivorship Rules: Select Master Record page to set a record that has the oldest creation date as the master.

How You Set the Record with D-U-N-S Number and Smallest Party ID as Master

This rule identifies and returns the master record based on the following three conditions in the order of priority listed:

  1. Pick master that has D-U-N-S Number.

  2. If more than one record has D-U-N-S Number, pick one based on the smallest Party ID.

  3. If no record has D-U-N-S Number, pick one based on the smallest Party ID.

The following are the use cases for a set master record rule to pick the master based on the D-U-N-S number and the smallest Party ID.

Use Case 1

In this case, there are two records with D-U-N-S number. Therefore, the record with the smaller party ID is picked as the master record. The following table contains the sample record information for this use case.

Record Name

Party ID

D-U-N-S Number

Master

Record 1

11

998837472

Yes

Record 2

12

null

No

Record 3

13

984939234

No

The following table lists the IF and THEN rules condition values that you must enter on the Define Survivorship Rules: Select Master Record page for this use case.

Rule Condition

Value

IF Condition

Pick D-U-N-S number{IF master is an HZ_PERSON_FactType.OrganizationPartyVO
master.DUNsNumberC isn't null}
masterPartyID is the minimum of masterPartyID
where
{master= HZ_PERSON_FactType.OrganizationPartyVO and
master.DUNsNumberC isn't null}

THEN Condition

THEN 
Assert new Result (name:"masterId", value:" master.PartyId)
The following figure shows the Define Survivorship Rules: Select Master Record page with IF and THEN rules conditions for picking the record with D-U-N-S number and minimum party ID as master.
Completely filled Define Survivorship Rules: Select Master Record page with IF and THEN rule conditions to pick the record with D-U-N-S number and minimum party ID as master.

Use Case 2

In this case, there is no record with D-U-N-S number. Therefore, the record with smallest party ID is picked as the master record. The following table lists the sample record information for this use case.

Record Name

Party ID

D-U-N-S Number

Master

Record 1

21

null

Yes

Record 2

22

null

No

Record 3

23

null

No

The following table lists the IF and THEN rules condition values that you must enter on the Define Survivorship Rules: Select Master Record page for this use case.

Rule Condition

Value

IF Condition

Pick D-U-N-S number
{IF master is an HZ_PERSON_FactType.OrganizationPartyVO
master.DUNsNumberC isn't null}
and 
masterPartyID is the minimum of masterPartyID
where
{master= HZ_PERSON_FactType.OrganizationPartyVO and
master.DUNsNumberC isn't null}

THEN Condition

THEN 
Assert new Result (name:"masterId", value:" master.PartyId)
The following figure displays the Define Survivorship Rules: Select Master Record page with completely filled IF and THEN rules conditions to set the record that has the smallest party ID as the master when no record with D-U-N-S number is found.
Define Survivorship Rules: Select Master Record page with the IF and THEN rule conditions to pick the record with no D-U-N-S number and minimum party ID as master.

In this example, you have created two set master rules for Organization. First rule is for the cases where the input records have at least one record with D-U-N-S number. The second is for the case where no records have D-U-N-S Number.

Note: You can activate more than one survivorship rule at a time. When you activate multiple rules, make sure that the rules aren't conflicting and the conditions in the rule are set according to the priority.

How You Set the Record with D-U-N-S Number and Highest Number of Party Sites as Master

This rule identifies and returns the master record based on the following three conditions in the order of priority listed:

  1. Pick master that has D-U-N-S Number.

  2. Pick master that has more party sites.

  3. Pick master that has the smallest Party ID.

The following are two use cases for creating a set master rule to select the master record based on D-U-N-S number, number of party sites, and party ID:

Use Case 1

In this case, there are three records with D-U-N-S number and two records with highest number of party sites. Among those two records, the one with the lower value for party ID is selected as master. The following table contains the sample record information for this use case.

Record Name

Party ID

Number of Party Sites

D-U-N-S Number

Master

Record 1

11

3

198837472

Yes

Record 2

12

3

489203901

No

Record 3

13

2

384792392

No

Record 4

14

1

null

No

Use Case 2

In this case, there are no records with D-U-N-S number. So, among the two records with higher number of party sites, the record with the smaller party ID is picked as the master record. The following table contains the sample record information for this use case.

Record Name

Party ID

Number of Party Sites

D-U-N-S Number

Master

Record 1

21

1

null

No

Record 2

22

2

null

Yes

Record 3

23

3

null

No

To create a master record with D-U-N-S number, number of party sites, and party ID, you add one more condition to the previous example where you set a master record with D-U-N-S number. Adding a condition to the previous example makes the rules complicated and cumbersome. Instead, you can create a simple rule for each condition to narrow down the list of potential master records and create another simple rule in the end to pick one record from the remaining potential master records.

Note: You can activate more than one survivorship rule at a time. When you activate multiple rules, make sure that the rules aren't conflicting and the conditions in the rule are set according to the priority.
The following figure displays the Survivorship Rules: Select Master Record page with the IF and THEN rules condition values for creating a set master rule to set the record that has D-U-N-S Number as master. The priority of the rule is set as highest. The details of the conditions are as follows:Priority: HighestIF condition: If number of non-null DUNS records is the count where {master is a HZ_ORGANIZATION_FactType.OrganizationPartyVO and master.DUNSNumberC isn't null} and number of non-null DUNS records more than 0 and master is a HZ_ORGANIZATION_FactType.OrganizationPartyVO and master.DUNSNumberC is nullTHEN condition: Then retract master
The Survivorship Rules: Select Master Record page with the IF and THEN rules condition values to set the record that has D-U-N-S Number as master.

Now, you set the conditions to set the record with the maximum number of party sites as the master.

The following figure shows the Survivorship Rules: Select Master Record page with the IF and THEN condition values to set the record with the maximum number of party sites as the master from the remaining potential records. The priority of the rule is set as higher. The details of the conditions are as follows.Priority: HigherIF condition: If maximum party site number is the maximum of master.PartySite.size() where {master is a HZ_ORGANIZATION_FactType.OrganizationPartyVO} and master is a HZ_ORGANIZATION_FactType.OrganizationPartyVO and master.PartySite.size() isn't maximum party site numberTHEN condition: Then retract master
The Survivorship Rules: Select Master Record page with the IF and THEN rules condition values to set the record that has more party sites as master.

When the records are screened with two previous conditions, you create a third condition to screen all remaining potential records with the smallest party ID.

The following figure shows the Survivorship Rules: Select Master Record page with the IF and THEN condition values for creating a set master rule to set the record with the smallest party ID as the master. The priority of the rule is set as medium. The details of the conditions are as follows.Priority: MediumIF condition: If masterPartyId is the minimum of master.PartyId where {master is a HZ_ORGANIZATION_FactType.OrganizationPartyVO}THEN condition: Assert new Result(name: "masterId",value:masterPartyId)
The Survivorship Rules: Select Master Record page with the IF and THEN rules condition to set the record with the smallest party ID as the master. This condition is picked only if the first two conditions aren't met.

In this example, the rules are created to narrow down the list of potential master records. When you activate more than one rule at a time you should set the conditions for the rule according to the priority to narrow down the list of potential master records. In this example Eliminate Null D-U-N-S Number rule is executed first to select records with D-U-N-S Number. Select the Most Address rule is executed next to find the master record with most number of party sites among the potential master records having D-U-N-S Number. Finally, Select Minimum Party ID rule is executed at the end to pick the minimum party ID from the remaining party records.