Using the arrays in BPEL

Hi All,
I have a simple requirement where I will get some Array of Strings as input which is from some namespace. I wanted to iterate throught these array of strings and set them into some other partner service namespace.
If copy the parent element of the Array of Strings to the partner service element it;s failing as the partner service doesn't know anything about this namespace.
This is what I send as input
<postCodeSectors>
<string>a</string>
<string>b</string>
<string>c</string>
<string>d</string>
</postCodeSectors>
I wanted to iterate throught this array and set them into the following element
<xs:element minOccurs="0" maxOccurs="1" name="Postcodes" type="tns:ArrayOfString"/>
which is of
<xs:complexType name="ArrayOfString">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="xs:string"/>
</xs:sequence>
I am able to iterate through the postCodeSectors but I have no idea how to copy them into the new Postcodes from different namespace.
Could you please help me adding these values to the new element.
Thank you.
Edited by: user12190018 on 04-Dec-2009 02:23

<pre>
<variables>
<!-- Reference to the message passed as input during initiation -->
<variable name="inputVariable" messageType="client:LoopOverListsWithWhileRequestMessage"/>
<!-- Reference to the message that will be returned to the requester-->
<variable name="outputVariable" messageType="client:LoopOverListsWithWhileResponseMessage"/>
<variable name="lPersonCounter" type="xsd:int"/>
<variable name="lPersonRunningIndex" type="xsd:int"/>
</variables>
<!--
ORCHESTRATION LOGIC
Set of activities coordinating the flow of messages across the
services integrated within this business process
-->
<sequence name="main">
<!-- Receive input from requestor. (Note: This maps to operation defined in LoopOverListsWithWhile.wsdl) -->
<receive name="receiveInput" partnerLink="loopoverlistswithwhile_client" portType="client:LoopOverListsWithWhile" operation="process" variable="inputVariable" createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<assign name="Assign_PersonCountAndIndex">
<copy>
<from expression="ora:countNodes('inputVariable','payload','/ns1:personsElement/ns1:person') + 1 "/>
<to variable="lPersonCounter"/>
</copy>
<copy>
<from expression="1"/>
<to variable="lPersonRunningIndex"/>
</copy>
</assign>
<while name="While_1"
condition="bpws:getVariableData('lPersonRunningIndex') &lt; bpws:getVariableData('lPersonCounter')">
<sequence>
<scope name="Scope_CreateTmpPersonAndAppend">
<variables>
<variable name="ltmpPersonOneName"
element="ns1:personOneNameElement"/>
</variables>
<assign name="Assign_TmpPersonAndAppend">
<copy>
<from expression="concat(bpws:getVariableData('inputVariable','payload','/ns1:personsElement/ns1:person[$lPersonRunningIndex]/ns1:firstName'), ' ' , bpws:getVariableData('inputVariable','payload','/ns1:personsElement/ns1:person[$lPersonRunningIndex]/ns1:lastName'))"/>
<to query="/ns1:personOneNameElement/ns1:name"
variable="ltmpPersonOneName"/>
</copy>
<bpelx:append>
<bpelx:from variable="ltmpPersonOneName"
query="/ns1:personOneNameElement"/>
<bpelx:to variable="outputVariable" part="payload"
query="/ns1:personsSimpleElement"/>
</bpelx:append>
</assign>
</scope>
<assign name="Assign_IncrementCounter">
<copy>
<from expression="bpws:getVariableData('lPersonRunningIndex') + 1"/>
<to variable="lPersonRunningIndex"/>
</copy>
</assign>
</sequence>
</while>
<reply name="replyOutput" partnerLink="loopoverlistswithwhile_client" portType="client:LoopOverListsWithWhile" operation="process" variable="outputVariable"/>
</sequence>
</pre>

