cancel
Showing results for 
Search instead for 
Did you mean: 

switch step

Former Member
0 Kudos

i have a scenario in which there is a BPM....in the BPM there is a switch state, which does a tranformation and a otherwise branch.

the message is:

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

<ns0:MT_sdptestFile xmlns:ns0="http://zpoc.com.test/sdptest"> (occurrence 1)

<record> (occurrence n)

<salary/>

<name/>

<id/>

</record>

</ns0:MT_sdptestFile>

the condition for the switch is:

/p1:MT_sdptestFile/record/id = 1

but i observe that the message is branched to the correct banch only when the last record satisfies this condition.....irrespective of whether other record's <id> field satisfies the condition or not....

Is this the normal behaviour of the switch statement??????

Message was edited by:

sudeep dhar

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>irrespective of whether other record's <id> field satisfies the condition or not....

AFAIK if only one ID is ok the condition should be ok - check it once more

Regards,

michal

Former Member
0 Kudos

but i have tested ...irrespective of the value of <id> field in other records...... the switch statement is checking only the last row's <id> field

Former Member
0 Kudos

hi michal...u mean to say if any of the record's <id> field is matching the condition...message goes through the correct branch

Former Member
0 Kudos

Sudeep,

Am not sure, if the condition is evaluated for the last node or checked for any correct occurance but if you want the condition evaluated for each and every <record> then, you have to go for multi mapping where you need to create as many messages as <record> node. Or handle this in 2 different mapping.

Regards,

Jai Shankar

Former Member
0 Kudos

jai shankar...

i have given u the message structure and the conditinon.....

pls see it......

Former Member
0 Kudos

Hi,

did you check the multi line condition check box in condtion editor.??

also see the below link, to see how to monitor BPM.

monitoring BPm https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e7bc3a5a-0501-0010-1095-eb4...

see with step by step , the exact reason for switch will be observed in sxmb_moni_bpe.

Regards

Chilla

Former Member
0 Kudos

Deleted content

Former Member
0 Kudos

see chandra...let me explain the situation once more...

the BPM has a receive step.....receiving messages of structure:

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

<ns0:MT_sdptestFile xmlns:ns0="http://zpoc.com.test/sdptest">...1..1

<record>.........................0...n

<salary/>.....................1..1

<name/>........................1..1

<id/>..........................1..1

</record>

</ns0:MT_sdptestFile>

now, this message is passed through a switch...which has a condition:

/p1:MT_sdptestFile/record/id = 1

so the observation is : the message passes through correct branch...when the last record has <id> = 1..............irrespective of other records..

is it the normal behaviour????????????????????????????????

prabhu_s2
Active Contributor
0 Kudos

sudeep

when u have <b><record>.........................0...n</b> it will show u thios behaviour. becoz only the last record will be read by the switch. if u want the entire data to be parsed then u have it looped ....but for this u need to have split mapping as i told u earlier.

Former Member
0 Kudos

Hi,

Yes, what is the problem,

Regards

Chilla

Former Member
0 Kudos

hi prabhu thanksssssssssssssssssssssssssssssssssssss

can u elaborate split mapping.....

pls pls

prabhu_s2
Active Contributor
0 Kudos

i meant split mapping as mutli mapping....sorry for the confusion

Former Member
0 Kudos

hi shekhar...

actually i may have not explained the problem properly....

pls see prabhus solution......

i just want to know...if its the normal behaviour

Former Member
0 Kudos

Hi,

See , can please tell your actual problem properly, so that you will have actual solution.

If you are receiving the multi line messages into one container variable , that is to be split into each one msg and based on each msg data you can have the condition. this is already explained above , due to that reason i said multi line check box in condition editor, in Ip , you would have touse the transformation step to split the multiline/multirecord to single msg each , in transformation step , we should use the interface mapping .. so there should be corresponding message mapping stating that multiline message into each msg with single record.

to solve this so many ways are existed .. this is purely depending upon the your business requriement.

i hope it is clear.

see the below links

multi mapping - /people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure

Multiple mappings into one Im -

Splitting of message is possible without BPM also.

Regards

Chilla

Former Member
0 Kudos

Sudeep,

Still you have not mentioned what your requirement is.

If your requirement is if Id value is 1 then route it to target1 and if id value is 2 then route it to target 2. The you have 2 options as I explained above.

Option 1.

Multi mapping : Create as many messages as <record> tag in the target and put the same condition. Now there will be a single record in a msg and hence a single Id, so no problem.

Option 2.

Use 2 separate message mappings for each target. Handle the validation at <record> tag level. Here you will have 2 receiver determinations both having no conditions.

Regards,

Jai Shankar

Answers (1)

Answers (1)

prabhu_s2
Active Contributor
0 Kudos

the reason is becoz of the <b>occurrence n</b>. when u want every message to be parrsed correctly then u need to have split mapping. else only the last one will go