Custom scoring plugins require a specified data format.
<THRESHOLDS> <CONFIRMATION_THRESHOLD>string</CONFIRMATION_THRESHOLD> <DENY_THRESHOLD>string</DENY_THRESHOLD> </THRESHOLDS>
The thresholds are free-form strings. They are loaded from the MATCH_MERGE_ATTR table and need to conform to the format the plugin is expecting. The format is defined by the plugin author and can vary from plugin to plugin.
<ATTRIBUTE> <ATTR_TYPE_ID>unsigned int</ATTR_TYPE_ID> <ATTR_VALUE>string</ATTR_VALUE> <ATTR_LARGE_DATA>string</ATTR_LARGE_DATA> </ATTRIBUTE>
ATTR_LARGE_DATA can be an empty string depending on the attribute type and the ETL process. ATTR_LARGE_DATA is optional and should only be used when an attribute’s data is too large to fit in the ATTR_VALUE column. This must be determined during system configuration so the UMF can be correctly created and plugins can be written to use to use the correct fields.
ATTR_LARGE_DATA can be encoded to conform to XML’s valid character set. Base64 encoding is recommended, but this is done in the ETL process. The plugin might require unencoding the data in ATTR_LARGE_DATA. The string should also be UTF-8 encoded. If the string was base64 encoded in ETL, then the UTF-8 string will be identical to the ASCII7 string.
The following is a pseudocode example of a score function:
const int score(const char *thresholdStr, const uint thresholdSize, const char *inboundStr, const uint inboundSize, const char *candidateStr, const uint candidateSize, char *result, const uint resultSize) { //create strings out of thresholdStr, inboundStr, and candidateStr //create XML documents out of thresholdStr, inboundStr, and candidateStr //parse thresholds out of threshold xml doc if thresholds are used //parse values out of inbound xml doc //parse values out of candidate xml doc //check for any errors such as attr type mismatches, bad data, etc. //un-encode attr_value and attr_large_data data fields if necessary //apply scoring algorithm to attribute data //scale score into 0-100 range //determine confirmation or denial (possibly using thresholds) //if there was an error, create null terminated error string and //strcpy into result. Return -1. //if no error, create null terminated result document and strcpy into //result. Return 0. }
The score function should return -1 if an error is encountered.