Example for MergeRecord Activity

Single Record Merge Using Direct Merge

Examples for MergeRecord activity include:
  • Single record merge using direct merge
  • Single record merge from work item
  • Bulk record merge using direct merge
  • Bulk record merge using direct merge
<Activity Name="DirectMerge">
<Action>MergeRecord</Action>
<Description>Merge record data</Description>
<Execution>SYNCHR</Execution>
<!--Parameter name="ReferenceStepID" direction="in" eval="variable" type="long">update_step</Parameter-->
<Parameter name="InDocument" direction="in" eval="variable" type="document">workDoc</Parameter>
<Parameter name="SourceRecordKey" direction="in" eval="xpath" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionDetails/CatalogItem[LineNumber=1]/PartNumber/GlobalPartNumber/ProdID/DBID/text()" type="string">inDoc</Parameter>
<Parameter name="TargetRecordKey" direction="in" eval="variable" type="string">MatchingRecordKey</Parameter>
<Parameter name="VersionOption" direction="in" eval="constant" type="string">LATEST</Parameter>
<Parameter name="SaveFlag" direction="in" eval="constant" type="string">SAVE</Parameter>
<Parameter name="SkipMergeAttributeList" direction="in" eval="variable" type="arraylist">skipMergeAttributeList</Parameter>
<Parameter name="eventState" direction="in" eval="constant" type="string">MERGERECORD</Parameter>
<Parameter name="OutDocument" direction="out" eval="variable" type="document">workDoc</Parameter>
<Parameter direction="in" name="RejectFlag" type="boolean" eval="constant">TRUE</Parameter>
<Parameter name="RecordKey" direction="out" eval="variable" type="arraylist">RecordKey1</Parameter>
</Activity>

Single Record Merge from Work Item

<Activity Name="MergeFromWI">
<Action>MergeRecord</Action>
<Description>Merge record from workitem</Description>
<Execution>SYNCHR</Execution>
<Parameter name="ReferenceStepID" direction="in" eval="variable" type="long">update_step</Parameter>
<Parameter name="InDocument" direction="in" eval="variable" type="document">inDoc</Parameter>
<Parameter name="VersionOption" direction="in" eval="constant" type="string">LATEST</Parameter>
<Parameter name="SaveFlag" direction="in" eval="constant" type="string">SAVE</Parameter>
<Parameter name="eventState" direction="in" eval="constant" type="string">MERGERECORD</Parameter>
<Parameter name="OutDocument" direction="out" eval="variable" type="document">workDoc</Parameter>
<Parameter name="RecordKey" direction="out" eval="variable" type="arraylist">RecordKey1</Parameter>
</Activity>

Bulk Record Merge Using Direct Merge

<Activity Name="MergeRecordBulk">
<Action>MergeRecord</Action>
<Description>Merge record data</Description>
<Execution>SYNCHR</Execution>
<Parameter name="eventState" direction="in" eval="constant" type="string">MERGERECORD</Parameter>
<Parameter name="ReferenceStepID" direction="in" eval="variable" type="long">update_step</Parameter>
<Parameter name="RecordKey" direction="out" eval="variable" type="arraylist">RecordKey1</Parameter>
</Activity>

Bulk Record Merge from Work Item

<Activity Name="MergeRecordBulkFromWI">
<Action>MergeRecord</Action>
<Description>Merge record data</Description>
<Execution>SYNCHR</Execution>
<Parameter name="eventState" direction="in" eval="constant" type="string">MERGERECORD</Parameter>
<Parameter name="ReferenceStepID" direction="in" eval="variable" type="long">MatcherProcessLogID</Parameter>
<Parameter name="InDocument" direction="in" eval="variable" type="document">inDoc</Parameter>
<Parameter name="SourceRecordKey" direction="in" eval="constant" type="string">123</Parameter>
<Parameter name="TargetRecordKey" direction="in" eval="constant" type="string">456</Parameter>
<Parameter name="VersionOption" direction="in" eval="constant" type="string">LATEST</Parameter>
<Parameter name="SaveFlag" direction="in" eval="constant" type="string">SAVE</Parameter>
<Parameter name="OutDocument" direction="out" eval="variable" type="document">workDoc</Parameter>
<Parameter name="RecordKey" direction="out" eval="variable" type="arraylist">RecordKey1</Parameter>
</Activity>

Examples

Consider a case where the source record is:

Product ID Extn UOM Record Type Enterprise
X X PL CUST ACME

Consider a case where the target record is:

Product ID Extn UOM Record Type Enterprise Record Version
Y Y CS ADDR MYACME 1

Case 1: The SkipMergeAttributeList and AllowMergeAttributeList parameters are not specified

The source record is merged with productid-extn and a new version is created.

Product ID Extn UOM Record Type Enterprise Record Version
Y Y PL CUST ACME 2

Case 2: The SkipMergeAttributeList and AllowMergeAttributeList parameters are specified but no attributes in result

This is the same as Case 1, that is, the source record is merged with productid-extn and a new version is created.

Product ID Extn UOM Record Type Enterprise Record Version
Y Y PL CUST ACME 2

Case 3: AllowMergeAttributeList parameter set for UOM

  Product ID Extn UOM Record Type Enterprise Record Version
Source Record X X PL CUST ACME  
Target Record Y Y CS ADDR MYACME 1

The resultant record contains the source UOM:

Product ID Extn UOM Record Type Enterprise Record Version
Y Y PL ADDR MYACME 2

Case 4: SkipMergeAttributeList parameter set for RECORD_TYPE

  Product ID Extn UOM Record Type Enterprise Record Version
Source Record X X PL CUST ACME  
Target Record Y Y CS ADDR MYACME 1

The resultant record carries the source Record_Type into the target.

Product ID Extn UOM Record Type Enterprise Record Version
Y Y PL ADDR ACME 2

Case 5: Relationship Merge

Relationship Merge

Consider the following record hierarchy:

The resultant record contains the matching attributes of the source and target records, specified allow merge attributes of the source record, and the relationship merge.