on 05-08-2007 7:46 AM
<b>Can any one help in writing a UDF for..........</b>
senario is - for every different value of name in source side i need to create a seperate at target side .This is using <b>message split</b>.
source:-
<b>Message1</b>
Details(unbounded)
-Name satya
-ID 13
Details(unbounded)
-Name Kiran
-ID 14
Target:-
<b>Message1</b>
Details
- Name satya
- ID 13
<b> Message2</b>
Details
- Name Kiran
-ID 14
Hi satya,
Please try with this code....you need to create context mapping...It has been tested in my m/c.
public static void MethodTestSDN(String[] name, String[] id,
ResultList result,Container container){
for(int i=0;i<name.length;i++){
if(name<i>!=null && !name<i>.equals("")){
result.addValue(name<i>);
result.addValue(id<i>);
}else{
result.addContextChange();
}
System.out.println("Name:"+name<i>);
System.out.println("Id:"+id<i>);
}
}
public static void main(String[] args) {
ResultListImpl result = new ResultListImpl();
Container container = null;
String a[] = {"Satya",ResultList.CC,"Kiran"};
String b[] = {"1",ResultList.CC,"2"};
MethodTestSDN(a,b,result,container);
}
Result:
<b>Name:Satya
Id:1
Name:__cC_
Id:__cC_
Name:Kiran
Id:2</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satya,
Could you please send complete source and target structures to jag.int@gmail.com id.
and i want to confirm that, will you get duplicate Names in source message?
Cheers,
Jag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You do not need a UDF for this.
Map the Details tag from the source to the Root tag of your message in the target./
This will ensure that for every Details Node in the source the Root is created in the target.
Regards
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
May its not possible coz
I have one source message type(S1) and two target message types(M1,M2)
In the mapping using the message tab have selected them.
S1
name
id
M1
name
id
M2
name
id
If i do as u said it will create a n detail nodes under the same message.
But my requriement is to create a detail node of every different value under different message like message1, message1..........
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
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.