on 01-30-2009 4:00 PM
Hi,
Do you know how do I retrieve the remote keys? I've already the record I want and find out how do i get the remote keys for each system. Can anyone help me?
e.g.
In a Country table i've already get the record id(mdm internal code), code (e.g. US), description (e.g. United States), what I need now is the remote keys associated to this record like:
AS400 - 1A
ECC - US
Oher legacy - 23
Thanks and Regards,
Eduardo
Hi,
you can get all the remote systems using the following code
///Get List of all the Remote system.
GetRemoteSystemListCommand getre = new GetRemoteSystemListCommand(pool);
getre.setSession(UsersessionId);
try {
getre.execute();
} catch (CommandException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
RemoteSystemProperties[] remSysId = getre.getRemoteSystems();
RemoteSystemId remoteSystem = null;
for(int i=0;i<remSysId.length;i++)
{
//compare the system with the passed system. and get the id of the passed system
if (remSysId<i>.getCode().equalsIgnoreCase("Remote system"))
{
remoteSystem = new RemoteSystemId(remSysId<i>.getId());
break;
}
}
/////*****************Conevert record id string inot recordid Object. *****************////
RecordId l_delRecId = new RecordId("R41");
RecordId[] l_re = new RecordId[1];
l_re[0]= l_delRecId;
///*****************Retriving the keymapping for selectd Record ids......***************//////////////
RetrieveRecordsKeyMappingsCommand rrkey = new RetrieveRecordsKeyMappingsCommand(pool);
rrkey.setSession(UsersessionId);
rrkey.setTableId(tbl);
rrkey.setRecordIds(l_re);
try {
rrkey.execute();
} catch (CommandException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}catch (RuntimeException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
RecordKeyMapping[] l_keyMaapings = rrkey.getKeyMappings();
KeyMapping l_keys = l_keyMaapings[0].getKeyMapping(remoteSystem);
String[] keys = l_keys.getKeys();
Regards,
Shruti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.