cancel
Showing results for 
Search instead for 
Did you mean: 

Value Mapping replication GUID Logic

former_member189558
Contributor
0 Kudos

HI,

We are doing Value Mapping replication from ECC table entries to Pi Runtime Value Mapping cache.

We are generating the Group ID required for Value Mapping from ECC.

Here we are confused with the logic for GUID Generation.

At first I thought the driving factors are -- if there is already an entry for the same Source Agency, Source Scheme, Target Agency, Target Scheme and Target Value then it should go in the same group id, else a new gr id needs to be generated.

However it looks like that is incorrect.

Can somebody help us on what should be the logic for generating group id for Value mapping replication.

We have the scenario where the same source Agency, Scheme ,Value maps to multiple target Schemes... and it is not working if we have different Group ids...

Thanks,

Himadri

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

> We have the scenario where the same source Agency, Scheme ,Value maps to multiple target Schemes... and it is not working if we have different Group ids...

If you want to have multiple targets, then you have create pairs with unique GUID

like this:

A - 1 GUID X

A - 2 GUID Y

A - 3 GUID Z

The standard value mapping function does not work, when you have multiple targets. It will not return an entry.

You have to create a UDF for this purpose. You need to identify which target do you want to select from different values.

An UDF could look like this extract:

IFIdentifier source = XIVMFactory.newIdentifier(source_context,source_agency,source_scheme);
IFIdentifier target = XIVMFactory.newIdentifier(target_context,target_agency,target_scheme);
IFRequest request = XIVMFactory.newRequest(source,target,sourceValue);

try{
  IFResponse response = XIVMService.executeMapping(request);
  if (response.countTargetValues() > 0){
    String[] targetValues = response.getTargetValues();
// take first value of result
     return targetValues[0];
    }
  }

This example is taken from PI 7.1

Edited by: Stefan Grube on Oct 22, 2010 9:32 AM

former_member189558
Contributor
0 Kudos

Hello Stefan,

Many Thanks for your response.

Indeed it is working from an UDF.... however I find one difference that we do not need to take in array and it is always returning single value, which is the correct one. Thus we could use -- String retValue = response.getSingleTargetValue();.

I believe the reason being, although the same source maps to multiple targets, it is not mapping to multiple target values of same scheme and agency. Rather the scheme / agency always varies in the target. So this might be the reason it is finding a unique match. -- Whats surprising is, even then it is working only from an UDF and not from the standard available function.

Please let us know your thoughts on this.

Thanks,

Himadri

Edited by: Himadri Chakraborty on Oct 22, 2010 5:18 PM

stefan_grube
Active Contributor
0 Kudos

Is your value map something like this:

Agency    Scheme     Value

A1        S1         V1         
A2        S2         V2        
A3        S2         V3

In this case you create three entries in value map with unique GUID.

But I have no experience with this, as in my scenarios there are only two agencies involved.

former_member189558
Contributor
0 Kudos

Thanks Stefan,

With Unique GUID you mean GUIDs will be different for each target scheme / Agency pair right? Or do you meam they should be same?

Thanks,

Himadri

stefan_grube
Active Contributor
0 Kudos

let me check webster online:

unique: being the only one.

I mean: The same GUID

Former Member
0 Kudos

Hi Stefan,

I have a case, where I use the Value Mapping replication interface. I have a csv file with 1000s of records, that is in a diff structure which has the source and target values. I have a mapping step, where I map this with the standard Value mapping Structure. The VM structure has a group Id field, which accepts only the hexadecimal value that gets generated in ID. So How do I pass 1000s of group Ids for each of the value I pass in that interface?

Answers (0)