on 2009 Nov 12 4:43 PM
Hello All,
I have a requirement where I am unable to get exact value where needed from idoc
idoc
---
--Field1
--Field2
---Field3
---Field4
</Idoc>
I need to map Field1 equals to A then I need to pass Filed3 value where Filed1 and Field 3 are multiple Occurance..
There might be possible to having only Field1 value and no Field3 value... I wrote a User DF but I am geting Outbound array error.
MappingTrace mapTrace = container.getTrace();
for(int i=0;i<a.length;i++)
{
if(a<i>.equals("A"))
{
mapTrace.addWarning(" Value for" +A<i>);
mapTrace.addWarning(" Value for" +Field2.value);
}
}
I tried with i but its throwing outbound error as there are no field2 values for some Field1 values..
Please help.
Rajeev
Hi Rajeev,
please try the mapping as shown in the following pic.
http://www.flickr.com/photos/14144840@N02/4099427554/
Context UDF fn
String str = "";
for(int k=0; k < var2.length; k++)
{
if(var1[0].equals(var2[k]))
{
str = var3[k];
break;
}
}
result.addValue(str);
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,
<IDOC>
--
--Field1<A>
--Field2<V>
--Field3<H>
-
--Field1<B >
--Field2<V>
--Field3<O>
-
--Field1<C>
--Field2<V>
--Field3<G>
-
--Field1<B >
--Field2<V>
-
If Field1=B then I need to pass Field3 value... I used Graphical mapping but I am getting some other values instead of required values... some other values H or G
I created UDF in which I am getting I am getting Outbound error.
How can I get appropriate values?
Thanks
Rajeev.
*If Field1=B then I need to pass Field3 value... I used Graphical mapping but I am getting some other values instead of required
values... some other values H or G*
Are Field1, Field2, Field3 recurring?
Field1
----> equalS(TextFunction) ---> if(Field3--> Then) --> target node
Constant(B)
You will not get proper values if you do not change the Contaxt of the source nodes....when the source nodes are repeating and the condition needs to scan all the occurences then you either need to raise the COntext of the source nodes or make use of node functions like RemoveContext/ CollapseContext.....in the above mapping logic raise the Context of the Field1 and Field3 to a higher node.
Regards,
Abhishek.
would it be possible for you to illustrate your scenario via an example( sample data) ?
Pooja Pandey.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.