How to sort nodes processed by the forEach activity in BPEL?

View: New views
4 Messages — Rating Filter:   Alert me  

How to sort nodes processed by the forEach activity in BPEL?

by KellyT :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a complexType containing a "sequenceNum" element. How would I go about using that element to sort nodes processed by the forEach activity in BPEL?

Re: How to sort nodes processed by the forEach activity in BPEL?

by Malkit Singh Bhasin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can see this project
http://blogs.sun.com/malkit/resource/dynamic_service_calls/DynamicServiceParallelCalls.zip 
on my blog http://blogs.sun.com/malkit/ that uses forEach to iterate
over a collection. This might give you some idea.

Unzip and Open the project BPELProject in netbeans and look for
MainBP.bpel file.

Malkit

KellyT wrote:
> I have a complexType containing a "sequenceNum" element. How would I go about
> using that element to sort nodes processed by the forEach activity in BPEL?
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: How to sort nodes processed by the forEach activity in BPEL?

by Kiran Bhumana-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Kelly,
With XSL code you can do that. You need to use the doxslTransform()
function or call an XSLT service. In open-ESB you can perhaps also do
this by calling an EJB today (and maybe a POJO SE if you have one that
supports this).

Kiran B.

KellyT wrote:
> I have a complexType containing a "sequenceNum" element. How would I go about
> using that element to sort nodes processed by the forEach activity in BPEL?
>  

--
Kiran Bhumana
Open ESB Community (http://open-esb.org)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: How to sort nodes processed by the forEach activity in BPEL?

by Rupesh Ramachandran-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Kelly,
Without sample xml data, it's hard to fully understand your requirement.
I'm assuming you mean that you want to sort the target based on the
'sequenceNum' element on the source. If that's the case, you should be
able to use 'sequenceNum' as the predicate (index) for the target node
in your ForEach mapping, and things should automatically be sorted.
However, if sequenceNum is not contiguous in the source, you will have
empty nodes on the target for sequenceNumbers that haven't arrived yet.
For instance:
  <ns1:myData sequenceNumber="1"/>
  <ns1:myData/>
  <ns1:myData sequenceNumber="3"/>
  <ns1:myData/>
  <ns1:myData/>
  <ns1:myData sequenceNumber="6"/>
For a non-trivial sort, I would stick with what Kiran suggested -
delegate this to XSL, Java EE or POJO SE since you don't want to clutter
your BPEL business logic with too much technical code anyway.

HTH,
Rupesh.

KellyT wrote:
> I have a complexType containing a "sequenceNum" element. How would I go about
> using that element to sort nodes processed by the forEach activity in BPEL?
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...

LightInTheBox - Buy quality products at wholesale price