Hi everyone. I am new to the Oracle SOA Suite and I am using release 11g. Here is what I am trying to accomplish -
I have an element of with multiple nodes (carTypes) and within that I have the car's color, year, and make. I loop through the array and try to assign only cars within a year range so that the response will show all the nodes of those years. But, the only carType node within in year range that shows in the response is the last node in the range.
For example, I have have 3 car years that are within range so the response should show -
It only shows the last one -
Looking at the trace It looks like it is just overwriting the node instead of making multiple nodes.
How do I have it create multiple nodes so that I can get the response showing all cars within range?
That worked! Now I am trying build a nodelist to respond with the carTypes that were not in the range. I put the while loop in Scope and attached a CatchAll to it. If the car year is not in range I throw a fault. In the catch all is where I want to build the nodelist of cars not selected. Now those elements seem to be getting overwritten. This seems so much easier to accomplish in regular Java which is what makes this so frustrating.
I am beleiving that your requirement is
1) To reply back with all the CarTypes that are in a given range, then reply back with the list
2) Otherwise reply back with the a fault that contains all the CarTypes that are not in the given range.
If that is the case:
Then to implement "part (1)" you already have solution. For "part (2)" create another vairable 'tempVariable' and collect all the CarTypes again, simillary to what you did for the step 1, using For Each an If , however, this time the condition for the if will be the opposite of previous one.
Finally, before replying, check the contents of the 'tempVariable', if it not empty reply with fault otherwise give the proper reply.
P.S.:While loop in BPEL is costly, use the costructs like while, if they are mandatory and not avoidable (Don't use them as you would use in OO/procedural languages)
Mark the posting appropriately, as "Helpful", "Correct Answer", if your issue is resolved.
I believe I did what you suggested before you suggested it.
while loop goes through the list node
if carType/caryear[index] > carrange
concat all caryears[index] not in range to tmpFault variable
<switch condition if tmpFault.length > 0>
Hopefully you get the logic. If so, does that seem like an okay solution?