cancel
Showing results for 
Search instead for 
Did you mean: 

Split messages while using content based routing

xinjiang_li
Active Participant
0 Kudos

Hi gurus,

We are using content base routing by checking the value of field F1 in our scenario. If the value is V1, then route to system A; If the value is V2, then route to system B.

There are two layer in the send message type: layer1 and layer2. Both layer1 and layer2 can occur many times.

As you know, The field maybe existed many times in the real messages. Sometimes with the value V1, sometimes with the value V2.

If F1 is in the layer1, can we split into two messages by judging the value of F1?

If F1 is in the layer2, can we split into two messages by judging the value of F1?

Thanks in advance.

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member184681
Active Contributor
0 Kudos

Which is exactly what I suggested to do

Secondly, you need to prepare two separate Message Mappings. In each of them, you need to make a conditional mapping of the required nodes: in the mapping for system 1, only map segments where F1 = V1 (by the IF function). In the other mapping, only map segments where F1 = V2. I'm afraid there is no other option to solve your problem.

xinjiang_li
Active Participant
0 Kudos

Solved by adding some logic in message mapping to separate different values. thanks

former_member184681
Active Contributor
0 Kudos

Hi,

Then you need to split your logic into two separate parts. First of all, you create a Receiver Determination just the way I described before. This will give you the message split whenever necessary, and messages will be sent to respective further processing steps.

Secondly, you need to prepare two separate Message Mappings. In each of them, you need to make a conditional mapping of the required nodes: in the mapping for system 1, only map segments where F1 = V1 (by the IF function). In the other mapping, only map segments where F1 = V2. I'm afraid there is no other option to solve your problem.

Hope this helps,

Grzegorz

xinjiang_li
Active Participant
0 Kudos

Hi Grzegorz,

I did as you suggest, but the result was still as below(V1 and V2 both emerged in system A and B, which was not we want):

<DATA>

<F1>V1</F1>

...

</DATA>

<DATA>

<F1>V2</F1>

...

</DATA>

<DATA>

<F1>V1</F1>

...

</DATA>

We tried to split message in message mapping by enter two receive message type, but there were error while testing in XMLSPY.

Any ideas?

former_member184681
Active Contributor
0 Kudos

Hi,

If you enter multiple conditions in Receiver Determination and many of them will be matched by a single message, it will be duplicated automatically by PI without any further configuration. So all you need to do is specify your criteria in Receiver Determination:

if F1 = V1 then Communication Component (system) A

if F2 = V2 then Communication Component (system) B.

Regards,

Grzegorz

xinjiang_li
Active Participant
0 Kudos

Hi Grzegorz,

Thanks for your reply.

Actually my case is as follows:

(send messge)

<DATA>

<F1>V1</F1>

...

</DATA>

<DATA>

<F1>V2</F1>

...

</DATA>

<DATA>

<F1>V1</F1>

...

</DATA>

Then in system A, we should receive( suppose no mapping):

<DATA>

<F1>V1</F1>

...

</DATA>

<DATA>

<F1>V1</F1>

...

</DATA>

While in system B, we should recieve:

<DATA>

<F1>V2</F1>

...

</DATA>

If we only use content based routing, both A and B will receive all 3 DATA.

Any ideas? Thanks in advance.