BPM - ForEach Block

Hello experts,
I have developed an interface with the following BPM:
1. <Receive Step>
2. <Transformation Step: 1:N mapping>
3. <Block: ForEach>
4. <Send Step> inside the Block: ForEach
I have created 2 container objects that use the same abstract interface:
1. Object A which is a multiline of the abstract interface - used as
     a. the -Target Messages- in <Transformation Step: 1:N mapping>
     b. the -Multiline Element- of <Block: ForEach>
2. Object B which is not a multiline of the abstract interface - used as
     a. the -Current Line- of <Block: ForEach>
     b. the -Message- of <Send Step>
The problem I am facing:
The <Send Step> is not executed and the status of the PE in SXMB_MONI is success.
Any advice would be appreciated.
Regards,
Effi.
Edited by: Effi Olivkovitch on Dec 1, 2009 9:33 AM

>
S.R.Suraj wrote:
> Hi Effi,
>
> Have you tested your multimapping in Message Mapping?? Is it creating N outputs??
>
> Can you paste here the input file as given for your end to end testing... Make sure you dont have Messages and Message1 in the structure ie your input file should look something like
>
>
> <Message> 1
> <Row> 0..n
> <Field-1>
> <Field-2>
> </Row>
> </Message>
>
>
> Regards
> Suraj
Hi Suraj,
I tested the mapping in the test tab in ESR giving dummy values and the test was successful.
The test xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
   <ns0:Message1>
      <ns1:EDI_Extracts xmlns:ns1="urn:zim.com:tests">
         <Row>
            <EDI_EXTRACT_ID/>
         </Row>
      </ns1:EDI_Extracts>
   </ns0:Message1>
</ns0:Messages>
I also took the payload of the source message, put the Row elements inside the test xml and it was successful.
The payload I see in SXMB_MONI for the source message is as follows:
<?xml version="1.0" encoding="utf-8"?>
<ns:EDI_Extracts xmlns:ns="urn:zim.com:tests">
     <row>
          <EDI_EXTRACT_ID>3141618</EDI_EXTRACT_ID>
          <EDI_EXTRACT_TYPE>M</EDI_EXTRACT_TYPE>
     </row>
     <row>
          <EDI_EXTRACT_ID>5192509</EDI_EXTRACT_ID>
          <EDI_EXTRACT_TYPE>A</EDI_EXTRACT_TYPE>
     </row>
     <row>
          <EDI_EXTRACT_ID>656869</EDI_EXTRACT_ID>
          <EDI_EXTRACT_TYPE>M</EDI_EXTRACT_TYPE>
     </row>
     <row>
          <EDI_EXTRACT_ID>656867</EDI_EXTRACT_ID>
          <EDI_EXTRACT_TYPE>M</EDI_EXTRACT_TYPE>
     </row>
     <row>
          <EDI_EXTRACT_ID>9686612</EDI_EXTRACT_ID>
          <EDI_EXTRACT_TYPE>M</EDI_EXTRACT_TYPE>
     </row>
</ns:EDI_Extracts>
Kind regards,
Effi.

