IM InfoSphere Identity Insight Version 8.0

score

Angepasste Scoring-Plug-ins erfordern eine Funktion 'score'.

score enthält folgende Parameter:

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
enthält die Bestätigungs-/Zurückweisungsschwellenwerte. Diese Schwellenwerte sind nicht erforderlich.
thresholdSize
ist die Größe der Zeichenfolge, die in 'thresholdStr' enthalten ist.
inboundStr
enthält das Attribut aus der eingehenden Entität, die bewertet wird.
inboundSize
ist die Größe der Zeichenfolge, die in 'inboundStr' enthalten ist.
candidateStr
ist der Zeiger auf eine Zeichenfolge, die das zu bewertende Attribut aus der Kandidatenentität enthält.
candidateSize
ist die Größe der Zeichenfolge, die in 'candidateStr' enthalten ist.
result
ist ein vorab zugeordneter Hauptspeicherpuffer zum Kopieren einer auf null endenden Zeichenfolge, die XML zur Beschreibung der Scoring-Ergebnisse enthält. Bei einem Fehler stellen die Ergebnisse eine Beschreibung des Fehlers dar. Das Format dieser zurückgegebenen Zeichenfolge ist wie folgt definiert:
<SCORE_RESULT>
  <MATCH_SCORE>ganze Zahl 0-100</MATCH_SCORE>
  <CONFIRMATION>TRUE/FALSE</CONFIRMATION>
</SCORE_RESULT>
Bei einem Fehler lautet das Ergebnisformat wie folgt:
<ERROR>Fehlertext</ERROR>
resultSize
ist die Größe des vorab zugeordneten Hauptspeicherpuffers, auf den 'result' verweist. Die Ergebniszeichenfolge darf diese Größe nicht überschreiten. Da das Ergebnisdokument relativ klein ist, sollte dies kein Problem darstellen, außer bei extrem langen Fehlernachrichten.

Es folgt ein Pseudocodebeispiel der Funktion 'score':

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.
}

Die Funktion 'score' sollte beim Auftreten eines Fehlers '-1' zurückgeben.



Feedback

Letzte Aktualisierung: 2009