on 06-17-2016 2:26 AM
Hi Gurus!
I want to make a scenario for VMG replication from .csv files to runtime java cache.
As you know in request message we can have multiple "Item" elements with separate "Operation" value inside it.
My question is: if I set "Delete" operation for context in first element and set multiple "Insert" operations for further "Item" elements - is this sequense preserved during my request processing at receiver side? Or I need to perform multiple requests in sequense?
Regards, Evgeniy.
Hello Evgeniy,
Yes this is preserved.I just tried this on my server. Results as below
Scenario: Delete Operation Followed by Insert Operation
Results: Insert Operation is available as per sequence
As-Is Situation
New Request with Delete and Insert operation
Updated Value Mapping with Inserted Value
My question though: If you plan to update an existing entry, you do not need a explicit Delete. Just use Insert and it updates the existing entry.
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe I didn't catch the basics in VMG concept 🙂
My file looks like:
U1 = 220
V1 = 112
...
and another file looks like:
CDB10004567 = 34543456
V100009998 = 12224535
...
and the third looks like:
V1 = 2114
U1 = 2907
...
So as I understand my VMG's should look like :
<GroupID>
Agency = "System1" Scheme="Scheme1" Value = "U1"
Agency = "System2" Scheme="Scheme2" Value = "220"
<GroupID>
Agency = "System1" Scheme="Scheme1" Value = "V1"
Agency = "System2" Scheme="Scheme2" Value = "112"
....
And so on. Or I'm getting wrong and it could look like:
<GroupID>
Agency = "System1" Scheme="Scheme1" Value = "U1"
Agency = "System2" Scheme="Scheme2" Value = "220"
Agency = "System1" Scheme="Scheme1" Value = "V1"
Agency = "System2" Scheme="Scheme2" Value = "112"
?
Regards, Evgeniy
Evgeniy,
I now understand where you are coming from. You are using the more classical approach to Value Mapping. I use this approach of ValueMapping :
If you go through this blog, you will understand that,
So, taking this into account, When I perform my value mapping replication my request will take
Field | Value | Explanation |
---|---|---|
Group ID | fe9ffaa0494211dea47b001e372d2d65 | Unique per Key-Pair Group |
Context | http://test.com/xi/VMGGroup1 | Unique per Key-Pair Group |
Agency | EmpID_EmpName | Unique per Key-Pair Group |
Scheme | Emp,2,3 | Keys |
Identifier | EmpName,Bhavesh,John | Values |
Sample XML Request
<sys:ValueMappingReplication>
<!--1 or more repetitions:-->
<Item>
<Operation>Insert</Operation>
<!--Optional:-->
<GroupID>fe9ffaa0494211dea47b001e372d2d65</GroupID>
<Context>http://test.com/xi/VMGGroup1</Context>
<!--Optional:-->
<Identifier scheme="EmpID" agency="EmpID_EmpName">EmpName</Identifier>
</Item>
<Item>
<Operation>Insert</Operation>
<!--Optional:-->
<GroupID>fe9ffaa0494211dea47b001e372d2d65</GroupID>
<Context>http://test.com/xi/VMGGroup1</Context>
<!--Optional:-->
<Identifier scheme="2" agency="EmpID_EmpName">Bhavesh</Identifier>
</Item>
<Item>
<Operation>Insert</Operation>
<!--Optional:-->
<GroupID>fe9ffaa0494211dea47b001e372d2d65</GroupID>
<Context>http://test.com/xi/VMGGroup1</Context>
<!--Optional:-->
<Identifier scheme="3" agency="EmpID_EmpName">John</Identifier>
</Item>
</sys:ValueMappingReplication>
If you look at this example,
- Only Scheme and corresponding Identifier is different.
Data Stored in ValueMappingCache
How do I access this in Graphical Mapping
Use the Below UDF. inputKey is the Input to the UDF.
IFIdentifier source = XIVMFactory.newIdentifier("http:/"+"/test.com/xi/VMGGroup1","EmpID_EmpName","EmpID");
IFIdentifier target = XIVMFactory.newIdentifier("http:/"+"/test.com/xi/VMGGroup1","EmpID_EmpName",inputKey);
IFRequest request = XIVMFactory.newRequest(source,target,"EmpName");
AbstractTrace trace = container.getTrace();
String value ="";
try{
IFResponse response = XIVMService.executeMapping(request);
if (response.countTargetValues() > 0){
String[] targetValues = response.getTargetValues();
trace.addWarning(targetValues[0]);
// take first value of result
value = targetValues[0];
}
}
catch(Exception e){
}
return value;
So when my UDF has input as
When a new set of values needs to be uploaded, Delete Old Group as per my previous response and then insert new entries!
Hope this makes sense
PS : Due credit to my Friend / Colleague who took time to enlighten me on this approach and wrote the above blog after some prodding!
Regards,
Bhavesh
Hi Evgeniy,
Using multi-mapping with option to maintain order at runtime will do the trick. Although I was trying to find the option in iFlow and could not locate it. It is available in ICO though.
Regards,
Sajneev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.