How to pass a single element in an array to XSL from BPEL

In a bpel (2.0) process I have a for-each loop iterating through a list in the original input document.  Within that loop I need to construct an  input document  for a call to a web service based on data in the current node of the list objects I am looping through.
Constructing the input document via BPEL assign activity copies within the for-each loop is an option but due to the complexity of that document I would prefer to use XSL.  But I don't know how to pass the index information (ie. the for-each counter) into XSL and use it there (and I would prefer not to have to do so, since that will prevent use of the XSL GUI in jdev), so I would prefer to send  the current node of the list as input to XSL instead.
Is it possible to pass a sub-section of an XML document (e.g. one node in the array) as input into XSL rather than the whole document?  In other words, I would like to send the current array element from the original input document rather than the entire original input document because I will be using the data within that array element to create the web service input document.
Example:
<forEach parallel="no" counterName="i"
                     name="ForEachEntry">
              <startCounterValue>1</startCounterValue>
              <finalCounterValue>$numTimeEntries</finalCounterValue>
If I used the BPEL assign activity to populate the input document I would need lots of copies similar to this:
              <copy>
                  <from>$inputVariable.OteStgTimecardCollection/ns3:OteStgTimecard[1]/ns3:oteStgTimecardDetailCollection/ns3:OteStgTimecardDetail[$i]/ns3:origtransactionreference</from>
                  <to>$InvokeOteDetailAbsenceErrorStatusService_OteAbsenceDetailFailureService_InputVariable.OteAbsenceDetailFailureServiceInput_msg/ns19:OrigTransactionReference</to>
              </copy>
I would prefer to send the current list object as an input variable into an XSL transform: 
     $inputVariable.OteStgTimecardCollection/ns3:OteStgTimecard[1]/ns3:oteStgTimecardDetailCollection/ns3:OteStgTimecardDetail[$i]
Is there syntax in bpel that would do that?
Thanks

You need use While Element and use Array like Element[number]
With While element you iterate <employee> node
and with Element[number] you can extract information from that node.
I wrote a BPEL that scan a XML file, the input is:
<cliente>
        <codigo>01</codigo>
        <nombre>Deiby Mauricio Gomez</nombre>
                <productos>
                        <producto>
                                <nombre>Camisa Polo</nombre>
                                <precio>50</precio>
                        </producto>
                        <producto>
                                <nombre>Pantalon Lona</nombre>
                                <precio>100</precio>
                        </producto>
                </productos>
        </cliente>
        <cliente>
        <codigo>02</codigo>
        <nombre>Julio Cesar Ayapan</nombre>
                <productos>
                        <producto>
                                <nombre>Camisa Polo</nombre>
                                <precio>50</precio>
                        </producto>
                </productos>
        </cliente>