Similar Messages

  • How to use the arrays in BPEL

    I am giving the input below shows
    <to>
    <email>[email protected]</email>
    <email>[email protected]</email>
    </to>
    i will put the while loop and i count the index values.
    in while loop,it takes only one email id.
    my coding is
    <while condilition=('varindex'<ora:countnodes('inputvariable','payload',/client:to))>
    <assign activity>
    <first copy rule>
    <vartemp= concat('vartemp',"",bpws:getvariabledata('email'))>
    <second copy rule>
    <varindex = vraindex+1>
    </assign>
    </while>
    but vartemp adds only 1st email id.if i pass <vartemp= concat('vartemp',"",bpws:getvariabledata('email[varindex]'))> ,It shows error.
    pls how to retrieve the two email ids using array index.
    Edited by: user8984400 on Jan 13, 2010 11:22 PM

    have you tried this :
    http://clemensblog.blogspot.com/2006/03/bpel-looping-over-arrays-collections.html
    or this :
    http://oraclebpelindepth.blogspot.com/2008/09/arrays-in-bpel_21.html
    your assign should be something like :
    before this assign outside the loop you can assign the counter_index to some variable by ora:countnodes('inputvariable','payload',/client:to), and use this variable in the other xpaths
    <from expression="concat('/ns1:to/ns2:mail[',bpws:getVariableData('Variable_Index_Counter'),']') "/>
    <to variable="Variable_Xpath"/>
    notice also the [] characters, you need those together with the index-value to be able to loop over the list of email-elements
    hope its clear?

  • How to use the array elements

    Hi, i'm trying to automate a questionary using array.
    // In the compositionReady for the stage
    sym.actual = 0;
    sym.arr = [ "Hi","Love","You" ]              // This is my question array.
    sym.checkArr = function(){                  // this the function that i use to check whis question of the array i'm going to use.
              sym.Question = arr[actual];      // i want to use the value "Hi", and then increase my "actual" var and then use the value "Love"
    // In my symbol timeline i use a trigger, in that trigger i use
    sym.stop();
    sym.quest = sym.getComposition().getStage().Question;         // I'm getting the Question value;
    sym.$("Ask").html(quest );                                                         //"Ask" is an empty textfield;
    sym.getComposition().getStage().actual ++;                    // Increase "actual" for the nex time.
    But the code doesn't work, i think the problem is the way i use the array index.
    Please help!
    Thanks =)

    Hi there,
    chino_10 wrote:
    in te timeline trigger  why did you use a local variable?
    It's good practice to use local variables whenever possible. The quest variable will only apply to that trigger, and it won't carry over to another trigger in the same timeline. So when using a trigger to set the HTML of a text element in the same timeline, I find it cleaner to assign a new HTML value from a local variable.
    chino_10 wrote:
    and if you are calling the global variable "actual" from de compositionReady handler why didn'y you call it with all the path like "sym.getComposition().getStage().actual ++;"?
    I think maybe I didn't express it as clearly as I could have. When you declare sym.actual in compositionReady, you actually have declared a variable scoped to the main stage symbol - it's not a global variable. To declare a global variable (which is not always best practice), your code in compositionReady would be:
    actual = 0;
    This actual variable would now be accessible from any element/symbol in the composition simply by assigning a value to actual. You may see how this could quickly get messy.
    So getting back to variable scope: if you declare a symbol variable using sym.varName, then any element in the same scope can call it using sym.varName. So your main timeline triggers can call it without using the full addressing of sym.getComposition().getStage().actual++. Instead, you could just use sym.actual++. Less code, and easier to read. But if you wanted to call it from another symbol (outside of the scope of the main stage), then you'd have to use the full addressing to actually address the variable, i.e., sym.getComposition().getStage().actual ++.
    hth,
    Joe

  • Using the Array SetElements function

    Hi All,
    I'm trying to use the Array SetElements function to set a value to specific indices within an initialized array but I cannot figure out what the syntax is for the optional parameter 2. I've tried a whole bunch that seem to make sense but always get an error. Has anyone used this function before who can let me know what the syntax to use is?
    Thanks,
    Nick
    Solved!
    Go to Solution.

    Nick,
    So the syntax for setting all of the elements to a value can simply be written:
    SetElements( myArray,valueToSet )
    To add in the optional parameter 2 and define a range is something like this:
    SetElements( myArray,valueToSet, "[3..6]" )
    The .. operator is analagous to a : in Matlab.
    Good luck,
    Chris

  • How can I set the caption text of picture controls inside an array or how can I choose which array element is assigned using the array elements caption text property.

    I have 8 picture controls inside an array and I would like to set the caption text of these controls.
    I have used the property node of the array and used the array elements property caption text to set the text.
    The problem is however that I set the same text to all the picture controls inside the array.
    My question is how to set caption text of specific elements (Picture control) that I have so far only been able to access using the array elements caption text property.

    Some more help
    1 You could use the caption of the array and place it in front of the selected picture and update that using property nodes.
    2 Like Norbett said if you use a cluster of pictures then their caption can be updated individually.
    Here is a an example that demonstrates the above
    David
    Attachments:
    Modify the Captions Of Pictures.vi ‏83 KB

  • Using the array of file names from File.list()

    Hi
    I'm having trouble with my code, similar to this:
    File temp=new File(path); //where 'path' is a String containing the directory path
    String [ ] arr = temp.list();
    Then when trying to use arr, I come up with NullPointerExceptions.
    The Java API says that the File.list() method returns a Stirng array.
    But then how do I use/get this array in a nice usable form?
    (eg. to be able to loop through the list of {returned} Files)

    Yes I have referred closely to the documentation.
    The method list() for my File object is definitely not returning null;
    it seems that as soon as the code inside the loop tries to access the next element of the returned array [the one after the last existing element] - which is actually non-existent (ie overstepped the bounds of the array's index) - the program comes up with an Exception*. So the method list() does not return null...
    I have managed a workaround similar to this:
            File temp = new File (path);
            String[] list = new String [temp.list ().length + 1];
            try
                for (int i = 0 ; temp.list () != null ; i++)
    list [i] = temp.list () [i];
    catch (ArrayIndexOutOfBoundsException iobe)
    * The program is not coming up with NullPointerExceptions anymore; only an ArrayIndexOutOfBoundsException if I comment out the try and catch coding.... (?)
    Thanks for your suggestion about posting this at the Java Programming Forum.
    My workaround works, but is there a way to do this without catching an exception?

  • Using the CHECKIN_UNIVERSAL with bpel

    I have to integrate my legacy with the ucm by bpel.
    I imported the wsdl GenericSoaPort http://localhost:16300/idcws/GenericSoapPort but when i will pass the parameters, appears only a anysimpletype type to input the name.
    With the SOAPUI, where i created the fields, worked fine, but at bpel, i don´t know pass the variable.
    Can help me?
    <xs:element name="Field">
                    <xs:complexType>
                        <xs:simpleContent>
                            <xs:extension base="xs:string">
                                <xs:attribute name="name" type="xs:anySimpleType"/>
                            </xs:extension>
                        </xs:simpleContent>
                    </xs:complexType>

    Don't import the wsdl by using the http link in bpel. First save the wsdl and import locally. Also you need to pass the username and password that you can apply in EM console.

  • How do I use an array variable in the assignment target?

    Hi,
    I am creating a BPEL process in which I have to use an array variable. The array variable needs to be initialized based on some condition.
    The issue is I cannot find a way to set the value of the array variable. There are ways to GET the value of an array variable indexing into it.
    But how do I set the value by using the Array variable in the <to> tag?
    Any help is appreciated. I am using BPEL 10.1.2.0.2.
    Thanks.

    You can declare a variable of type integer which will server as your index. Figure out based on some condition in your process which index of array to update. Assign to your integer variable you created.
    And have Assign copy operation like this -
    <copy>
    <from variable="Var_Output_FetchDueDate"
    part="OutputParameters"
    query="/ns18:OutputParameters/ns18:DUEDATE"/>
    <to variable="outputVariable" part="payload"
    query="/client:GetCustomerAccountInformationProcessResponse/client:customer/client:accounts/client:account[$Var_Counter]/client:dueDate"/>
    </copy>
    I have been using this in my processes.

  • How to change the frequency of pulse train on the fly using an array of values?

    Hi all!
    First I want to thank U for the great job you are doing for this forum.
    Iam still busy trying to control a stepper motor, by sending pulses from my E-series 6024 to a compumotor s6- stepper Driver. I've managed to get it working. I desperately need to control the motor using the values from an array. I believe we can use two approaches for that:
    1st - I can get an array of the "numbers of pulses". Each element must run for 10 milliseconds. Using that we can calculate the array of frequencies to send the number of pulses within 10 milliseconds for each specific element. Could we use the arrays of "number of pulses" and frequencies in a "finite pulse train " and up
    date with each element every 10 millisecond?
    2nd - Or Could we use of the frequency array in a "continuous pulse train vi" and update it every 10 milliseconds?
    Please note that I must use the values as they are.
    Can someone please built a good example for me? Your help will be appreciated.
    Regards
    Chris
    Attachments:
    number_of_steps.txt ‏17 KB
    frequency.txt ‏15 KB

    Tiano,
    I will try to better explain the paragraph on LabVIEW. The original paragraph reads ...
    "While in a loop for continuous pulse train generation, make two calls to Counter Set Attribute.vi to set the values for "pulse spec 1" (constant 14) and "pulse spec 2" (constant 15). Following these calls you would make a call to Counter Control.vi with the control code set to "switch cycle" (constant 7). The attached LabVIEW programs demonstrate this flow."
    You can make two calls to Counter Set Attribute or you can make a call to Set Pulse Specs which, if you open this VI, you will see that it is just making two calls to Counter Set Attribute. What you are doing with the Counter Set Attribute VIs is setting two registers called "pulse s
    pec 1" and "pulse spec 2". These two registers are used to configure the frequency and duty cycle of your output frequency.
    The example program which is attached to this Knowledge Base demonstrates how to change the frequency of a continuous generation on the fly. Why continuous? Because changing the frequency of a finite train would be easy. When the train completes it's finite generation you would just change the frequency and run a finite train again. You would not care about the time delay due to reconfiguration of the counter.
    If you would like to change the frequency of the pulse train using a knob, this functionality will have to be added in the while loop. The while loop will be continuously checking for the new value of the knob and using the knob value to set the pulse specs.
    LabVIEW is a language, and as with learning all new languages (spoken or programatic) there is a lot of learning to be accomplished. The great thing is that LabVIEW is much easier than mo
    st languages and the learning curve should be much smaller. Don't fret, you'll be an expert before you know it. Especially since you're tackling a challenging first project.
    Regards,
    Justin Britten

  • Is there any way to create a circular buffer using the INSERT ARRAY function?

    I saw the example using the REPLACE ARRAY function, but it uses too much CPU power on my laptop. I'm using it for a very sensitive application and saw that the INSERT ARRAY function used much less CPU power.
    I am also not wiring the index on the INSERT ARRAY function so that whatever is read from the buffer is added to the array.
    However, since it is not indexed, I don't know how to set the "write" index back to 0 when it reaches a certain sized array (ie 1000 elements). I was looking for an array property node, but couldn't figure out if one exists for the "current write index".
    Can anyone help?
    Thanks

    I will try to answer this question to my best understanding. I apologize if I interpreted the question wrong.
    You are using the "Insert Array" vi without wiring the index. By doing that, new elements will be added (appended) to the array.
    If you just want to know the current index to stop your acquisition when the array reach certain amount of elements, then you can use the "Array Size" vi to keep track of the size of the growing array. Remember that Array Size = last index + 1 because the index start at zero.
    A second option is that you may want to start over the array when it hits the maximum number of elements that you will allow. If that's the case, then you may want to re-initialize the array to a NULL state by stablishing a condition (for example, when the
    size of the array is 1000, re-initialize). I provided an example attached to this message showing how this can be accomplished. In the example, an 1D array grows in size using the "Insert Array" vi and inserting a random number. When the array reach 4 elements, it is re-initialized. You can expand this example by saving the array first to a file or some other holder before re-initializing the array. The example is in LabVIEW 6.
    Finally, if you want to replace the current values with new values, I think you do not have other choice but to use the "Replace Array" vi.
    Hope this can be of help.
    Regards;
    Enrique Vargas
    www.vartortech.com
    Attachments:
    array_example.vi ‏20 KB

  • Re-using the same array on the same page later

    i am using an array to write values to a text file, is there a way to re-use that same array on the same page... after the values has been writen to a file, clear the values and use it again(no need to re-size it), just use it again....

    Thanks. I have a text box that takes a project id and calls a method that gets the data from db and stores it in a vector than i am looping throught the vector and assiging the values to an array and writing each value to a text file. i want to add another text field on there and see if the user wants to pass another project id (passing two) so i have to re-use the arrays again if the text box is not null. don't i need to re-define the arrays again to use them?

  • Trying to understand and use an Array

    I would like to have a game where the player has three tries before the game stops or moves on to another level.
    In this game an object jumps up with a mouseClick and if it doesn't hit it's target it falls where it crashes into a floor that uses hitTestObject.
    This leads to a  restartBtn. but I want that movieClip to remain on the stage, which has an animation that splatters. A new MovieClip is put on to the stage and the cycle starts over.
    Before this stage of the game s over I want the various movieClip splatters to be visible on the stage.
    I thought an Array would help me achieve this result but I'm not familiar with using them dynamically.
    I'm hoping someone can give me some tips as to what might work.
    I have temporarily separated this problem from the rest of the code as I'm hoping it will be clearer.
    This is where I left off and when I click the button it seems to eliminate the previous movieClip and introduce the next one.
    But it seems like I'm missing someting so I thought I would post it as it is probably a problem that comes up a lot in games. Thanks
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    var movieArray:Array = new Array();
    movieArray = ["Egg_A","Egg_B","Egg_C"];
    movieArray[0] = new Egg;
    movieArray[1] = new Egg_B;
    movieArray[2] = new Egg_C;
    var myMovieClip:MovieClip;
    init();
    function init()
              for (var i:int = 0; i < movieArray.length; i++)
                        emptyMC.addChild(movieArray[i]);
    mainBtn.addEventListener(MouseEvent.CLICK,changeEgg);
    function changeEgg(evt:MouseEvent):void
              for (var i:int = 0; i < movieArray.length; i++)
                        movieArray.splice(i,1);
              init();

    I don't see where an array is going to make anything remain.  Just having an instance created without removing it until you want it to go away is all you need.
    I don't see much reason with what you are doing with that array either.  First you assign a set of strings to it, then you replace those strings with instances of some Egg objects.  Then you add all the eggs to the display at once in your init() function (not one at a time), or you remove them all from the array with your change Egg function... calling the init() function after emptying the array isn't going to yield much since the init() function uses the array.

  • Using an array in one class from another

    If I create a new string array in a class, and then set the values in that class, how can I use these value in another class? The way I have tried is to create a new instance of the class that holds the array, but when thinking about it, if I create a new instance surely the value in the array wont have been set? hence why when I am trying to use the array all the values are null.
    Thanks

    You could create a member variable in one class, making the the variable of the other class' type. Then simply call one of the member object's methods, passing the array reference as an argument.

  • Using An Array Formula within a Pivot Table

    Hello Everyone!
    I've discovered a problem with using the Pivot Table. I wish to add this array formula for Counting Distinct names into a Pivot Table, but within Power Query for Excel 2013, it won't allow me to add an array formula. I need to use slicers for filtering city
    names which I'm not able to with this new restriction. 
    For example, suppose I wish to get (using a slicer) a distinct count of city names in a particular year using the year slicer. I cannot do this as I am not allowed to use array formulas within the Pivot Table which contains names of cities according to years.
    If I use the array formula for counting distinct city names outside the Pivot Table, then I won't be able to use the year slicer in order to get a distinct count of names of cities.
    Is there a way around this problem and how may I be able to resolve it ??
    Appreciate your help. Thanks.
    The problem with being punctual is, there's nobody there to appreciate it !!!

    Hello Everyone!
    I've discovered a problem with using a Pivot Table. I wish to add an array formula for Counting Distinct names into a Pivot Table, but within Power Query for Excel 2013, it won't allow me to add an array formula. I need to use slicers for filtering city names
    which I'm not able to with this new restriction. 
    For example, suppose I wish to get (using a slicer) a distinct count of city names in a particular year using the year slicer. I cannot do this as I am not allowed to use array formulas within the Pivot Table which contains names of cities according to years.
    If I use the array formula for counting distinct city names outside the Pivot Table, then I won't be able to use the year slicer in order to get a distinct count of names of cities.
    Is there a way around this problem and how may I be able to resolve it ??
    Appreciate your help. Thanks.
    The problem with being punctual is, there's nobody there to appreciate it !!!

  • How can i use Oracle Adpaters without BPEL

    I want to ask how to use adapters without using BPEL.
    Is there any document about that ?
    All document i read using the adpater inside BPEL project.
    Thanks in advance,

    Hi,
    If you are refering to iWay Supplied adapters (like JDE, SAP, PeopleSoft etc. also known as Oracle Adapters) and using them from outside BPEL, then you can very well use them outside BPEL.
    All the adapters can be deployed on to your Oracle Application Server as Resource Adapter for JCA access and also you can deploy Oracle Business Service Engine (OBSE/ iBSE) a servlet apps onto your Apps Server for Web Service generation.
    Hope this is of any help.
    Best Regards,
    Sandipan

Maybe you are looking for

  • How to set up user account in Windows 7/Premiere Elements 8.0/8.0.1?

    At the present time I have only the Windows XP Professional SP3 32 bit operating system which works from a User Account with Adminstrative Privileges when it comes to using Premiere Elements. I have read that in Windows 7, the default user account is

  • How can I grab a specific integer value from iTunes Current Album?

    Currently I'm working with these two bits of code: This returns the "album" value from the track current playing in iTunes. on run     set info to ""     tell application "System Events"         set num to count (every process whose name is "iTunes")

  • How to generate a single Journal Entry for multiple Payments

    Hi All When creating a payment batch with 2 notes for example, would be possible in the accounting GL batch summarize only the line of Cash? Thanks

  • Will there be a free Update to Aperture 4 ?

    Will there be a free Update to Aperture 4 ? I am still hoping for a Aperture 4 release with Mountain Lion. Should i buy Aperture 3.3 now and could i download thenAperture 4 for free ? Thank you guys !          

  • Acrobat 9 Form Question

    I created a form, had folks fill it out.  How do I make the fields (where they have their answers) no longer active? It seems that there must be a way to make the form static so that the answer fields are no longer active, but I can't seem to find ou