Par For each/ForEach

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

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

Similar Messages

  • BPM - Par for each

    I am having some issues with my Par for Each block in my BPM.
    My scenario is File(CSV format) --> BPM --> IDOC.
    The BPM will receive the file and it will convert the incoming message into IDOC and in the Parforeach Block I am sending the IDOC to R/3.
    Currently in my file I am having around 1300 Records.
    I am seeing the following error message in the Message Monitoring
    Work Item  000000015782 :Object Flowitem method cannot be executed
    Error When Processing Node 00000000023 (Parforeach index 00000000)
    Parforeach  table element contains  1268 entries
    Error when creating  a component  of type "dynamischer paraller  abschint"
    Error When Processing Node 00000000023 (Parforeach index 00000000)
    Error during result  processing of work  item  00000015784
    Question
    Whats the problem ? Previously when I ran for few records it ran fine? so the Parforeach is unable to handle the load? Where to increase the limit.
    thanks for your help.

    Hi Jenni,
    Check this...
    A ParForEach is recommended if:
    ·        The number of parallel processing branches is less than 999 (the multiline table element that is processed in the ParForEach contains less than 999 lines).
    http://help.sap.com/saphelp_nw04/helpdata/en/ce/bb2c421f3fda2ce10000000a1550b0/content.htm
    Regards
    Anand

  • BPM Message Split in Block par for Each: Just last message is sent n-times

    Hello everybody,
    we got BPM with a message split. In a par-for-each block the message is send.
    Asuming I have 3 lines in the multiline container element, I can see in SXMB_MONI that that message is send 3 times.
    The error is, that 3 times the last message is send.
    <u>Sample Error:</u>
    Message incoming in BPM:
    <root>
      <mymessage>M1</mymessage>
      <mymessage>M2</mymessage>
      <mymessage>M3</mymessage>
    </root>
    Messages outgoing:
    <root>
      <mymessage><b>M3</b></mymessage>
    </root>
    <root>
      <mymessage><b>M3</b></mymessage>
    </root>
    <root>
      <mymessage><b>M3</b></mymessage>
    </root>
    --> As you can see, just the last message M3 is send 3 times!
    What can I do?
    Regards Mario

    If I take the payload from SXMB_MONI an try to test, I get an syntax error when I copy&paste the data into the message mapping.
    This is very strange, because
    a) the message mapping is done on basis of imported IDOCs!
    b) the BPM works without throwing a mapping error
    So what should I do?

  • Difference in completion deadline for tasks which are parallel for each

    Hello Everybody,
    We have critical problem wherein we have set a completion deadline for a task against a human activity which is parallel for each but in the runtime, a difference of 1 second is appearing for the parallel tasks generated.
    We have raised a COMPLETIONDEADLINEISCRITICALEXCEPTION and if the deadline is met we are executing an ABAP RFC for auto approval.
    The automated step for executing the RFC is also parallel for each. When the tasks are created only one gets cancelled on completion of deadline while others get suspended. I am assuming this is happening because of the difference of 1 sec in the completion deadline for parallel tasks in the runtime.
    This is very critical and i request all you to please provide your inputs.
    Thanks & Regards
    Gaurang Dayal

    Hi Guarang,
    Do you expect that all the parallel tasks are instantiated at exactly the same point in time? That is an unrealistic expectation....
    First off, the Par Foreach doesn't spawn multiple threads, it executes each 'parallel' action in sequence in the same thread. Parallel in this context means all the actions (Task initiation) will occur and a process token will stay at each Task. For the token to pass the subsequent merge ALL the parallel tasks must be complete (all tokens must arrive at the merge). So you won't ever get all the tasks initiated at EXACTLY the same time.
    Further, even if the BPM kernel did spawn multiple threads (and there are very good reasons it won't!) it is rather unlikely that in these different threads you would for sure get all the initiations at EXACTLY the same time.
    If it's important that you get the task completion deadline the same in all tasks you should get a suitable timestamp in a mapping step which precedes the split and then set the deadline explicitly using that value when the task is initiated - i.e use a specific time value not an offset time value.
    An FWIW you should read and understand the documentation on Boundary Events so that you can know what to expect when one is fired and you know how to handle them.
    regards, Nick

  • How do I use an enhanced for loop / for each on my ViewObjectImpl ?

    Guys and Gals,
    With all of my newly acquired Java knowledge in tow, I spent this weekend cleaning up all of my code, dealing mainly with for loops. I converted them from a huge mess to a for each type loop using language such as ...
        RowSet priceUpdateRows = (RowSet)((PriceUpdatesViewRowImpl) priceUpdate).getPriceUpdateRowsView();
        for (Row priceUpdateRow: priceUpdateRows)
        { // do operations on row... which makes perfect sense to me. For each Row in the RowSet, do something. It doesn't, however, makes sense to the compiler. It pouts and gives me a "foreach not applicable to expression type" error. So I read up on iterators and such, messed with code examples, and still can't get the RowSet to iterate with the above code. Could I make RowSet implement Iterable? How would I do that? I tried to create a class called RowSetExt which extended RowSet and implemented Iterable, but then I got a class cast exception.
    I know I could implement something like the following or a while(hasNext()) but they're really not what I'm looking for.
    ViewObject vo = … < Get ViewObject > …
    RowSetIterator rsi = vo.createRowSetIterator("rowsRSI");
    while (rsi.hasNext())
         Row row = rsi.next();
         row.setAttribute("YourAttribute",your_value);
         rsi.closeRowSetIterator();How do I make the for(Row row : <RowSet>) example work? Or could someone point me in a direction?
    Will

    One thing I tried was to make a framework extension class for my ViewObjectImpls
    public class PcsViewObjectImpl
      extends ViewObjectImpl
      implements Iterable<Row>
      Set<Row> set = new HashSet<Row>();
      public Iterator<Row> getRows()
        return set.iterator();
      public Iterator<Row> iterator()
        return getRows();
    }AppModuleImpl
        PriceUpdateRowsViewRowImpl priceUpdateRows = (PriceUpdateRowsViewRowImpl)((PriceUpdatesViewRowImpl) priceUpdate).getPriceUpdateRowsView();
        for (Row priceUpdateRow: priceUpdateRows)
        {However, this gives me a class cast exception at runtime. But I would think some kind of extension class would be the way to go ... ?

  • I upgraded my iMac to OS 10.8.2 yesterday. Now iTunes will not sync with any of my devices - Apple TV (gen 1), iPhone 5 (with new iOS 6), or first gen iPad. I get an "unknown error 1140" for each device. Any ideas?

    Because the sync error is on every single device, and all 3 are running different versions of an OS, I assume this has to do with the new Mountain Lion upgrade. I probably should have waited for 10.8.3!  Any suggestions would be greatly appreciated!

    A bit more info for those of you reading this.... the problem seemed to be in iTunes. For each connected device , if I clicked on the Photo option I could no longer select the second radio button for limiting the photos by Events, Albums, etc.  It was an all or nothing deal. But selecting all would cause the error.
    So I had read the other forum posts about the "&" symbol being the cause of the problem.  I went through iPhoto and made all of the changes. It did not work. I then looked at iTunes, using the AlbumData2.xml file listed in the other forums as a reference.  I found one album with the "&". I edited that one.  Still would not work.  So then I spent 3 hours on the phone with AppleCare last week. I talked with 4 different advisors. None of them had heard about the "&" error from the forums. We tried everything in iPhoto including repair and rebuild.  Finally we created a whole new library and reimported my master photos from my original one.  Using this option would allow me to now check off that radio button in iTunes.  BUT... I now lost all of my albums and events and would need to rebuid them.  I was not happy. They agreed and we set up time to talk this week.
    So today I talked with AppleCare again. They now have more info and said the problem has to do with iTunes and the new iPhoto 9.4. It does not like the "&" symbol anywhere in either iPhoto or iTunes. So they now have me going through everything in my iTunes library. Genre is OK but any other item cannot have " & ". I have several dozen to edit and will do it over the weekend and then restore my original iPhoto Library and see if I can finally get it all to sync. I will let you know how I make out, but apparently you need to eliminate " & " from every entry in iTunes and iPhoto.
    Quality control is not up to par with Apple these days. 

  • Bursting Reports via email with seperate email address for each page

    I have been reading "Oracle® Application Server Reports Services Publishing Reports to the Web" (most specifically chapter 15 Creating Advanced Distributions) trying to figure this out but still having difficulty getting my head around it.
    I am trying to email invoices when applicable. Here is the "perfect world scenario".
    Report is scheduled to run once a day.
    Any qualifying invoices are picked up in the run.
    If there is an email address associated with the record the invoice is sent via email. (email address would be included on report and variable)
    If no email address is associated, the invoice is printed.
    There could/would be several different invoices on a single run.
    Does this mean I have to write dynamically write a distribution.xml file for each run or can I pass the email address as a variable to the distribution.xml?
    (builder version 10.1.2.0.2)
    bump
    Edited by: sdortch on May 21, 2009 9:09 AM

    Hi !
    You're able to use Report-Variables (e.g. from a Group in the Data Model) in the distribution.xml-File to send email to different adresses.
    Just bear in mind that you also need to set the "repeat-on" Property of the relevant layout section and use a "foreach"-Loop in the distribution.xml.
    So, no, no "dynamic" building of xml-Files necessary (though we do it at times...).
    See also "Publishing Reports to the web" for a complete reference on "burst distribution" and the components of the distribution.xml
    I would, however, run the report twice, once for "all email-invoices" with email-distribution file, once for "all invoices w/o email-adress" with (probably) printer-distribution file, as "exception" handling inside a distribution.xml could be a bit awkward...
    Cheers,
    Jens Rettig

  • How to use For-Each Structure with Multiple node XML structure

    Hi,
      How to use for-each (BPEL 2.0) construct for Multinode XML structure.
    Here is the easy case: I have list of suppliers specified by supplier
    <supplierList>
    <supplier>1</supplier>
    <supplier>2</supplier>
    <supplier>3</supplier>
    </supplierList>
    Now there is a web service http://hostname/getsupplierdetails/wsdl which accepts one supplier at a time.
    like
    <supplier>1</supplier>
    reponse object is
    <message> notfound/found </message>
    But how can I use for each of XML node to call this service and collect the result like
    <supplierList1>
         <Suppinfo>
            <supplier>1</supplier>
            <message> not found</message>
    </suppinfo>
        <suppinfo>
            <supplier>1</supplier>
            <message> not found</message>
    </suppinfo>
    </supplierlist1>
    Thanks

    For looping you use foreach loop and , loop for the number of occurences and when constructing response, adding a new element you have to use bpelx:append.  Good sample at Enterprise Integration: Oracle SOA Suite 11g: Populating a list or an array in BPEL without using XSLT.

  • Reg: Using a single masthead par for multiple users

    Hi All
    We need to implement different look and feel in the masthead for different users. For e.g. User A will see a different caption around the logo to that of User B. It could be different images for each user too. We have to achieve this with only one masthead par file as it is not tenable to have a par file for each user. What are the best ways to implement this?
    1. Store images/caption and other user specific data in the data base and based on the user login fetch the relevant info to build the masthead.
    2. An ugly yet effective way for images when the number of users are less --> keep images with same name in the par images folder and pick up the image based on the user logged in.
    Is there a way to solve it with only rule collection, framework pages & iview properties? A solution based on this could be highly extensible as and when new users are created. Please advise on the feasibility of this option.
    Also welcome are other suggestions which are better than the above ones.
    Regards
    Lakshminarayanan.V

    Hi Lakshminarayanan,
    Im wondering you do want to show different mastheads for different users. Please try to consolidate the users into minimum groups/departments and have different desktop rule for them to show different mastheads.
    If this can'tbe avoided, then we should with masthead custom option when users are large. In this case the first approach make sense to me but you have to take care of data base to update database and add images when there is a  new user created. Also, have a common folder in the server path and store the images over there. This is easy to maintain.
    Ram

  • Problem For/Each statement (or the problem is the MouseListener...)

    Hi guys,
    I'm making a program in java for school.
    Now I have this:
              for(Stap2TrampolineModel trampoline : lijstTrampolines)
                   trampoline = new Stap2TrampolineModel(0,215,100,"Poing",lijstKinderen); //model
                   trampolineView = new Stap2TrampolineView(trampoline); //view
                   trampolineController = new Stap2TrampolineController(trampoline, trampolineView); //controller
                   trampolineView.setBounds(trampoline.getXInvoer(),trampoline.getYInvoer(),trampoline.getFormaat()+1,20);
                   add(trampolineView);
                   repaint();
    and in the mouselistener this:
    public void mouseClicked( MouseEvent e )
              System.out.println(lijstTrampolines.size());
              // Onderzoek of met de rechterknop is geklikt
    if( e.isMetaDown() )
         // x = e.getX(); (for later needs)
    //y = e.getY(); (for later needs)
    lijstTrampolines.add(trampoline);
    repaint();
    The program should display a "trampoline" when I click...but it doesnt. It is added to the list, because I can see that in the console because of the System.out.println
    But it doesn't show the display I want. When I delete the for each statement, it does show the "trampoline". So the mouselistener works (it gets added when I click) and the arraylist works (it shows that in the console), but the for each statement doesnt work...
    Anyone knows how to solve this problem?

    Where is this foreach loop located? In inialisation presumably. But that's over and done with when your mouseListener is called. I'd guess your list is empty when the loop is called, and it does nothing.
    Your mouse listener, when it adds a trampoline must also add a trampoline view object. And the repaints don't do you any good, use revalidate() after adding a trampoline view to recalculate the layout.

  • ** Is it possible to create new BPM instance for each record (Multiline)

    Hi friends,
    In my scenario, JDBC adapter (sender) polls the open purchase order items from the table at the specified interval and send to BPM. In BPM, we used transformation step to split the messages to process each PO . The scenario is working fine. The problem is assume that if we process 10 PO, the error is in  4th PO while process, the BPM will be stopped in 4th PO. Once we correct the error, we are able to restart.
    In this case, we are not able to skip the 4th PO and process from 5th PO onwards. ie. the processing is sequential. Instead, we want to start new BPM instance for every PO. Advantage is that if 4th PO is error, only that BPM instance (work item) will be stopped. Remaining 9 POs will be completed.
    So, how do we start new BPM instance for every PO ?
    Kindly tell me, friends.
    Thank you.
    Kind Regards,
    Jeg P.

    Hi,
    There are two ways to achieve this.  In BPM and before BPM.
    Before BPM:
    Use 1 to unbounded mapping and 1 to unbounded interface mapping.
    In your mapping, make sure you create a seperate message for each PO.
    In BPM:
    Create a multiline container with you POs using a 1 to n mapping.
    Now add a ForEach block to loop through the multiline container and send each PO.
    Important:  Add an exception branch to catch any exception for each send so that the exception does not make the BPM fail.
    Regards,
    Yaghya

  • How to add a comment for each caption label present in a document?

    Hello everyone,
    I am trying to write a script to add comments for each caption label for figure and table.
    How can I select a caption and use Comments object for adding a comment?
    I tried using AutoCaptions list for going through all captions present in a document but Comments.Add function is not available with Caption object type.
    When I try adding a comment by selection manually I am able to add. Here is my piece of code.
    For Each objCaption In ActiveDocument.AutoCaptions
    objCaption.Comments.Add Range:=Para.Range, text:="[" & sIdLabel & sCurrentNumber & "]" & vbCrLf ' ID‘}
    ' increment number for next TAG
    sCurrentNumber = Format(Val(sCurrentNumber) + Val(sStepNumber), String(Len(sCurrentNumber), "0"))

    Hello Stefan,
    Thanks for your response.
    I'm trying to add comments for each table and figure present in my document.
    I have earlier tried a script to add comments for each outline level and it works.
    When I tried adding a feature to add comments for each caption in the document, it didn't work.
    Apparently when I try to go through the document by each para, captions are selected as para. So my current script is not able to parse though all the captions.
    Then I went with the other option where I'm trying to use AutoCaption object list to go through each caption. In this Caption object do not have Comment.Add function.

  • For each help in JSP ?

    Hi all
    Does JSP support for each statement ??
    Actually i need to cycle through each post variable like this in ASP
    for each tempvarname in request.form
    value1 = request.form(tempvarname)
    pass=pass&value1
    next
    I am unable to do this JSP...
    Can somebody help ?

    Use JSTL's c:forEach tag.
    <c:forEach items="${param}" var="item">
        ${item.key} = ${item.value}<br/>
    </c:forEach>That said, the need for this is a smell. Rethink your approach.

  • For Each Loop

    As we know that For Each loop is more easy to use and iterate. I want to ask, is it possible to run for each loop in reverse order?
    Please help.
    I will be very much thank ful to you.

    Sure. did you notice that it's you who defines the
    running condition, the initial value and the
    (positive or negative) increment?He's talking about the new for loop.
    The for-each loop can't do everything the old one can. Try reading this explanation.
    http://java.sun.com/j2se/1.5.0/docs/guide/language/foreach.html

  • For Each Loop Load Dynamic Excel Files

    Hi All,
    SSIS 2005
    I want to load excel file .xls one at a time files that have different names without having to select the file in the connection manager, every time. So a user can easily place the excel file in the folder and right the sql job and it loads the file data.
    The data flow tasks all work when I manually select the excel file, but I am unable to get this to work dynamically.
    I have setup a for each loop with multiples data flow tasks and sql tasks to load my data from file.
    Variables:
    @filename d:\new file\*.xls
    For Each Loop:
    ForEachFile Enumerator
    Folder: d:\new file\
    Files: *.xls
    Retrieve File Name: Fully Qualified
    Variable Mappings:
    User::filename (index 0)
    Connection Managers:
    Excel Connection Manager: Expressions, ConnectionString @[User::filename]
    Error Message: Error at new buyer(package name) the connection string format is not valid. it must consist of one or more components of the form X=Y, seperated by semicolons.
    Can anyone assist thanks.

    You still need the file name variable.
    ExcelFilePath is the fully qualified file name of your Excel file. ie. it contains both the path and file name.
    e.g. D:\inbox\myExcelFile.xls
    All the steps you mentioned are correct, except you need to set the property of ExcelFilePath of the Excel connection to the variable that you map to in the ForEach Loop:
    Connection Managers:
    Excel Connection Manager: Expressions, ExcelFilePath @[User::filename]
    Hope this helps.
    ~ J.

Maybe you are looking for