memMatch Java™ example
Example code explores the capabilities of memMatch.
// Create the member match interaction object.
IxnMemMatch memMatch = new IxnMemMatch(ctx);
// Create member rowlists to hold input
// and output row(s).
MemRowList inpMemRows = new MemRowList();
MemRowList outMemRows = new MemRowList();
// Create a MemHead object to pass in the member's ID numbers
// for whom we wish to find the matches.
// MemHead models database table mpi_memhead.
MemHead memHead = new MemHead();
// Set the identifiers of member to be matched.
memHead.setSrcCode("RMC");
memHead.setMemIdnum("112917");
memHead.setMemRecno(0);
memHead.setEntRecno(0);
inpMemRows.addRow(memHead);
// Set a segment code filter to limit
// output to specific segments.
memMatch.setSegCodeFilter("MEMHEAD,MEMATTR,MEMNAME," + "MEMADDR,MEMPHONE,MEMIDENT,MEMDATE");
// Set the record status indicators desired.
// The values include (A)ctive, (I)nactive, (D)eleted and (S)hadow.
memMatch.setRecStatFilter("A,I");
memMatch.setMinScore((short) 1);
// Set the member type to one of the member
//types listed in the mpi_memtype table.
memMatch.setMemType("<member-type>");
// Set entity type to one of the entity types
// listed in mpi_enttype table.
memMatch.setEntType("<entity-type>");
// GetType.ASMEMBER- specifies that only individual
// members will be retrieved
// SearchType.ASMEMBER- tells the search to compare
// the input on a member by member basis..
// KeyType.MEMIDNUM - specifies the srcCode/memIdnum is the
// retrieval key
// Execute the member match interaction.
memMatch.execute(inpMemRows, outMemRows, GetType.ASMEMBER,
SearchType.ASMEMBER, KeyType.MEMIDNUM);
The resulting rows are stored in outMemRows upon successful completion of the interaction. Additional Member Match information includes:
- Possible values for GetType are GetType.ASMEMBER
and GetType.ASENTITY:
- GetType.ASMEMBER – Returns only members that match the search criteria
- GetType.ASENTITY – Returns members that match the search criteria and any members that are linked to those matching members
- Currently the only valid Search Type available is ASMEMBER.
- The key type defines which key value is to be used
for the search. The possible values are:
- KeyType.MEMRECNO – MemRecno is the retrieval key
- KeyType.ENTRECNO – EntRecno is the retrieval key
- KeyType.MEMIDNUM – SrcCode and MemIdnum is the retrieval key
- Keytype.UNKNOWN – Placeholder value which shows that KeyType is not yet set