cancel
Showing results for 
Search instead for 
Did you mean: 

Table to Flat Structure Mapping.

Former Member
0 Kudos

Hi All

Please can someone tell me how can we map a table to a flat structure..

Source Structure with Occurances.

1.ItemTab1 (0-unbounded)

1.1.ItemNumber (0-1).

1.2.ItemDescription (0-1).

Target Structure with Occurances.

2.ProductLine1 (0-1)

2.1.ProductNumber1 (0-1)

2.2.ProductDescription1 (0-1)

3.ProductLine2 (0-1)

3.1.ProductNumber2 (0-1)

3.2.ProductDescription2 (0-1)

etc (3,4,5 etc).

Its a table format from the source which will be in Item1 table- they would send about eight to ten records in Item1 format.

Thus:

row1 of Item table needs to map to Product1.

row2 of item table needs to map to Product2.

row3 of item table needs to map to Product3.

and so on.

please can anyone suggest exact mapping steps if the above can be done.

Thanks!.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Is there a way to do it without udf's?.. like by using split by value or remove contexts?

I tried this blog

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

but the problem is it is just generates the 1st record enetered in ItemTab in productline1.

when i try to duplicate the subtree to generate more values in itemtab1 it does not map the second row at all.

Please suggest if there is any other approach other than a udf..

Thanks.

former_member214364
Active Contributor
0 Kudos

Hi,

Please go through the following pictures,UDFs code and do mapping.

http://www.flickr.com/photos/14144840@N02/2785522503/

http://www.flickr.com/photos/14144840@N02/2786446204/

http://www.flickr.com/photos/14144840@N02/2785599763/

Note: As shown in PIC-1,you dont have to map ProductLine2,ProductLine3 and so on.

This is only for ProductLine1.

Please let m know if there are any issues.

Cheers,

Jag

former_member214364
Active Contributor
0 Kudos

Hi ,

Do you have source and Target structures as shown in the following PIC?

http://www.flickr.com/photos/14144840@N02/2785485267/

If Yes i have mapping logic.

Please let me know ASAP.

Cheers,

Jag

Former Member
0 Kudos

do u mean u need to dynamically create product line nodes based on occurrence in itemtab table

Former Member
0 Kudos

Hi,

You need to use simple UDF to pass the corresponding values.

As you will be mapping to 1st structure pass one constant value

(a) temTab1 -


> TestUDF -


> ProductLine1

(b) Constant value "1"--->

Cache Parameter as == Queue and two input parameters as "a" & "b"

//write code here

int i = Integer.valueOf(b);

result.addValue(a<i>);

Use the above UDF for all fields and as per the sequence no of structure it will pass to that flat structure.

Thanks

swarup