Similar Messages

  • Problem with ForEach block in BPM

    Hi,
    I have a scenario as follows:
    Collecting Idocs and send them separately via file channel (Does not make so much sense but I want to get used using the forEach Block)
    Loop (as long as "control" != false)
    Fork
    1. branch: Wait step 1 minute and container operation assign "control" = false (if no more idoc is received, loop stops after 1 minute)
    2. branch: receive step with correlation, container operation with append to multiline message, container operation assign "control" = true
    Mapping
    multiline message to single line message (same interface)
    ForEach Block
    Send Step with single line message
    My problem:
    x idocs get collected by the BPM and my file channel posts x idocs to the directory but it is always the same idoc and not x different ones.
    Any idea on that?
    Regards.
    Oliver.

    Yes, that's the blog I used.
    I have used the same interface for Send/Receive Steps, the Multi-Line Element and the Current Line Element. I restricted the Current Line Element to the block. Any other definition would not show up in the dropdown list, anyway.
    These are my settings for the Block:
    Step Name: Block1
    Description: [Blank]
    Mode: ForEach
    MultiLine Element: Idoc_Multi
    CurrentLine: Idoc_Local
    End Condition, Exceptions and Local Correlations: [Blank]
    Here are the settings for the Send Step:
    Step Name: Send1
    Description: [Blank]
    Mode: Asynchronous
    Create New transaction: [Not marked]
    Message: Idoc
    Ack: None
    Receiver from: Send Context
    All others: [Blank]
    I don't see any error?
    Regards.
    Oliver.

  • ForEach Block not working in BPM

    Hi all,
    I've developed a BP with a split mapping and ForEach block similar to the "MultipleFlightBookingCoordination" BP.
    But whatever I place inside the ForEach block is not executed. Not even a simple container operation is executed.
    I get no exceptions, no errors in process engine monitoring, everything looks fine.
    The ForEach block is listed in the work item selection and in the graphical view it looks like the steps inside the block have been executed but that's definitely not the case.
    Why is that??
    Thanks in advance
    Karsten

    Correlations shouldn't be mandatory but correct usage is imp.
    If forEach is used in multicast scenario, a proper correlation is required.
    The correct use of forEach is when u have multiple receivers and u r receiving data from multiple send step. Then a Receiver Determination step collects the list of receivers (in a multiline container). Now the forEach block gets executed for each receiver from the list.
    Regards,
    Prateek

  • Exception in ForEach block causes it to stop

    My scenario is a JDBC to JDBC to File scenario. The JDBC sender returns a resultset of a few transaction Ids. I then need to call a SP with each transaction id one by one to return more details. I am doing this by going to BPM, splitting the transaction ids and in a ForEach block using a synchronous send to call the SP and return the result set and then a recieve step to output to a file.
    This approach works fine until there is an exception in the SQL call. The response returns something similar to below and causes an exception.
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIAdapterFramework</SAP:Category>
      <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'SP.GetSAPInvoiceInfo' (structure 'STATEMENTQuery'): com.microsoft.sqlserver.jdbc.SQLServerException: Validation-SAP CostCenter not found for LONDON</SAP:AdditionalText>
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    This will happen every now and then so I want to keep the foreach block going but the process is stopped and no other records are processed. I have added an exception branch and everything but still no luck. Any ideas? Is this possible?

    ParforEach would work for this. It executes all messages in parallel. We are also using same.
    Regards
    Sushil

  • Issue in File to RFC to File Scenario with BPM using Block Step

    Hi Everybody,
                           I am doing File to RFC to File Scenario for multiple records using BPM using Block Step. The File Message is getting posted and after that, the message is getting stuck up in the qRFC Monitor (Inbound Queue).
                        After seeing the message in Inbound Queue, I am trying to execute and release the message. But when i execute the LUW, it says " Function module doesnt exist or EXCEPTION raised" in Inbound queue.
    Could somebody suggest me the outcome of this? What does this mean and how to
    release the stuck up message in Queue.
    Thanks and Regards,
    N.Jayanth Kumar

    Hi Rajesh,
                           After going through the blog, i saw the trace messages. It says      
    " The   exception occurred (program: CL_SWF_XI_INBOUND=============CP, include CL_SWF_XI_INBOUND=============CM00F, line: 19)"
    Regards,
    N.Jayanth Kumar

  • BPM. parForEach block. deadline. multiline element

    Hi all,
    I have BPM where block parForEach exist. In that block there is another block with send message step(application confirmation demand) and deadline with throw exception step. In parent block (parForEach) I catch this exception and add this element to multiline element.
    After parent block(parForEach) I check if multiline element is empty or not and if not I map this element in singleline element and try to send.
    The problem is that BPM crashes on transformation from multiline element to singleline element. Workflow log shows CX_SY_REF_IS_INITIAL error. I see this error when multiline element is empty but I especially insert switch step that check if multiline element is empty or not and it shows that element isn't empty.
    I already check mapping and also try change multiline element that doesn't helps.
    Please help.
    Maxim.

    Hi Mario,
    thanks for reply!
    When multi element(I specially drop down append step) is empty its go to the "otherwise" branch. So I think the branch is working.
    Maxim.

  • String[] in input , how to manage with foreach block?

    hi,
    my situation is this :
    i invoke a web service which has a array of string (String[]  ) in output , i was thinking to manage it with a foreach block, invoking a second web service able to read the single strings..
    the first block is the invoke to a web service 1 that returns me $InvokeWS1_uotputVariable/return, which  value is the array  String[]
    in the foreach block i have start value  1 and  finale value : count($InvokeWS1_outputVariable.parameters/return)
    than i'm trying to manage every string with the invocation to webservice 2 inside the foreach block , which will read it., i assign it a single string using an assign block with this assignement :
    $InvokeWS1outputVariable.parameters/return[$foreach1Counter] associated with $InvokeWS2inputVariable.parameters/arg0.
    the problem is that inside the foreach statement every invocation to the second web service gets only the first element in the array.
    Anyone knows if  i managed it correctly?

    This blog post of mine uses for each- http://blogs.sun.com/malkit/entry/dynamic_services_composition_in_bpel. Please take a look at the attached project.
    If you still have some questions, please let us know.
    - Malkit S. Bhasin

  • Collect container - Foreach block

    Hi Guys,
    I can't get my collect to work in my foreach block.
    I've assigned a multiline container to the block looping through a block line container. This line container is used to call a sync interface the the response from this interface must be collected in another multiline container. If I go from my interface response to my  transform outside my block it takes the last resp of the block but if I go from the multiline container (which is suppose to contain the collected messages) it gives me a blank message. It's not collecting at all.. Any Idea what could the problem be?
    [Screen Print|http://www.photostand.co.za/images/5yz97xspkm4aiyrfgl.jpg]
    Thanks,
    Jan

    Correlations shouldn't be mandatory but correct usage is imp.
    If forEach is used in multicast scenario, a proper correlation is required.
    The correct use of forEach is when u have multiple receivers and u r receiving data from multiple send step. Then a Receiver Determination step collects the list of receivers (in a multiline container). Now the forEach block gets executed for each receiver from the list.
    Regards,
    Prateek

  • Sending IDocs from ForEach Block from BPM disables my XI for 10 Minutes!

    Hi guys,
    I have a scenarion, where my SOAP adapter sends XML into XI, this passes it into BPM, which splits this XML in block to multiple IDoc and these are sent into R/3 system. This really works, but unfortunately, when I send the message into the SOAP adapter, my BOX is unavailable for cca 10 minutes and the documents contains only 2 IDocs!!  After these 10 minutes is everything ok and the  IDocs are in the R/3 system ...
    What could be wrong??
    Any idea is welcome, thanx in advance!
    Peter

    Michal,
    First I tried to do this with my BPM:
    before the change, I was mapping the message to IDoc directly in the BPM block part (I had abstract interfaces for message and for IDoc) and sending the Idoc away from the BPM
    after the change, I tried to send away from the BPM just the message and try to make mapping to IDoc on the way from the BPM to rhe R/3 system
    (it didn't help, my box was unavailable for 6minutes again)
    I checked the BPM - sending of the both massage was in the same second! So the problem could be only in
    a, MAPPING (not very possible - tests take few seconds)
    b, in sending IDoc
    But what could be wrong?? What could take so many resources??
    To the header mapping: I have deleted the Ad Spec Ids and added the header mapping (sender service, receiver service)...  But the ALE error was there again!
    Honestly, I have read the header mapping docu, but didn't unterstand it, how could it be useful in this case..
    P.

  • BPM Scenario Block Step

    Hi All,
    In my scenario iam getting a message through RFC.Now i have to split the messsage into multiple messages and then send each message individually to a webservice and get the response.
    I want to send them in Parallel mode by using Block step - Parforeach mode.
    Following are the steps in my BPM.
    1.Receive step - Open Syn/Async Bridge
    2. Transformation step to split the message into multiple messages.
    3.Opened a block in parforeach mode
    4.Send step in synchronous mode
    6.Collect the response in container.
    7.Ouside the block close the ync/Async bridge.
    When i exceute the scenario, i only see one message in SXMB_MONI which is from R3 system and even that message does not indicate what the problem is.The message recahed the BP engine.
    Unable to figure out what the problem is.
    Regards,
    Srinivas.

    But to use the response of all the sync messages, u must use the correlation
    See this
    http://help.sap.com/saphelp_nw04/helpdata/en/11/13283fd0ca8443e10000000a114084/content.htm
    Regards,
    Prateek

  • Current line option disabled in the ForEach block

    Hello
    I am having a scenario where i m using block step with Mode as "ForEach". I could select Multiline variable in "Multiline Element" but when I try to select "Current Line" it is not allowing to select the variable of type Abstract interface (in the pop-up the interface variable option is disabled).
    Has anybody faced this problem? Thanks in advance.
    Regards
    Rajeev

    This is an old thread, but I thought I'd post a response for anyone else encountering this.
    You will need to create a container element of the same type specified in the "Multiline" property of your block. The new element should not be multiline and should have the scope of your block.
    Kenn

  • ForEach block step

    Hi all,
    I have implemented a block step with inside a synchronous send step. It worked just fine, but the scenario has changed and I have to bundle the responses and send them back in one file.
    So I placed a transformation step and a container, inside the block. Another send step behind the block, that sends the message back to the sender.
    The problem is that this is not working. The transformation and container do not show up in the PE-monitor but the block gets executed succesfully. Different messages all get sent and give responses back. Also the send step after the block does not get executed.
    Sxmb_moni gives no errors what so ever. The workflow ends with status executed succesfully. I have no idea what is going wrong.
    Any ideas?
    Grtz,
    Philip

    hi ursi
    We faced a similar scenario where we did a complete rebuild of the IS with a different name as a cache refresh didnt help. Soon after check sxi_cache and see the IS carries a response code 0 (no errors) reimport the IS into ID and check the scenario.
    Also make sure if the pointer is placed on the block if nay contained variables needs to be defined inside a block.
    regds
    Prabhu

  • Mass interfaces: BPM or RFC wrapper

    Hello
    My scenario is HTTP->XI->RFC. Sender interface has collection of objects. SAP side has BAPI that works with one object. For example BAPI like CHANGE, CREATE doesn't take collection.
    What is the best design - to emulate mass interfaces in BPM(forEach block) or to create a RFC wrapper that takes collection and executes BAPI for each object?

    Hi,
    you can also try creating an IDOC
    (which will invoke your bapi inside)
    and post then all in a bundle
    (even from BPM)
    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
    it many not be very easy to design a BAPI
    for many messages and with IDOC approach
    you just need one - so more or less standard
    and you can post then as in my weblog
    BTW
    your scenario has to be async of course for this
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • BPM: skip a permanent error in a sequential ForEach ? Possible ?

    In a BPM, i split a message with 100 records in 100 individual records (1..n mapping).
    Then i use a ForEach Block (sequential) to send those 100 records using a synchronous Send step.
    The Send step is a call on a partner Web Service.
    Sometimes i receive a SOAP Fault.
    This SOAP fault can be:
    a) a temporary problem on the remote system... for example a database is down
    b) a permanent problem... for example something's wrong in a XML structure
    But i don't know in advance what kind of unexpected problem this is.
    So i have to stop the process and someone must determine if it's a case a) or b), using the BP Monitor.
    In case of a), i just have to wait the problem is solved and restart the BP exactly where it was stopped
    In case of b), there's no chance to solve the problem. The BP must skip this Send step N and continue with the Send step N+1 in the ForEach loop.
    I'm not allowed to resend the whole 100 records in case of a problem with the record 50 for example....
    If a set "Start new transaction" everywhere, the BP will be able to restart exactly where it was stopped.
    Now my questions:
    Is is possible to manually force the BP to:
    - restart exactly where it was stopped ?
    - skip the error and continue to the next step ?
    - restart from the beginning ?
    How ?
    Thank you
    Edited by: Thierry Genoud on Feb 5, 2009 2:14 PM

    Hi Indranil,
         You don't see you BPM....
    First go to SXI_CACHE and check that your BPM is listed there and that the compilation has been completed succesfully.
    Is this the first time the BPM is being used? If so check if has been configured. For example, go to RWB->Component Monitoring->BPE in <SYSID>
    and check if any error is listed there.
    In order to check what is going on in your BPM you can trace it:
                      SXMB_MONI_BPE->Diagnosis Processes with Errors
                      SXMB_MONI->Process, get your msg and click on 'PE'. You should see the workitems and see if there is any error.
             Hope this helps you....
             Regards,
                Encinas.

  • Question on BLOCK in BPM

    Hi, everybody.
    I have a question when develop a BPM.
    In my BPM scenario, I have a RECEIVE, a RECEIVER DETERMINATION, a BLOCK, and in the BLOCK I have a SEND.(all of these are configure as this sequence)
    I configurate it, and have test. The BPM log show that the process stop at BLOCK, no send action occur.
    The last log of BPM is 'Block item (local Workflow) created'.
    I use a 'ForEach' mode for BLOCK, multiline element is the Receivers container from the RECEIVER DETERMINATION.
    Can anyone help me to make clear where the problem probably in?
    And by the way, as using RECEIVER DETERMINATION in BPM, should I do some special setting in receiver determination of ID(integration directory) too?
    Any suggestion and reply is welcome,  thanks a lot

    Hi, Christophe DUMONT 
    As you say, the container of receiver determination is empty. 
    Now I think the problem is in RECEIVER DETERMINATION step, not the BLOCK.
    the online help say
    'In the receiver determination step, specify the send context and the multiline container element for the receiver list. The send context is an arbitrary string. You query this context in a condition in the receiver determination in the Integration Directory.'
    I don't set the SEND CONTEXT of it, and don't know how to set it. Does anyone know about it?
    I think the point of problem is clear now, we only need support from someone who is familiar with setting RECEIVER DETERMINATION step.
    thanks a lot

Maybe you are looking for