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

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

  • How to check collection.contains(..) inside a tag ?

    Hi,
    I'm using both struts and jtsl tags in my jsp. JSP session has a Collection named "responses" that contains string objects.
        <c:forEach items="${page.questions}" var="question" varStatus="i">
              <tr>
                   <th align="left"><c:out value="${question.questionId}. ${question.text}"></c:out></th>
              </tr>
            <c:forEach items="${question.answers}" var="answer" varStatus="j">
              <tr>
               <td>     
                         <c:set var="aKey" value="${question.OID}_${answer.OID}"></c:set>
                      <c:if test="${question.type == 1}">
                         <c:out value="${answer.answerId}"/>
                         <input id="<c:out value="KEY_${question.OID}"/>" name="<c:out value="KEY_${question.OID}"/>" type="radio" <c:if test="??? session.getAttribute("responses").contains(${question.OID}_${answer.OID}) ???" ><c:out value="selected=true"/></c:if> value="<c:out value="${question.OID}_${answer.OID}"/>"><c:out value="${answer.text}"/>                 
                      </c:if>
                      <c:if test="${question.type == 2}">
                         <c:out value="${answer.answerId}"/>
                         <input id="<c:out value="KEY_${answer.OID}"/>" name="<c:out value="KEY_${answer.OID}"/>" type="checkbox"  value="<c:out value="${question.OID}_${answer.OID}"/>"><c:out value="${answer.text}"/>                 
                      </c:if>                  
                 </td>
            </tr>                  
            </c:forEach>
         </c:forEach>Please see the following line in the code
    <c:if test="??? session.getAttribute("responses").contains(${question.OID}_${answer.OID}) ???" ><c:out value="selected=true"/></c:if>I need to check if a collection contains a string value or not. If contains I'm selecting the radio button otherwise not.
    Any help will be appreciated!
    Thanks

    There is no way to tell if a collection contains a value.
    If you changed your datastructure to a Map, you can check for the existence of a key in a map, but thats about it.
    Alternatively write a static function for this operation, and import it into the jsp as an EL function.
    Cheers,
    evnafets

  • 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

  • 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

  • Class that contains finally block with out try block

    How can we make a class that will contain finally block with out try block.

    dkpadhy wrote:
    How can we make a class that will contain finally block with out try block.You can�t.
    And frankly it seems to me that you don�t understand what you�re doing.
    Care to explain further?

  • 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.

  • 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

  • How does Smart Collection "contains words" work

    I have some pictures of ear rings which I have tagged with the keywords:
    ear rings, jewelry
    Note "ear rings" is 1 tag, it does not have a comma between them.
    I set up a smart collection with  "contains words" and typed "ear rings" (excluding quotes) in as the search criteria.  To my surprise LR3 found 0 matches!  I changed to "contains all" and then LR3 found the images.
    My question is why doesn't the "contains words" work?  It would seem that is the one I want to use over "contains all".

    What would happen if the keyword were instead ear-rings (or earings)?

  • How can I add a 200 gig collection containing 1 corrupt song to iTunes...

    ...given that the program crashes if it encounters a corrupt file during the import process, and fails to save any of the songs it has imported so far?
    I seriously hope the answer is not "hold the software's hand as you import the albums one at a time, close the program, and reopen it to save your progress"

    I'm not sure if I clarified the situation enough.  The collection of music is already in the iTunes folder.  But iTunes itself only recognizes music once it's built a little database of what is in the iTunes folder. Normally you can do this by Add Folder To Library and selecting multiple folders, or even a folder containing all the music you want to add... and it would all go swimmingly except if it encounters a bad file at any point, it just chokes.  This itself could be worked around, but it'd be a rather tedious process, especially if it turns out there are multiple bad files.

  • 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.

  • 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

  • Smart collection containing matches with only two keywords

    I have added keyword tags to all my photos with the names of the people in the picture.  I then created a smart collection with two names in it.  For example Jessica and Ryan.  That collection then returns all pictures that have Jessica or Ryan in them. I am trying to get pictures than contain both Jessica and Ryan, but not other names.  The only way I have figured out how to do this is by entering in the other names in the doesn't contain field.  That seems like a lot of work when I have many other names, and it must be updated each time I add new keywords.  Is there an easier way?

    There's no way built-in to LR to do what you want without listing every keyword you want to exclude.  The Any Filter plugin lets you do it, though you need to understand boolean expressions.  See the "Exactly one person in the keywords" example for how to match exactly one person. To get exactly two people, you'd define the filter:
    All of
    Explicit Keywords = Ryan
    Explicit Keywords = Jessica
    Explicit Keywords all items
    Some of
    Keyword = Ryan
    Keyword = Jessica
    None of
    Keyword subkeyword of People

  • ClassCastException with Collection.contains query?

    Did I do something wrong? I am getting this ClassCastException but no
    indication of which class it is
    Member has collection of Position - positions
    Position has a not null OrgUnit - orgUnit, which has string property
    compositeKey
    Extent ext = pm.getExtent(Member.class, true);
    Query q = pm.newQuery(ext, "positions.contains(pPos) and
    (pPos.orgUnit.compositeKey >= \"1.2\" && pPos.orgUnit.compositeKey <
    \"1.2A\")"
    q.declareVariables(Position.class.getName() + " pPos");
    return new ArrayList((Collection)q.execute());
    com.solarmetric.kodo.runtime.UserException: The given filter string
    "positions.contains(pPos) and (pPos.orgUnit.compositeKey >= "1.2" &&
    pPos.orgUnit.compositeKey < "1.2A")" is not valid. Make sure all
    parentheses are properly matched and that the filter uses proper Java
    syntax.
    NestedThrowables:
    java.lang.ClassCastException
         at com.solarmetric.kodo.query.FilterParser.parse(FilterParser.java:206)
         at
    com.solarmetric.kodo.query.QueryImpl$DatastoreQueryExecutor.(QueryImpl.java:
    1527)
         at
    com.solarmetric.kodo.query.QueryImpl$QueryExecutionManager.getQueryExecutor(
    QueryImpl.java:1358)
         at com.solarmetric.kodo.query.QueryImpl.internalCompile(QueryImpl.java:469)
         at
    com.solarmetric.kodo.query.QueryImpl.executeQueryWithMap(QueryImpl.java:672)
         at com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:540)
         at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:490)

    nested exception is
    NestedThrowablesStackTrace:
    java.lang.ClassCastException
         at com.solarmetric.kodo.query.FilterParser.getValue(FilterParser.java:829)
         at com.solarmetric.kodo.query.FilterParser.eval(FilterParser.java:721)
         at
    com.solarmetric.kodo.query.FilterParser.getExpression(FilterParser.java:841)
         at com.solarmetric.kodo.query.FilterParser.parse(FilterParser.java:198)
         at
    com.solarmetric.kodo.query.QueryImpl$DatastoreQueryExecutor.(QueryImpl.java:
    1527)
         at
    com.solarmetric.kodo.query.QueryImpl$QueryExecutionManager.getQueryExecutor(
    QueryImpl.java:1358)
         at com.solarmetric.kodo.query.QueryImpl.internalCompile(QueryImpl.java:469)
         at
    com.solarmetric.kodo.query.QueryImpl.executeQueryWithMap(QueryImpl.java:672)
         at com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:540)
         at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:490)
         at
    peacetech.gao.usorg.web.USOrgController.searchMembers(USOrgController.java:2
    71)
         at
    "Alex Roytman" <[email protected]> wrote in message
    news:[email protected]...
    Did I do something wrong? I am getting this ClassCastException but no
    indication of which class it is
    Member has collection of Position - positions
    Position has a not null OrgUnit - orgUnit, which has string property
    compositeKey
    Extent ext = pm.getExtent(Member.class, true);
    Query q = pm.newQuery(ext, "positions.contains(pPos) and
    (pPos.orgUnit.compositeKey >= \"1.2\" && pPos.orgUnit.compositeKey <
    \"1.2A\")"
    q.declareVariables(Position.class.getName() + " pPos");
    return new ArrayList((Collection)q.execute());
    com.solarmetric.kodo.runtime.UserException: The given filter string
    "positions.contains(pPos) and (pPos.orgUnit.compositeKey >= "1.2" &&
    pPos.orgUnit.compositeKey < "1.2A")" is not valid. Make sure all
    parentheses are properly matched and that the filter uses proper Java
    syntax.
    NestedThrowables:
    java.lang.ClassCastException
    at com.solarmetric.kodo.query.FilterParser.parse(FilterParser.java:206)
    at
    com.solarmetric.kodo.query.QueryImpl$DatastoreQueryExecutor.(QueryImpl.java:
    1527)
    at
    com.solarmetric.kodo.query.QueryImpl$QueryExecutionManager.getQueryExecutor(
    QueryImpl.java:1358)
    atcom.solarmetric.kodo.query.QueryImpl.internalCompile(QueryImpl.java:469)
    at
    com.solarmetric.kodo.query.QueryImpl.executeQueryWithMap(QueryImpl.java:672)
    at com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:540)
    at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:490)

Maybe you are looking for