cancel
Showing results for 
Search instead for 
Did you mean: 

line sequence in File Adapter

former_member440449
Participant
0 Kudos

Hi all,

I need to define how does the line sequence of a file has to be created.

For example, I have 3 structures in target mapping side:

struct1 (1..unbounded)

struct2 (1..unbounded)

struct3 (1..1)

Actually, the file is created in this way:

struct1

struct1

.

.

struct1

struct2

struct2

.

.

struct2

struct3

And in the file that must be created, I need to have this info inside it as this:

struct1

struct2

struct1

struct2

.

.

.

struct1

struct2

struct3

Does anybody know how can I do this with a file receiver adapter?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can get the required sequence in the target file by changing the target Datatype structure as follows.

Node (1..unbounded)

-> struct1 ( 0 ..unbounded)

-> struct2 ( 0 ..unbounded)

-> struct3 ( 0 ..1)

Where the Node is the parent node of struct1, struct2 and struct3

And make the required changes in the Message Mapping for the occurance of the Node.

Regards,

Aravind.

former_member440449
Participant
0 Kudos

Thanks Aravind for the reply.

I'm going to try it in that way, but is there a simple way to do this so I don't have to create again all the mapping after changing the DT? I mean if there is a chance to manipulate this in the file receiver adapter with content conversion.

Edit: in the way you told me to do this, I am not able to have the struct3 at the end of the target mapping. I can have it once but in the first one. It is like this:

struct1

struct2

struct3

struct1

struct2

struct1

struct2

.

.

struct1

struct2

And I need the struct3 to be at the end of the map.

any idea?

Answers (1)

Answers (1)

Shabarish_Nair
Active Contributor
0 Kudos

try this

/people/shabarish.vijayakumar/blog/2010/01/14/file-conversion-using-nodeception

former_member440449
Participant
0 Kudos

Issue was solved by creating structure as this:

Node (1..unbounded)

-> struct1 ( 0 ..1)

-> struct2 ( 0 ..1)

struct3 ( 1 ..1)

struct3 same level as Node

Thanks for your help!!!