IM InfoSphere Identity Insight, Version 8.0

score

Custom scoring plugins require a score function.

score contains the following parameters:

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);
thresholdStr
contains the confirm and deny thresholds. These thresholds are not required.
thresholdSize
is the size of the string contained in thresholdStr.
inboundStr
contains the attribute from the inbound entity being scored.
inboundSize
is the size of the string contained in inboundStr.
candidateStr
is a pointer to a string containing the attribute from the candidate entity being scored.
candidateSize
is the size of the string contained in candidateStr.
result
is a pre-allocated memory buffer to copy a null terminated string containing xml that describes the scoring results. In the case of an error, the results will be a description of the error. Format of this return string is defined as follows:
<SCORE_RESULT>
  <MATCH_SCORE>integer 0-100</MATCH_SCORE>
  <CONFIRMATION>TRUE/FALSE</CONFIRMATION>
</SCORE_RESULT>
In the case of an error, the result format is as follows:
<ERROR>error text</ERROR>
resultSize
is the size of the pre-allocated memory buffer that result points to. The result string cannot exceed this size. The result document is quite small, so this should not be an issue except with extremely long error messages.

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.



Feedback

Last updated: 2011