cancel
Showing results for 
Search instead for 
Did you mean: 

Strategies with JAVA API

Former Member
0 Kudos

Hi all,

I´m trying to use a strategy that I made in Data Manager using JAVA API, but I couldn´t achieve that. I follow this article: but I don´t found any place for retrieve the matched records (only mentioned) and the documentation about this, is very limited.

Anyone, could help me giving to me any example code?

Thanks for your support!

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

isn't listed as point 4?

Former Member
0 Kudos

Hi Jun,

Yes, but that code, doesn´t show hoy to get that records, only show the ClassCommand to retrieve the records, but not, how to get them. And that example it´s with new records, I want to use the strategy with records that I get from a search.

Regards!

junwu
Active Contributor
0 Kudos

just follow the point 4

that is exactly what you need.

read it with your eyes open

Former Member
0 Kudos

Yeah, I already follow that doc for achieve my point. Yes, the point 4 talks about retrieve the matched records, but if You read it with "your eyes open" you can´t see for the records retrieved, for example, something like this:

Record[] recordsMatched = retMR.getMatchedRecords();

And, with "this" command you can see how to use your records that you matched. And the point of my question is that last thing, "How could I retrieve the matched records", and of course, how to use them, because for each source record it had an array of matched records.

Sorry for my reply, but, I write a question only if I don´t found an answer in the docs.

junwu
Active Contributor
0 Kudos

my god,

i thought you are not first day in MDM right?

a command is executed, you don't know how to get the result?

MatchingResult getMatchingResult()---->getMatchedRecordResults()


enough? you want more detail.....

Former Member
0 Kudos

Dude, thanks for your support, and yes, It´s not my first day...

that command retrieve the matched records, but how could I get each array of MatchedRecords for each sourceRecord?

MatchingResult mr = retMR.getMatchingResult();

And, mr object has the methods:

- getMatchedRecordResults(){type: MatchedRecordResult[]}

- getSourceRecord() {type: Record}

"I have an array of source records, not just one(1) record", and when I execute RetrieveMatchedRecordsCommand, It does for all records that I put in ExecuteMatchingStrategyCommand setSource() method.

Thanks!

junwu
Active Contributor
0 Kudos

setSource

public void setSource(Record[] records)

Sets the source records (required). These are the records to find matching for. Currently only one record is supported.

Former Member
0 Kudos

Jun,

I follow this documentation: ExecuteMatchingStrategyCommand (MDM Java API Library)

And, for the method: setSource(), does not said that only one is supported (I use the first one, I send the id´s of the records in the array RecordId[]):

setSource

public void setSource(RecordId[] recordIds)
Sets the source records (required*). These are the records to find matching for.

Parameters:
recordIds - a list of record Ids

setSource

public void setSource(Search search)
Sets the source records in a form of a search object (required*). These are the records to find matching for.

Parameters:
search - the search object
junwu
Active Contributor
0 Kudos

MDM Java API Library

go with this link.....show all classes

junwu
Active Contributor
0 Kudos

sorry, i was looking at ExecuteMatchingStrategyForNewRecordValuesCommand

i think you have to use RetrieveMatchingResultCommand

Former Member
0 Kudos

I know, but the doc of the class when you put the source Records in the object of the class ExecuteStrategyCommand is that I send you. Obviously I follow the documentation of the class that I need in the link that you give.

I will try:

1- loop the array of source records

2-for each source record, execute RetrieveMatchedRecordsCommand

3- setting up the the source record, via setRecordId() of the current RetrieveMatchedRecordsCommand object, in the loop.

4- get the Matched Records as we discuss

5- Apply my bussines logic or build my own [source + matchedRecords] Structure

Thanks man, I will do it and submit my results, I think that could be a good input for the documentation.

junwu
Active Contributor
0 Kudos

see my other reply, you don't have to do in that way.

Former Member
0 Kudos

Yeah dude, I will use this method of the class RetrieveMatchingResultCommand, that Retrieve ALL of I need:

getMatchingResults

public MatchingResult[] getMatchingResults()

Returns the matching results. Each matching result contains a source record and the list of matched records.

Note: For this command, MatchingResult.getMatchedRecordResults() will return null. Please use RetrieveMatchedRecordsCommand to retrieve this info.

Returns:
the matching results

Was a Really pleasure talk with you.

junwu
Active Contributor
0 Kudos

buddy, it will be great if issue is resolved.

junwu
Active Contributor
0 Kudos

can you set the question as resolved?

Answers (1)

Answers (1)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Patralekha,

Thanks for your reply, but that post is exactly the same that I comment in the question, however thanks again for your time.