on 02-26-2014 4:26 AM
I cant print from my machine the exact xml...
Node1
Node2
Node3
at a point of time only one node will come.
if Node1 comes need to pass A to target field xyz
if Node2 comes need to pass B to target field xyz
if Node3 comes need to pass C to target field xyz.
i know we can use exists and if function ...but this is one for one check only. I need to do 3 checks simultaneously and pass only one value to target ....
Any inputs will be helpfull
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks amit for inputs...it kind of worked.
But while testing found out that it is working only for one occurence of field.
if i duplicate subtree for multiple times and test it it is allways taking the first value and creating one target filed only, where as i need to create equal number fields as coming in source to target.
I know it is some thing to do with context changes ....
any inputs on how to handle this ?
thanks much in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jan - Any specific reason in going for multi mapping?
Have a look at the below blog -
what happens if you map it to create if? it should work i guess...
Also you said there are two IDOC's at target but you seems to be having 3 conditions so can you confirm how the IDOC's have to be created?
However i think you can also have separate mappings and in the interface determination use the xpath filter logic to execute the respective mapping
you can simply select the xpath in the condition editor..exists and equals are easy to validate using xpath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for the input now i changed design to handle on condition in ID.
Now in mapping:
From Source we will get 3 fields and one of them will have value and remaining do not occur...
can we handle it using UDF we take three input fields and to udf and pass the one which is not null:
I tired this udf but facing errors, can some one give inputs:
if{
( var1 =! null);
return var1;}
else
{
(var2 =! null);
return var2;}
else
{
(var3 =! null);
return var3;
}
Hello,
Why do u want to use UDF in mapping?
I mean using xpath conditions in ID u can filter our which mapping to execute, and in ESR just create different mappings for insert, delete and update?
To Exist Or Not to Exist is the Question - Process Integration - SCN Wiki
Thanks
Amit Srivastava
Hello,
>>But when in mapping source Structre will still contains 3 nodes we dont know which one will occur in runtime.
U want to use UDF just to output a filed value?
Use below UDF:
Execution type: all values of a context
Input value: var1, var2, var3
if (!var1[0].equals(""))
{
result.addValue(var1[0]);
}
else if (!var2[0].equals(""))
{
result.addValue(var2[0]);
}
else if (!var3[0].equals(""))
{
result.addValue(var3[0]);
}
Mapping:
Filed1-------MapWith Default()
Field2-------MapWith Default()----------UDF---Target
Field3-------MapWith Default()
Thanks
Amit Srivastava
Thanks
Amit Sriavstava
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.