cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple records using switch in BPM

Former Member
0 Kudos

Hi,

Below is the input file i am having.

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

-<ns2:MT_Receiver xmlns:ns2="File2RFC">

<Details>

<Availability>5000.000</Availability>

<Message />

</Details>

<Details>

<Availability>1000.000</Availability>

<Message />

</Details>

<Details>

<Availability>0</Availability>

<Message>Material Test not maintained in plant 1100</Message>

</Details>

</ns2:MT_Receiver>

I want to divide this input file into two parts based on one condition. If the Availability!=0, then it should display the available quantity. or else, it should get suppliers from the webservice.

For this reqiurement, i have used the switch case. but it is not working. It is considering only the last record, For eg, in this input file the last record is having Availabilty=0. So it should go to webservice and display the suppliers. But all the 3 records are going to the else branch and giving the supplier details.

Could you please tell how to resolve the issue.the Availability which is present should go to one branch and the remaining records should go to the else branch. Please help me in this regard.

Thanks in Advance

M.Leela Ratnam.

Edited by: leelaratnam morampudi on Oct 6, 2008 5:22 AM

Edited by: leelaratnam morampudi on Oct 6, 2008 5:22 AM

Edited by: leelaratnam morampudi on Oct 6, 2008 5:40 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

If the Availability!=0, is your condition why do u need a switch case.Ignore it and use co-rellation using two send steps with condition over there.Please follow the below blog.

Former Member
0 Kudos

Hey,

I guess for your scenario the design should be something like this.

Receive step:- to receive the input file.

Now this file will have multiple records and based on each record you need to decide which branch of switch to choose.

Hence you need a transformation step that will consists of a mapping, which will be 1:N.

Mapping will split the input file into multiple records.

The next step should be a multiline container to accumalate each record.

Now based on this multiline container use a block step, whose mode is set to forEach.

this block will loop for the number of records in multiline container.

In this block provide a switch that will satify your condition.

In both the branches of switch give your distinct send steps- one for .net and the other one for java.

regards,

Milan

Former Member
0 Kudos

Hi Milan,

I have done the sceanrio like,

Receive step---Transformation step -


Block(Foreach)--Sync Send--ContainerEndblockTransforamtion--Send.

i got the output file as shown below.

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

-<ns2:MT_Receiver xmlns:ns2="File2RFC">

<Details>

<Availability>5000.000</Availability>

<Message />

</Details>

<Details>

<Availability>1000.000</Availability>

<Message />

</Details>

<Details>

<Availability>0</Availability>

<Message>Material Test not maintained in plant 1100</Message>

</Details>

</ns2:MT_Receiver>

from this output file, i want to use the condition which i have mentioned in the forum. Please help me out in this issue.

Former Member
0 Kudos

Hey,

you need to have a multiline container before the block step to collect all the messages.

And as you need the condition to be satisfied for each record, you need to provide the switch step inside your block.

regards,

Milan