cancel
Showing results for 
Search instead for 
Did you mean: 

merge multiple inputs - BPM

Former Member
0 Kudos

I am trying to merge multiple (in my case 2) inputs based on a correlation ( I am just following the using the BpmPatternCollectPayload provided by SAP)

It works, but the output has only the first message.

For example

My first message is

<ID>100</ID>

<PO>

<ItemNumber>Item1</ItemNumber>

<ItemPrice>25</ItemPrice>

</PO>

second message is

<ID>100</ID>

<PO>

<ItemNumber>Item2</ItemNumber>

<ItemPrice>35</ItemPrice>

</PO>

the output is same as the first message

But I am expecting output as

<ID>100</ID>

<PO>

<ItemNumber>Item1</ItemNumber>

<ItemPrice>25</ItemPrice>

</PO>

<PO>

<ItemNumber>Item2</ItemNumber>

<ItemPrice>35</ItemPrice>

</PO>

Do I need to do any complex mapping or can I get the desired result using simple mapping?

Any help will be appreciated.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Mapping is not complex but you mus ensure that:

a) in interface mapping you have source occurency to many

b) in message mapping you can duplicate target structure and map fields one to one with corresponding source

Regards,

Wojtek

Former Member
0 Kudos

Yes, in my interface mapping I have source occurency to many.

The target message type's and source message type's data type is same. I have a simple 1 to 1 mapping of the columns.

I am not sure what else I need to check.

Is there a way to look into a detail mapping log?

Thanks

Former Member
0 Kudos

Hi,

You can test a message mapping. Prepare a test case in Test tab of message mapping and check queues.

Regards,

Wojtek

Former Member
0 Kudos

Hi ,

Make sure that the occurance of PO in your data type as 0 to unbounded and also test your mapping with the test tab.

/people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios

Sekhar

Former Member
0 Kudos

That link is good information. Thanks.

But the problem with my scenario is, I have 2 source messages, so I am not sure how to test that in message mapping or interface mapping!! Also since there is a correlation involved, I am not sure if we can mimic the correlation in message mapping test.

Yes the PO element is 0..unbounded.

Former Member
0 Kudos

Hi ,

Create duplicate sub tree of PO in the test tab of message mapping and test it there.

Sekhar

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi ,

For your requirement you need to collect the source messages using BPM with Payload collect pattern and process all the messages whose ID is "100"

You need to set a block condition where all the messages with 100 will get collected and when ever there is any change in ID it should process all the source data as a single message .

Please chcek what condition you have on collection block .

Nanda

Former Member
0 Kudos

Thanks everyone for your inputs. Our system was down for 3 days, so I couldn't get back earlier.

I solved the problem, the issue was in the mapping. I had to set the <PO>'s context at message level. (Previously I was thinking correlation was the issue )

Former Member
0 Kudos

hello,

what you need to do is check if for your souce structure root node is 0.. unbounded, than the target root node should be 1.

then for the source to target mapping for <po> use the node function remove context and assign to target. i think this solves your problem you will get single entry.

any more clarifications contact me.

thanks,

raju N.

Former Member
0 Kudos

Hi ,

As you mentioned you are using BPM collect pattern dependent on payload you should get the data merged as you expected.

Please check the condition ( Correlation condition ) to collect and exit the collection .

Nanda