cancel
Showing results for 
Search instead for 
Did you mean: 

Split flatfile into multiple messages without a BPM?

Former Member
0 Kudos

Hi.

I'm getting a flatfile into PI and will be able to identify a keyrow based on a value lets call it "x".

Each time I find the row starting with "x" then I want to create a new message and being able to send it to a specific detsination.

All rows bellow the "x" row and until the next "x" row should be in the message.

example:

File payload:

xabcdefghiklmnopqrstuvwxyz

rabcdefghiklmnopqrstuvwxyz

sabcdefghiklmnopqrstuvwxyz

tabcdefghiklmnopqrstuvwxyz

xzyxwvutsrqponmlkihgfedcba

rzyxwvutsrqponmlkihgfedcba

szyxwvutsrqponmlkihgfedcba

tzyxwvutsrqponmlkihgfedcba

Result:

Message 1 based on:

xabcdefghiklmnopqrstuvwxyz

rabcdefghiklmnopqrstuvwxyz

sabcdefghiklmnopqrstuvwxyz

tabcdefghiklmnopqrstuvwxyz

Message 2 based on:

xzyxwvutsrqponmlkihgfedcba

rzyxwvutsrqponmlkihgfedcba

szyxwvutsrqponmlkihgfedcba

tzyxwvutsrqponmlkihgfedcba

Message 1 and 2 has to be able to be routed to different destinations.

How should I solve this without a BPM?

BR

Kalle

Accepted Solutions (0)

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

just send the message to two receivers and in the mapping for each of them remove the unwanted part - pretty simple and no BPM necessary

Regards,

Michal Krawczyk

Former Member
0 Kudos

What will happen if i have 3 entrys in the file and 2 are to be sent to one system but we want to have them as 2 seperate messages and 1 are to be sent to the other system?

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

is this dynamic or not ?

I assumed  it's not - hence my proposal

a) you can still work with many receivers and many mappings (conditions)

again two receivers and in one interface mappings two operation mappings with conditions

b) you can also do the split in the adapter module itself (custom development)

and you can send how many messages you want to the PI engine

Regards,

Michal Krawczyk

Former Member
0 Kudos

Do you have a link to any blog or guide regarding how to perform this?

udo_martens
Active Contributor
0 Kudos

Hi Kalle,

Do you have a fixed number of receivers?

If yes:

Then Michals approach is sufficient. You send the message to more receivers and make the mappings dependend from a condition. You should design your mappings as multi mappings (1:N) so you split for one receiver into more messages. (there was a blog from Jin Shin, but it s gone, thanks to new SCN design). In that case you would need a receiver adapter from Java Runtime.

If not:

You can put an enhanced receiver determination and create for each possible receiver a multimapping.

Regards,

Udo