cancel
Showing results for 
Search instead for 
Did you mean: 

Par For each/ForEach

Former Member
0 Kudos

All,

Here s my situation:

I have performed a transformation step 1:N: where i split my messages N times.

After which i am sending my N messages one by one to the receiver.

Now should i use a Parfor each or a ForEach for this scenario???

In either way how should i define my parameters.My source is OrderRequest and my target is OrderResponse(N)

in my container step i defined these msg types

SingleOrderResponse TYPE: OrderResponse_ABS and MultiOrderResponse TYPE: OrderResponse_ABS and now i tried Parforeach in the trasformation step of my BPM:i specified my interface mapping gave source msg as OrderRequest

and target msg as MultiOrderResponse checked the multiline container element,and next is my send step which i included in ParForEachBlock, where i specified my multiline element as MultiOrderResponse and in the currentline i specified singleOrderResponse and in the stpe step i used the singleOrderResponse Msg type.

But in my tranformation step, i have this error msg saying cannot define multiline element....

Can anyone suggest me on what i should do?

Thanks in advance

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You need not put the transformation in the par for each block...Your transformation just returns a multiline element(Hope u have changed the occurence of Target Message to 0:unbounded in Interface Mapping..I am assuming that u are sending same message N Times).So the transformation itself will put the messages in to ur multiline which u can then send using for each or par for each block..

So steps would be

1.Receive.

2.Transformation(In the output message have the multiline element).

3.Foreach/parforeach block

and inside that block send step.

Hope it works.

Note:If u r on SP14 u can do splitting without BPM.

Regards,

Sudharshan

Former Member
0 Kudos

Hello all,

1) I have done the 1:N mapping successfuly

2)I have not included my transformation step inside the ParForEach,i have included only my SEND step, and in the transformation step i have specified the container elemnt for the response as a multiline

in the ParForEach step:

for multiline element: i defined the response with multiline container elemnt

Currently , for this current line i did the following:

i created this container

Name

SingleOrderResponse

Category

orderResponse_ABS

type

Abstract

container

theStepName

is this right?

or

what should i be specifying for current line???

i tried activating my BPM and it shows error in the transformation step:

Expression must not return a multiline value

Thanks

bhavesh_kantilal
Active Contributor
0 Kudos

Hi Aarthi,

//i tried activating my BPM and it shows error in the transformation step:

Expression must not return a multiline value

Can you check your Message mapping and your Interface mapping. Just check if the occurecne of your destination Mesage Type and Message Interface has been made to be unbounded.

Regards,

Bhavesh

Message was edited by: Bhavesh Kantilal

former_member187339
Active Contributor
0 Kudos

Hi,

Your Transformation's Target_Message field should have the name of the multiline container element (say A) and the send (inside block) should have simple container element's name (say B). PARFOREACH block should have multiline as A and Current line as B.

When you create A as container element check the multiline box and before activating press F7 (for checking errors).

Regards

Suraj

Former Member
0 Kudos

Hi Aarthi -

Just to confirm, please double check your interface mapping cardinality(occurence). Everything else seems to look ok.

Best regards,

Jin

Former Member
0 Kudos

Hi,

check the interface mapping in the tranformation.

May be select the interface mapping again and choose the source and target messages.Also check the occurrence of the Target Interface in Interface Mapping.Only when it is unbounded BPM will allow u to assign a multiline element to the output of transformation.

Regards,

Sudharshan

Former Member
0 Kudos

Hi all,

In my interface mapping, for my target msg i had not made the occcurence as 0..unbounded, but then i changed and i activated and when i tested my sending a test msg, my BPM has a error in the transformation step mapping....

Before i made this change and and tested with my test msg, the BPM was working fine and had no problem, after i changed this it shows error.

I has individually gone to test tab and checked for my messagemapping/interface mapping...the splitting of msgs works fine...

!

bhavesh_kantilal
Active Contributor
0 Kudos

Hi Aarthi,

Now that you have made sure taht the Message Mapping and Interface Mapping has been made unbounded, the error can be traced to the TRANSFORMATION step of your BPM.

Just check that the source message and destination message of your BPM are correct.

Regards,

Bhavesh

Former Member
0 Kudos

Hi -

To see what the source and resulting message of your transformation is in your BPM process, look at step 3.3 of the following guide:

http://service.sap.com/~sapidb/011000358700003141152005E/HowTo_Monitor_ccBPM.pdf

You can troubleshoot from there...

Best regards,

Jin

Former Member
0 Kudos

Hello all,

i have these steps in my BPM:

receive,transformation1,transformation2,send.

the error is in the trasformation2 where i am doing a 1:N mapping.

I checked my msg mapping, interface mapping and i changed the target msg occurence to unbounded,i tested in the msg tab, both works fine...but still PE monitoring shows error in this transformation step...

in PE i checked the MESSAGESIN and MESSAGESOUT for my transformation2, the message enteringIN is diaplaying the correct message entering IN but in MESSAGESOUT,it says <NOT SET>...

one more thing i noticed while checking the interface mapping is when i have a header and duplicatesubtree my lineitems, the executing is completes succesfuly replicating the messages in the target, but as soon as the pop up says test executed succesfully, the line items i duplcated in my source vanishes...could this be a problem???

and Jin thanks for the pdf,it was very usefull.

bhavesh_kantilal
Active Contributor
0 Kudos

Hi Aarthi,

Let me first make sure that I have your requirements right.

What you want to do is perfrom a 1:N transformation and then send each of your response to the receiver.

For this , in your BPM,

1. the first step will be receive step where you receive your request message.

2. the next step will be your Transformation step, where you perfrom 1:N mapping.

3. Finally, you will have to define a block with a send step. the bloack can be par for each or for each.

From what I understood of your definition of the problem, i think you have put your transformation step within the block and that should not be done.

Also, with the transformation step, the containder element for the reponse should be a MULTILINE element as the mapping will produces N messages.

DO let me know if i have understood your requirements well and if this solution does help you.

Regards,

Bhavesh