In my BPEL I added up all article prices and after that I write to txt file the client and the Total.
Example:
Deiby Gomez, 150
Cesar Ayapan, 50
My while element is this (Please pay attention in bold words):
  <while name="While1"
           condition="bpws:getVariableData('variable1')&lt;=count(bpws:getVariableData('Receive1_input_files','body','/ns4:clientes/ns4:cliente'))">
      <sequence>
        <assign name="Assign1">
          <copy>
            <from expression="sum(bpws:getVariableData('Receive1_input_files','body','/ns4:clientes/ns4:cliente[number(bpws:getVariableData(&quot;variable1&quot;))]/ns4:productos/ns4:producto/ns4:precio'))"/>
            <to variable="Invoke1_process_InputVariable" part="payload"
                query="/ns5:process/ns5:cantidad"/>
          </copy>
          <copy>
            <from variable="Receive1_input_files" part="body"
                  query='/ns4:clientes/ns4:cliente[number(bpws:getVariableData("variable1"))]/ns4:codigo'/>
            <to variable="Invoke1_process_InputVariable" part="payload"
                query="/ns5:process/ns5:id"/>
          </copy>
        </assign>
        <invoke name="Invoke1" inputVariable="Invoke1_process_InputVariable"
                outputVariable="Invoke1_process_OutputVariable"
                partnerLink="ValidacionBancos2WS" portType="ns5:BPELProcess1"
                operation="process" bpelx:invokeAsDetail="no"/>
        <switch name="Switch1">
          <case condition="bpws:getVariableData('Invoke1_process_OutputVariable','payload','/ns5:processResponse/ns5:resultado')='true'">
            <bpelx:annotation>
              <bpelx:pattern>Si el cliente es aprobado</bpelx:pattern>
              <bpelx:general>
                <bpelx:property name="userLabel">Si Aprobado</bpelx:property>
              </bpelx:general>
            </bpelx:annotation>
            <sequence>
              <assign name="Assign4">
                <copy>
                  <from variable="Receive1_input_files" part="body"
                        query='/ns4:clientes/ns4:cliente[number(bpws:getVariableData("variable1"))]/ns4:codigo'/>
                  <to variable="Approved_Write_input" part="body"
                      query="/ns7:clientes/ns7:cliente/ns7:id"/>
                </copy>
                <copy>
                  <from variable="Receive1_input_files" part="body"
                        query="/ns4:clientes/ns4:cliente[number(bpws:getVariableData(&quot;variable1&quot;))]/ns4:nombre"/>
                  <to variable="Approved_Write_input" part="body"
                      query="/ns7:clientes/ns7:cliente/ns7:nombre"/>
                </copy>
                <copy>
                  <from expression="sum(bpws:getVariableData('Receive1_input_files','body','/ns4:clientes/ns4:cliente[number(bpws:getVariableData(&quot;variable1&quot;))]/ns4:productos/ns4:producto/ns4:precio'))"/>
                  <to variable="Approved_Write_input" part="body"
                      query="/ns7:clientes/ns7:cliente/ns7:total"/>
                </copy>
              </assign>
              <invoke name="Invoke2" inputVariable="Approved_Write_input"
                      partnerLink="fileAdapterWriteApproved"
                      portType="ns6:Write_ptt" operation="Write"
                      bpelx:invokeAsDetail="no"/>
            </sequence>
          </case>
          <otherwise>
            <sequence name="Sequence1">
              <assign name="Assign5">
                <copy>
                  <from variable="Receive1_input_files" part="body"
                        query='/ns4:clientes/ns4:cliente[number(bpws:getVariableData("variable1"))]/ns4:codigo'/>
                  <to variable="Rechazados_Write_input" part="body"
                      query="/ns9:clientes/ns9:cliente/ns9:id"/>
                </copy>
                <copy>
                  <from variable="Receive1_input_files" part="body"
                        query="/ns4:clientes/ns4:cliente[number(bpws:getVariableData(&quot;variable1&quot;))]/ns4:nombre"/>
                  <to variable="Rechazados_Write_input" part="body"
                      query="/ns9:clientes/ns9:cliente/ns9:nombre"/>
                </copy>
                <copy>
                  <from expression="sum(bpws:getVariableData('Receive1_input_files','body','/ns4:clientes/ns4:cliente[number(bpws:getVariableData(&quot;variable1&quot;))]/ns4:productos/ns4:producto/ns4:precio'))"/>
                  <to variable="Rechazados_Write_input" part="body"
                      query="/ns9:clientes/ns9:cliente/ns9:total"/>
                </copy>
              </assign>
              <invoke name="Invoke3"
                      inputVariable="Rechazados_Write_input"
                      partnerLink="fileAdapterWriteRechazados"
                      portType="ns8:Write_ptt" operation="Write"
                      bpelx:invokeAsDetail="no"/>
            </sequence>
          </otherwise>
        </switch>
        <assign name="Assign2">
          <copy>
            <from expression="''"/>
            <to variable="Invoke1_process_InputVariable" part="payload"
                query="/ns5:process/ns5:id"/>
          </copy>
          <copy>
            <from expression="bpws:getVariableData('variable1')+1"/>
            <to variable="variable1"/>
          </copy>
          <copy>
            <from expression="''"/>
            <to variable="Invoke1_process_InputVariable" part="payload"
                query="/ns5:process/ns5:cantidad"/>
          </copy>
        </assign>
      </sequence>
    </while>

