on 12-11-2013 11:06 AM
Dear All,
I have to map the following structure:
source Target
MT_XYZ MT_ABC
Recordset Person
abc
Empdata1 def
abc ghi
def jkl
ghi
jkl
Empdata2
abc
def
ghi
jkl
I have to send either Empdata1 or Empdata2 to Person(Target) at a time.
Please help me for this requirement.
Hi Harinath,
Refer attached UDF, it is similar to your requirement.
Just change according to your input data.
Public void existsInContextEMPDATA(String[] a,String[] b,ResultList result,Container container){
for (int i = 0; i < a.length; i++) {
if (a[i].equalsIgnoreCase("abc")){
result.addValue(a[i]);
}
}
for (int i = 0; i < b.length; i++) {
if (b[i].equalsIgnoreCase("abc")){
result.addValue(b[i]);
}
}
Hope this will be helpful.
Regards,
Neelima.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Harinath,
Are 'abc' or 'def' fields or values?, it's different to have:
1.
<Empdata1>abc</Empdata1>
<Empdata1>def</Empdata1>
or to have:
2.
<Empdata1>
<abc>one</abc>
<def>two</abc>
</Empdata1>
I suppose that we are in the first case. You need the way to merge two source fields in one target field. Right now, i think two different way to achieve your goal, you can do:
1. An UDF which it has the Empdata1 and Empdata2 like input queues. You work with all value in the queue . You only need to write two FORs and to add the values to the output.
2. Make two mappings. The first like the show in this thread The second, you will need to collapse the contexts to have one queue like you strucure.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hari,
On what Condtion you have to map?
define the condition on root node & also change the occurrence of target (Person) is 1..1
Regards
gagan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.