Hello,
I am trying to use RetrieveMatchingResultCommand to retrieve a matching result, but got some odd problem.
The matching is successfully executed by ExecuteMatchingStrategyCommand.
When retrieving the matching result by RetrieveMatchingResultCommand,
I got the correct value for:
getMatchCount() //1 record matches the source
getHighestScore() //the score is 82
getHighestMatchingClass() // the class is High
but I got blank return for getSourceRecord()
and NULL for getMatchedRecordResults()
My question is that since there are values in MatchCount() and HighestScore(), how come there is no value in the MatchedRecordResults() and SourceRecord()???
Please see my code below:
//Execute Matching
ExecuteMatchingStrategyCommand efvc = new ExecuteMatchingStrategyCommand repository.getConnection());
efvc.setStrategyId(MatchingStrategy[0].getId());
efvc.setSource(search);
efvc.setTarget(searchTarget);
efvc.setSession(repository.getAuthenticatedUserSession().getSession());
efvc.execute();
//Retrive Matching Result
RetrieveMatchingResultCommand rmrc = new RetrieveMatchingResultCommand(repository.getConnection());
rmrc.setMatchingTaskId(efvc.getMatchingTaskId());
rmrc.setResultDefinition(rd);
rmrc.setSource(search);
rmrc.setSession(repository.getAuthenticatedUserSession().getSession());
rmrc.execute();
System.out.println("length : "+rmrc.getMatchingResults().length);
for(int i=0;i<rmrc.getMatchingResults().length;i++){
System.out.println();
System.out.print(" MatchCount : "+rmrc.getMatchingResults()<i>.getMatchCount());
System.out.print(" SourceRecord : "+rmrc.getMatchingResults()<i>.getSourceRecord());
System.out.print(" HighestScore : "+rmrc.getMatchingResults()<i>.getHighestScore());
System.out.print(" HighestMatchingClass: "+rmrc.getMatchingResults()<i>.getHighestMatchingClass());
System.out.print(" MatchedResult : "+rmrc.getMatchingResults()<i>.getMatchedRecordResults());
}
Result:
MatchCount : 1 SourceRecord : HighestScore : 82 HighestMatchingClass: 2 MatchedResult : null
Thank you.