cancel
Showing results for 
Search instead for 
Did you mean: 

mapping issue

Former Member
0 Kudos

Hi Experts,

I have a problem in mapping below structures.

Source message

Target message.

I am using file content conversion

if the input file contains below values

DC,SD,2,ABCD,DEF

DC,GD,1,DEF,GHT

Generated output.

?xml version="1.0" encoding="UTF-8"?>

<CONTENT>

<CATALOGUES>

<DATACATALOGUES>

<IMODE>I</IMODE>

<CATNAME>SD</CATNAME>

<DESCR>ABCD</DESCR>

<DRUGTYPES>DEF</DRUGTYPES>

</DATACATALOGUES>

</CATALOGUES>

</CONTENT>

But the expected output.

?xml version="1.0" encoding="UTF-8"?>

<CONTENT>

<CATALOGUES>

<DATACATALOGUES>

<IMODE>I</IMODE>

<CATNAME>SD</CATNAME>

</EXTCATREF>

</VERSION>

</VERSDATE>

</VERSTIME>

<DESCR>ABCD</DESCR>

</DESCR_INIT>

<DRUGTYPES>2</DRUGTYPES>

</DRUGTYPES_INIT>

<IMODE>I</IMODE>

<CATNAME>GD</CATNAME>

</EXTCATREF>

</VERSION>

</VERSDATE>

</VERSTIME>

<DESCR>DEF</DESCR>

</DESCR_INIT>

<DRUGTYPES>1</DRUGTYPES>

</DRUGTYPES_INIT>

</DATACATALOGUES>

</CATALOGUES>

</CONTENT>

below 2 issues are raised during the mapping.

1. empty tags are not generating

2. only one record is populating.

Please advise on the above

Thanks

Sai

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

For those empty nodes,

In the mapping logic,If the source field is not existed.the target tags will be not generated.

If you want them generate,you can try to add "mapWithDefault" after the source field.

for the target segment DATACATALOGUES, It is possible to change to "0-*"?

Then the output should be like below

<CONTENT>

<CATALOGUES>

<DATACATALOGUES>

<IMODE>I</IMODE>

<CATNAME>SD</CATNAME>

</EXTCATREF>

</VERSION>

</VERSDATE>

</VERSTIME>

<DESCR>ABCD</DESCR>

</DESCR_INIT>

<DRUGTYPES>2</DRUGTYPES>

</DRUGTYPES_INIT>

</DATACATALOGUES>

<DATACATALOGUES>

<IMODE>I</IMODE>

<CATNAME>GD</CATNAME>

</EXTCATREF>

</VERSION>

</VERSDATE>

</VERSTIME>

<DESCR>DEF</DESCR>

</DESCR_INIT>

<DRUGTYPES>1</DRUGTYPES>

</DRUGTYPES_INIT>

</DATACATALOGUES>

</CATALOGUES>

</CONTENT>

Former Member
0 Kudos

Hi Gong,

Thanks . Empty tags issue was resolved with your input.

For the 2nd issue, i can't change the DATACATALOGUES occurrence.however i can change source side .

Thanks

Gopi

anand_shankar10
Active Participant
0 Kudos

If you cant change the cardinality of DATCATALOGUES, change it in signature tab of target mapping.

Former Member
0 Kudos

Hi Anand,

Target side, i am expecting one DATCATALOGUES node and under that all the values to be repeated in the same order. Target system is expecting the same.

Thnaks

Sai

Former Member
0 Kudos

Hi,

I donnot know how to make all the values to be repeated in the same order.

if change the logic for CATNAME to below

source -->removeContexts-->CATNAME

you will get the output.

<CONTENT>

<CATALOGUES>

<DATACATALOGUES>

....

<CATNAME>SD</CATNAME>

<CATNAME>GD</CATNAME>

</EXTCATREF>

</EXTCATREF>

.......

</DATACATALOGUES>

</CATALOGUES>

</CONTENT>

Former Member
0 Kudos

Hi Gong,

I tried same approach. it is repeating immediately.

UDF can help on this?

Thanks

Sai

anand_shankar10
Active Participant
0 Kudos

Hi,

I tried using context change and it works

Result

Hope it helps.

Regards

Anand

Former Member
0 Kudos

Hi,

you need to find out the source for the target occurences..that will solve your mapping issue..

i.e. e.g. IMODE has to occur how many times of the particular source node?..based on that you need to map to the IMODE node..which will solve your issue..

empty node doesnot have anything to do..

HTH

Rajesh

Former Member
0 Kudos

Hi Rajesh,

Empty nodes are required . Target system is requesting for empty nodes.

Coming to the mapping part, the target root node occurrence is only once.but inside the fields occurrence unbound.So same structure has to repeat 2 times without repeating root node.

Thanks

Sai