cancel
Showing results for 
Search instead for 
Did you mean: 

File sender adapter: Content conversion for very deep nested structure

Former Member
0 Kudos

Hi all

I have a file which looks like this

HDOCKET    9800000660980000061911062009AA123456bbWM100012349800000619
DDOCKET_TEST001 4012YAG1  
WZOA00000000010000000001
WZOA00000000020000000002
WZOB00000000030000000003
IAAXX000001
IAAXX000002
C0000000000000000000100000000000000000001000000000000000000020000000000000000000300000000000000000004
T2

and my structure is

Header  - 1
Detail     - 0....Unbounded
        Bag     - 0.....Unbounded   (sub node of detail)
        Track  - 0.....Unbounded    (sub node of detail)
        Customer - 0.....Unbounded    (sub node of detail)
Trailer    - 1

and in the file sender adapter i mentioned the following content conversion setting

HEADER,1,DETAIL,*,Bag,*,Track,*,Customer,*,TRAILER,*

But when i go and see in the monitoring i received the following conversion

<?xml version="1.0" encoding="utf-8" ?> 
<ns:MT_REQ xmlns:ns="http://royalmail.com/dd_c">
 <HEADER>
  <ID>H</ID> 
  <INT>DD</INT> 
  <CAR>9899999660</CAR> 
  <CUS>9899999619</CUS> 
  <POST>11062009</POST> 
  <NUMBER>AA123456bbWM10001234</NUMBER> 
  <ACC>9899999619</ACC> 
  </HEADER>
 <DETAIL>
  <ID>D</ID> 
  <Bag>DOCKET_TEST001</Bag> 
  <S>4012</S> 
  <Code>YAG</Code> 
  <mat>1</mat> 
  <count/> 
  <Mixed /> 
  </DETAIL>
 <Bag>
  <ID>W</ID> 
  <Zone>ZOA</Zone> 
  <Item>0000000001</Item> 
  <Number>0000000001</Number> 
  </Bag>
 <Bag>
  <ID>W</ID> 
  <Zone>ZOA</Zone> 
  <Item>0000000001</Item> 
  <Number>0000000001</Number> 
  </Bag>
 <Bag>
  <ID>W</ID> 
  <Zone>ZOA</Zone> 
  <Item>0000000001</Item> 
  <Number>0000000001</Number> 
  </Bag>
  </Bag>
 <Track>
  <ID>I</ID> 
  <Item>AAXX000001</Item> 
  </Track>
 <Track>
  <ID>I</ID> 
  <Item>AAXX000001</Item> 
  </Tracked>
 <Customer>
  <ID>C</ID> 
  <OrigCustomer>00000000000000000001</OrigCustomer> 
  <Field1>00000000000000000001</Field1> 
  <Field2>00000000000000000002</Field2> 
  <Field3>00000000000000000003</Field3> 
  <Field4>00000000000000000004</Field4> 
  </Customer>
 <TRAILER>
  <ID>T</ID> 
  <Count>2</Count> 
  </TRAILER>
  </ns:MT_REQ>

whereas i wanted it like:

<?xml version="1.0" encoding="utf-8" ?>

<ns:MT_REQ xmlns:ns="http://royalmail.com/dd_c">

<HEADER>

<ID>H</ID>

<INT>DD</INT>

<CAR>9899999660</CAR>

<CUS>9899999619</CUS>

<POST>11062009</POST>

<NUMBER>AA123456bbWM10001234</NUMBER>

<ACC>9899999619</ACC>

</HEADER>

<DETAIL>

<ID>D</ID>

<Bag>DD_TEST001</Bag>

<S>4012</S>

<Code>egg</Code>

<mat>1</mat>

<count/>

<Mixed />

<Bag>

<ID>W</ID>

<Zone>zzz</Zone>

<Item>0000000001</Item>

<Number>0000000001</Number>

</Bag>

<Bag>

<ID>W</ID>

<Zone>zzz</Zone>

<Item>0000000001</Item>

<Number>0000000001</Number>

</Bag>

<Bag>

<ID>W</ID>

<Zone>zzz</Zone>

<Item>0000000001</Item>

<Number>0000000001</Number>

</Bag>

</Bag>

<Track>

<ID>I</ID>

<Item>AAXX000001</Item>

</Track>

<Track>

<ID>I</ID>

<Item>AAXX000001</Item>

</Tracked>

<Customer>

<ID>C</ID>

<OrigCustomer>00000000000000000001</OrigCustomer>

<Field1>00000000000000000001</Field1>

<Field2>00000000000000000002</Field2>

<Field3>00000000000000000003</Field3>

<Field4>00000000000000000004</Field4>

</Customer>

</DETAIL>

<DETAIL>

<ID>D</ID>

<Bag>DD_TEST002</Bag>

<S>4012</S>

<Code>egg</Code>

<mat>1</mat>

<count/>

<Mixed />

<Bag>

<ID>W</ID>

<Zone>zzzzzz</Zone>

<Item>0000000001</Item>

<Number>0000000001</Number>

</Bag>

<Bag>

<ID>W</ID>

<Zone>ZOA</Zone>

<Item>0000000001</Item>

<Number>0000000001</Number>

</Bag>

<Bag>

<ID>W</ID>

<Zone>zzz</Zone>

<Item>0000000001</Item>

<Number>0000000001</Number>

</Bag>

</Bag>

<Track>

<ID>I</ID>

<Item>AAXX000001</Item>

</Track>

<Track>

<ID>I</ID>

<Item>AAXX000001</Item>

</Tracked>

<Customer>

<ID>C</ID>

<OrigCustomer>00000000000000000001</OrigCustomer>

<Field1>00000000000000000001</Field1>

<Field2>00000000000000000002</Field2>

<Field3>00000000000000000003</Field3>

<Field4>00000000000000000004</Field4>

</Customer>

</DETAIL>

<TRAILER>

<ID>T</ID>

<Count>2</Count>

</TRAILER>

</ns:MT_REQ>

i.e. i need all Bag ,Track and Customer inside detail tag.

could anyone help me in this..i've already searched SDN and got some link as useful but none of them were totally related.

Regards

Naina

Accepted Solutions (0)

Answers (2)

Answers (2)

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi naina,

hope fine. as i know you cannot create an xml with more than 3 nested structures ussing FCC.

Ex:

root

-


details

-


subdatails

-


subsubdatails

-


etc

you cannot define this kind of structure.

Thanks

Former Member
0 Kudos

That is not true Rodrigo, i did the same thing converted single level file to multi-level using MessageTranformationBean.

Yes do have to do apply some logics & insert some pseudo contexts but It is possible.

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

Lailat,

i agree with you, is posible but not ussing only the standar configuration. everithing is posible with this integration tool.

also i agree to use MessageTransformationBeams Module to solve this issue

Rgds

RP

Former Member
0 Kudos

Naina

Pls. check my forum link, i had the single level hierarchy XML file which I converted into nested structure & then into flat file.

This can give you an idea how to go ahead. Let me know in case you need any more info about this.