Similar Messages

  • How to blink a single element in an array of string

    Hi,
    I am working on array blinking option in an array of string. I wanted to blink each element of array in different instances.
    Ex: I have array as MyArray [5] = { "aaaa", "bbbb", "cccc", "dddd", "eeee"}. Question is i want to blink one by one, first 0th row, next 1st row and so on.
    Could any one please help on this.
    Many Thanks
    Hanee..

    Ian,
    i cannot tell you what's happening here. Fact is, that this is not the way to go. See attached example.
    If you run it and click into one of the string fields (mouse up event!) you will see, that "Cell" Value changes. If you look into the code, you see that i read the string form the String refnum, so it seems to handle the "Active Cell". But writing to it (Set Color) will reveal, that the whole array will change its background color. This matches my statement.
    I really fo not understand, why reading from the same string refnum yields different results ("Active Cell"???!), but regarding blinking: setting this for a single "Cell" will set it for all "Cells", but due to graphical updates (same as buttons&event structures), it is only visible in the "Active Cell". Rest asured, that the property value "blinking" is true for all "Cells" then (even thought not graphically visible).
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.
    Attachments:
    ArrayReference.vi ‏14 KB

  • How to pass a single quote in a URL using Javascript

    Can someone tell me how to pass a single quote in a URL using Javascript. I have created a Javascript funciton in which I pass several column values from an APEX report.
    The URL for the report link I am using is "JAVASCRIPT:passBack('#EMP_ID#','#Name#','#e-mail#')"
    The problem occurs with the Name and e-mail columns contain a single quote (i.e. James O'Brien)

    Thank you Saad, that worked.
    Since I built the report using type 'SQL Query (PL/SQL function fody returning SQL query)' I had to add some additional quotes to get it to work.
    i.e.
    replace(EMP_EMAIL_NAME,'''''''',''\'''''')
    or
    replace(EMP_EMAIL_NAME,chr(39),''\'''''')
    Thanks for the help,
    Jason

  • How do you assign multiple values to a single element in an array?

    I'm probably not wording the question right.
    I have an array, let's call it M[], and for each element in the array (we'll say M[1]), I need assign three integers: row, col and value.
    I need to set it up so I can do something like this:
    A.row = M[i].col;
    A[i].col = M[i].row;
    A[i].value = M[i].value;
    The algorithm isn't what I need help with, it's assigning .col, .row and .value to an index of an array.
    Please help if you can.

    You are right. You did not word your question perfectly, but I still think I get what you want.
    First of all: A single element in an array always has exactly one value. No more, no less.
    But that's not a problem. The element in an array is either of a primitive type (boolean, byte, char, short, int, long, float, double) or it's a reference (to a Object, String, MyClass, ...).
    You can simply write a class that holds your three values and create an array of that type:
    public class SomeData {
      public int row;
      public int col;
      public int value;
    // somewhere else:
    SomeData[] a = new SomeData[10];
    a[0] = new SomeData();
    a[0].row = 10;
    a[0].col = 5;
    a[0].value = 42;Note how you only assign a single value to the element (a[0]) itself. All other assignment actually go to fields of the object refered to by that element in the array.
    Also note that in Java types (such as classes, interfaces, ...) should start with a upper-case letter, while variables (local variables, members, parameters) and method names should start with a lower-case letter.
    Edit: I'm getting old ...

  • How to pass a single character to dll (as a parameter)

    How do pass a single character to dll (as a parameter). This is a third party dll that i am unable to change.
    e.g.: int functionName(char* process, char myChar);

    My apoligies, I am trying to pass a char from Teststand. Passing as a char is not one of the Category
     I tried sending (for example) : Locals.myChar[0].  Which is acceptable in C++, but gives me an error via Teststand.

  • How do I determine what element in an array was right clicked on?

    I have an array set up on my front panel. When the user right clicks on an element in that array, I would like them to be able select from 3 different options. I have the shortcut menu working, but I need to know which element in the array the user right clicked on to determine what values to change. How can I get the index of the element?
    Thanks for any help!
    Solved!
    Go to Solution.

    Couldn't you get index values from the array property node?
    Also this doesn't account for if scrollbars are seen or not.  And I usually like to know if my range is valid, because again I could be clicking on a scrollbar, or label and still get the Mouse Down event.
    Here is one I posted a while ago.
    http://forums.ni.com/t5/LabVIEW/Interesting-way-to-detect-array-index-from-mouse-position/m-p/286841...
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • How to pass a file with parameters to a shell script from java

    I have a sh script running on linux. This script prompts when started prompts for 4 questions, for which the answers are 1, 1, 1, Y. So now I need to invoke this from a java program and pass the parameters in a file from jave to the script. Can anyone tell me how to code this in java. The script works fine from command line.
    Thanks in advance.

    Here is the standard answer to all questions involving Runtime.exec(), enjoy:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • How to pass parameter to the method in EJB session bean from Managed Bean

    Hi,
    I need some guidance in accessing the EJB session bean methods from one of my backing Bean. I use EJB 3.0 Entity Beans and EJB Session Beans. I have to get value from my page and pass it thro the backing bean to the respective EJB session bean. I have no clue of how to do this,
    When i click a command link on the page, in its backing bean click method, i am able to get a value and store in a variable under its click action. But from there i am not knowing of how to pass it as a variable to the EJB session bean and hence execute the query(this is where we have to pass the variable as a parameter in its where clause) in the entity bean.
    I wanna know how to make a call to the EJB session bean and from there execute the Enitity bean.
    Guide me regarding this....
    Thanks
    ri

    Unfortunately dependency injection doesn't work for jsf backing beans, so you have to use a normal jndi lookup to find your session bean. The following example shows you how to find a session bean and call a method:
    public void commandButton_actionListener(ActionEvent actionEvent) {
    Context ctx;
    try {
    ctx = new InitialContext();
    helloWorldEjb = (HelloWorldEJB)ctx.lookup("HelloWorldEJB");
    hello = helloWorldEjb.sayHello(name);
    System.out.println(hello);
    } catch (NamingException e) {
    e.printStackTrace();
    }

  • How do I get Photoshop elements 9 to open RAW images from my Canon g16?

    How do I get elemente 9 to open RAW images from Canon G 16?

    Hi,
    You will need either use the Canon software to convert the CR2 files to TIF files or use the free Adobe DNG converter to convert the CR2 files to DNG files. Then import the TIF or DNG files into PSE 9.
    You could update to PSE 12 to avoid the conversions.
    Brian

  • How to highlight a specific element of an array

    I'm having some trouble selecting which element in an array has key focus. I want to be able to selectively highlight individual elements in an array of strings and set the key focus so that the user can immediately enter the text into that specific element.
    I have been able to get "selection.start" and "selection.end" to work, but when I get a reference to "array element" it always returns a reference to the last element manually clicked. This way, I can only programatically highlight different elements by manually clicking on them, which somewhat defeats the purpose.
    Does anyone know if this is possible, or if I need to move to tables or something else in order to give me this functionality?
    I'm using LV 6.1
    on W2k.
    Thanks
    Shane.
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

    I had the problem that I would like to highlight more than one cell in a 2d array.
    multicolumn listbox is very slow working with large data volumes so I had to use a 2d array instead, but then I lose the possibility to highlight.
    The solution I used was to bundle a LAD and control an put this in the array, takes a bit more coding but works fine. 
    Attachments:
    2d array with marker.vi ‏23 KB

  • How can I offset all elements of an array by the same number

    I'd like to know the quickest way to add a number to all elements of an array. In other word, offset the whole array by a number.

    You just use the normal add function. Wire the array to one input and the constant to the other input. After wiring the array, do not click on the other terminal and select Create>Constant because by default it will create an array. Just select a Numeric Constant from the Numeric palette or wire it to a control.
    Attachments:
    add_constant_to_array.jpg ‏3 KB

  • WebDynpro -  How to pass a single field value to BAPI table?

    Hello,
    I have just come from WebDynpro ABAP training and being a novice hit my first issue right away.
    I need to use BAPI - BAPI_CONTRACT_CREATEFROMDATA to create SD contract (I have used this BAPI to create a service call inside Webdynpro). I have two required fields: contract start and end dates. These fields passed in a table called CONTRACT_DATA_IN.
    When I use the fields from the structures or individual fields, all I need to do is just put them on the view, and when I hit my submit button they will be passed to the BAPI. They are a part of COMPONENTCONTROLLER context (I have also mapped them in View context), but tables are obviously different.
    Is there any way to pass data to tables as seamlessly without any code as for structures? Or do I need to write code to get the values from the input fields and then populate the table manually?
    Thanks,
    Alex

    Hi,
    Single customer contract creation use the struture-
    If you want to pass only one record then using the input fields for those 2 fields we can pass them to BAPI and then create the Customer Contract. This will work for only one record of customer contract.
    then we can directly read these input fields and pass to BAPI.
    Creating many customer contracts -
    For example, If you want to provide the group of records at a time and then you want to create the cusotmer contracts for so many records then you fill these fields and pass them to table then pass this table to the tables parameters of that BAPI.
    Here we need not create the Table UI element separate input fields would serve the purpose.
    Now we can create the batch of contracts for N customers.
    these input fields of a customer will be passed to table, then next set of input fields etc.
    For this create the Table UI element and fill all the records and then pass it to the Tables of the BAPI.
    Regards
    Lekha

  • How to pass the single/multiple selected data of a table to SAP(R/3)

    Hi ,
    I have a table with 2 colums and 10 records.Now i want to send the selected record/Multiple records to the R/3.
    Once the user checks the checkbox i retrieved the column values of that row/rows into a string array.
    and i added all the string arrays to an AbstractList.
    Now in function module it is giving as setT_TestOperations(AbstractList)
    can any one help as  how the function module understands the individual/multiple String arrays.
    If possible provide sample code for the same.
    Thanks and regards,
    Chandrashekar.

    One way to achieve this is to maintain an attribute in the assistance class or a node element , called OldLeadSelection , at the Component controller level which stores the value of the lead selection index.
    On LeadSelect action handler method, in the first line, read the value of the attribute/element defined above. For the first time a row is lead selected, this value will be initial. After exexcuting the code in the LeadSelection event handler method, store the LeadSelection index value in the attribute defined above. The next time when the LeadSelection event method is called, when the value of this attribute is read in the initial line, it will house the value of the index of the previous LeadSelection.
    There could be other ways to achieve this. This is one of the methods.
    Best Regards,
    Rashmi.

  • How to set Keyfocus to a single Element in an Array-Control

    How do i set the keyfocus programmatically to a single numeric-control in an array-control.

    This is detailed handled here.
    Guenter

  • How to pass multiple single values to parameter in planning function?

    Hi!
        I can not pass the variables (multiple single Values) from Input Layouts(BexAnalyzer) to Planning Function Types...Anyone have any idea for setting the parameter in the function types. I use the exit class CL_RSPLFC_BPS_EXITS.
    My Parameter Type is Elementary and also use variables allowed

    If you want to use the class as in a planning function type, proceed as follows:
    1. Create an InfoObject that accepts the name of the function module as a characteristic value. We recommend that you create an InfoObject of type character with length 30 and indicate that this InfoObject is "Without Master Data".
    2. In transaction RSPLF1, create a new function type. Chose the "Reference Data" option and enter the name of the class. This does NOT imply that reference data is read automatically, but results from the requirements for implementing the class.
    3. On the "Parameter" tab page, create two parameters - one for the exit module and one for the init module. The parameters should be "elementary". Chose the InfoObject you created in step two as the dedicated InfoObject. The names of the parameters are determined from the values of constant P_C_NAME_EXIT_PARAM and P_C_NAME_INIT_PARAM.
    4. If you require additional parameters in your function module (called exit parameters), you create these parameters as elementary parameters (with appropriate InfoObjects). Note an additional predefined parameter here - in many function modules, the name of the area is used from which the module is called. The area is not used in BI Integrated Planning but it may be the case that an area was created in BPS which only uses the current InfoCube. For this reason, you can create a parameter with the name specified in constant P_C_NAME_AREA_PARAM by specifying the name of this area to the function module. The value of this parameter is passed on to the function module in the interface as the value of the importing parameter I_AREA. Note that this technology can generally only by used for Basis InfoCubes and simple planning areas (not multi- planning areas or MultiProviders).
    You can create additional elementary parameters as long as the names do not correspond to the predefined names. The class automatically recognizes the additional parameters and transfers them to table IT_EXITP in the function modules.
    5. After you have activated the planning function type, you can create planning functions and fill the parameters accordingly.

Maybe you are looking for

  • Iphone 4 Home button not working after upgrade to OS 4.3.1

    I've just upgrade my iphone 4 to OS 4.3.1 and I'm having issues with home button not working. Need to hit it several times before I can close an app or wake the iphone. Any one having this issue?

  • File Sharing between Snow Leopard, Lion

    Today, I successfully installed Snow Leopard and Lion on separate partitions. Did a clean install of Lion and it is running 1000% better than when I installed it as an upgrade over Snow Leopard. Additionally, I also have Windows 7 running in Boot Cam

  • Record counter in message mapping

    Hi all, I'm having a multiple IDOCs to 1 file scenario, and structure is like this: source: IDOC(1..unbounded) target: structure1(1..unbounded) >field1(1..1) IDOC is mapped directly to structure1. for field, I need the number of total IDOC structure

  • Problem with transaction CG3Y - Path does not fit in Source file field.

    Hi colleagues, I need to download some PDF files from a folder in AL11. But when I try to enter the source file path in transaction CG3Y, in the first field "Source file on application server" I cannot enter the full path of the file. Apparently this

  • How come I cant play my content on the TV when I push play

    I recently sync'd my computer to the apple TV and I can clearly see my library and al my shows on TV. But when I press play to view them It doesnt play unless I  fast forward and then I can see the content but Forwraded.