You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by Håkon Sagehaug <Ha...@bccs.uib.no> on 2008/11/17 17:31:09 UTC

Assigning multiple values in bpel

Hi all,

I've got a bpel process that can invokes a web service that give eihter 1 or
many values back for the same element, the element is defined like this

<xsd:element ref="wlm:ReferenceId"
                            maxOccurs="unbounded" />

and will look something like this when

<?xml version="1.0" encoding="UTF-8"?>
<ReferenceId xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types">
<RefId xmlns="">865</RefId>
</ReferenceId>
<ReferenceId xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types">
<RefId xmlns="">867</RefId>
</ReferenceId>
<ReferenceId xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types">
<RefId xmlns="">869</RefId>
</ReferenceId>

Then I need to take these and put each of them into another element like
this

<ReferenceId2 xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types">
<RefId2 xmlns="">865</RefId2>
</ReferenceId2>
<ReferenceId2 xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types">
<RefId2 xmlns="">867</RefId2>
</ReferenceId2>

and call another ws with these element,so when I want to assign the values
to new elements, should I wrapp it all inside a for loop so that each
element is added to the next service request message. And how should this
for loop look like, pretty new to bpel. I use the eclipse designer and ode



cheers, Håkon

-- 
Håkon Sagehaug, Software Developer
Parallab, Bergen Center for Computational Science (BCCS)
UNIFOB AS (University of Bergen Research Company)

Re: Assigning multiple values in bpel

Posted by Matthieu Riou <ma...@offthelip.org>.
On Tue, Nov 18, 2008 at 7:24 AM, Håkon Sagehaug
<Ha...@bccs.uib.no>wrote:

> Hi
>
> Thanks for the tip, I'll have a look there.
>
> ode:insert-after($parent, $parent/child::node(), $siblings)
>
> here sibleing is the element you want to insert, correct?
>

Correct. And what Alex mentioned is correct as well, you will need the
latest 1.2.X branch. We have nightly builds available if you want.

Cheers,
Matthieu


>
> Håkon
>
>
>
> 2008/11/18 Matthieu Riou <ma...@offthelip.org>
>
> > On Mon, Nov 17, 2008 at 8:31 AM, Håkon Sagehaug
> > <Ha...@bccs.uib.no>wrote:
> >
> > > Hi all,
> > >
> > > I've got a bpel process that can invokes a web service that give eihter
> 1
> > > or
> > > many values back for the same element, the element is defined like this
> > >
> > > <xsd:element ref="wlm:ReferenceId"
> > >                            maxOccurs="unbounded" />
> > >
> > > and will look something like this when
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <ReferenceId xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types
> ">
> > > <RefId xmlns="">865</RefId>
> > > </ReferenceId>
> > > <ReferenceId xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types
> ">
> > > <RefId xmlns="">867</RefId>
> > > </ReferenceId>
> > > <ReferenceId xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types
> ">
> > > <RefId xmlns="">869</RefId>
> > > </ReferenceId>
> > >
> > > Then I need to take these and put each of them into another element
> like
> > > this
> > >
> > > <ReferenceId2 xmlns="
> http://bccs.uib.no/esysbio/workflow/launcher/types
> > ">
> > > <RefId2 xmlns="">865</RefId2>
> > > </ReferenceId2>
> > > <ReferenceId2 xmlns="
> http://bccs.uib.no/esysbio/workflow/launcher/types
> > ">
> > > <RefId2 xmlns="">867</RefId2>
> > > </ReferenceId2>
> > >
> > > and call another ws with these element,so when I want to assign the
> > values
> > > to new elements, should I wrapp it all inside a for loop so that each
> > > element is added to the next service request message. And how should
> this
> > > for loop look like, pretty new to bpel. I use the eclipse designer and
> > ode
> > >
> >
> > While it is possible in BPEL to loop over a "list" of nodes (a nodeset),
> > because of the way assignment has been designed it isn't possible to
> create
> > new lists. This is a known problem with the specification and the way it
> > worked around it is by introducing the doXslTransform XPath function that
> > lets you execute any XSL stylesheet. Using that function would be one
> > solution to your problem.
> >
> > Because not everybody likes XSL (it's an understatement) we've added
> other
> > utility XPath functions to make the type of transformation you're looking
> > at
> > easier. So you'll probably need to loop in your process and use something
> > like the insert-as-last-into function:
> >
> > http://ode.apache.org/xpath-extensions.html
> >
> > Hope this helps,
> > Matthieu
> >
> >
> > >
> > >
> > > cheers, Håkon
> > >
> > > --
> > > Håkon Sagehaug, Software Developer
> > > Parallab, Bergen Center for Computational Science (BCCS)
> > > UNIFOB AS (University of Bergen Research Company)
> > >
> >
>
>
>
> --
> Håkon Sagehaug, Software Developer
> Parallab, Bergen Center for Computational Science (BCCS)
> UNIFOB AS (University of Bergen Research Company)
>

Re: Assigning multiple values in bpel

Posted by Alex Boisvert <bo...@intalio.com>.
Keep in mind this function is currently only available in Subversion.   It's
not available in Ode 1.2 and should be released soon on Ode 1.3.

alex


On Tue, Nov 18, 2008 at 7:24 AM, Håkon Sagehaug
<Ha...@bccs.uib.no>wrote:

> Hi
>
> Thanks for the tip, I'll have a look there.
>
> ode:insert-after($parent, $parent/child::node(), $siblings)
>
> here sibleing is the element you want to insert, correct?
>
> Håkon
>
>
>
> 2008/11/18 Matthieu Riou <ma...@offthelip.org>
>
> > On Mon, Nov 17, 2008 at 8:31 AM, Håkon Sagehaug
> > <Ha...@bccs.uib.no>wrote:
> >
> > > Hi all,
> > >
> > > I've got a bpel process that can invokes a web service that give eihter
> 1
> > > or
> > > many values back for the same element, the element is defined like this
> > >
> > > <xsd:element ref="wlm:ReferenceId"
> > >                            maxOccurs="unbounded" />
> > >
> > > and will look something like this when
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <ReferenceId xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types
> ">
> > > <RefId xmlns="">865</RefId>
> > > </ReferenceId>
> > > <ReferenceId xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types
> ">
> > > <RefId xmlns="">867</RefId>
> > > </ReferenceId>
> > > <ReferenceId xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types
> ">
> > > <RefId xmlns="">869</RefId>
> > > </ReferenceId>
> > >
> > > Then I need to take these and put each of them into another element
> like
> > > this
> > >
> > > <ReferenceId2 xmlns="
> http://bccs.uib.no/esysbio/workflow/launcher/types
> > ">
> > > <RefId2 xmlns="">865</RefId2>
> > > </ReferenceId2>
> > > <ReferenceId2 xmlns="
> http://bccs.uib.no/esysbio/workflow/launcher/types
> > ">
> > > <RefId2 xmlns="">867</RefId2>
> > > </ReferenceId2>
> > >
> > > and call another ws with these element,so when I want to assign the
> > values
> > > to new elements, should I wrapp it all inside a for loop so that each
> > > element is added to the next service request message. And how should
> this
> > > for loop look like, pretty new to bpel. I use the eclipse designer and
> > ode
> > >
> >
> > While it is possible in BPEL to loop over a "list" of nodes (a nodeset),
> > because of the way assignment has been designed it isn't possible to
> create
> > new lists. This is a known problem with the specification and the way it
> > worked around it is by introducing the doXslTransform XPath function that
> > lets you execute any XSL stylesheet. Using that function would be one
> > solution to your problem.
> >
> > Because not everybody likes XSL (it's an understatement) we've added
> other
> > utility XPath functions to make the type of transformation you're looking
> > at
> > easier. So you'll probably need to loop in your process and use something
> > like the insert-as-last-into function:
> >
> > http://ode.apache.org/xpath-extensions.html
> >
> > Hope this helps,
> > Matthieu
> >
> >
> > >
> > >
> > > cheers, Håkon
> > >
> > > --
> > > Håkon Sagehaug, Software Developer
> > > Parallab, Bergen Center for Computational Science (BCCS)
> > > UNIFOB AS (University of Bergen Research Company)
> > >
> >
>
>
>
> --
> Håkon Sagehaug, Software Developer
> Parallab, Bergen Center for Computational Science (BCCS)
> UNIFOB AS (University of Bergen Research Company)
>

Re: Assigning multiple values in bpel

Posted by Håkon Sagehaug <Ha...@bccs.uib.no>.
Hi

Thanks for the tip, I'll have a look there.

ode:insert-after($parent, $parent/child::node(), $siblings)

here sibleing is the element you want to insert, correct?

Håkon



2008/11/18 Matthieu Riou <ma...@offthelip.org>

> On Mon, Nov 17, 2008 at 8:31 AM, Håkon Sagehaug
> <Ha...@bccs.uib.no>wrote:
>
> > Hi all,
> >
> > I've got a bpel process that can invokes a web service that give eihter 1
> > or
> > many values back for the same element, the element is defined like this
> >
> > <xsd:element ref="wlm:ReferenceId"
> >                            maxOccurs="unbounded" />
> >
> > and will look something like this when
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <ReferenceId xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types">
> > <RefId xmlns="">865</RefId>
> > </ReferenceId>
> > <ReferenceId xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types">
> > <RefId xmlns="">867</RefId>
> > </ReferenceId>
> > <ReferenceId xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types">
> > <RefId xmlns="">869</RefId>
> > </ReferenceId>
> >
> > Then I need to take these and put each of them into another element like
> > this
> >
> > <ReferenceId2 xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types
> ">
> > <RefId2 xmlns="">865</RefId2>
> > </ReferenceId2>
> > <ReferenceId2 xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types
> ">
> > <RefId2 xmlns="">867</RefId2>
> > </ReferenceId2>
> >
> > and call another ws with these element,so when I want to assign the
> values
> > to new elements, should I wrapp it all inside a for loop so that each
> > element is added to the next service request message. And how should this
> > for loop look like, pretty new to bpel. I use the eclipse designer and
> ode
> >
>
> While it is possible in BPEL to loop over a "list" of nodes (a nodeset),
> because of the way assignment has been designed it isn't possible to create
> new lists. This is a known problem with the specification and the way it
> worked around it is by introducing the doXslTransform XPath function that
> lets you execute any XSL stylesheet. Using that function would be one
> solution to your problem.
>
> Because not everybody likes XSL (it's an understatement) we've added other
> utility XPath functions to make the type of transformation you're looking
> at
> easier. So you'll probably need to loop in your process and use something
> like the insert-as-last-into function:
>
> http://ode.apache.org/xpath-extensions.html
>
> Hope this helps,
> Matthieu
>
>
> >
> >
> > cheers, Håkon
> >
> > --
> > Håkon Sagehaug, Software Developer
> > Parallab, Bergen Center for Computational Science (BCCS)
> > UNIFOB AS (University of Bergen Research Company)
> >
>



-- 
Håkon Sagehaug, Software Developer
Parallab, Bergen Center for Computational Science (BCCS)
UNIFOB AS (University of Bergen Research Company)

Re: Assigning multiple values in bpel

Posted by Matthieu Riou <ma...@offthelip.org>.
On Mon, Nov 17, 2008 at 8:31 AM, Håkon Sagehaug
<Ha...@bccs.uib.no>wrote:

> Hi all,
>
> I've got a bpel process that can invokes a web service that give eihter 1
> or
> many values back for the same element, the element is defined like this
>
> <xsd:element ref="wlm:ReferenceId"
>                            maxOccurs="unbounded" />
>
> and will look something like this when
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ReferenceId xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types">
> <RefId xmlns="">865</RefId>
> </ReferenceId>
> <ReferenceId xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types">
> <RefId xmlns="">867</RefId>
> </ReferenceId>
> <ReferenceId xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types">
> <RefId xmlns="">869</RefId>
> </ReferenceId>
>
> Then I need to take these and put each of them into another element like
> this
>
> <ReferenceId2 xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types">
> <RefId2 xmlns="">865</RefId2>
> </ReferenceId2>
> <ReferenceId2 xmlns="http://bccs.uib.no/esysbio/workflow/launcher/types">
> <RefId2 xmlns="">867</RefId2>
> </ReferenceId2>
>
> and call another ws with these element,so when I want to assign the values
> to new elements, should I wrapp it all inside a for loop so that each
> element is added to the next service request message. And how should this
> for loop look like, pretty new to bpel. I use the eclipse designer and ode
>

While it is possible in BPEL to loop over a "list" of nodes (a nodeset),
because of the way assignment has been designed it isn't possible to create
new lists. This is a known problem with the specification and the way it
worked around it is by introducing the doXslTransform XPath function that
lets you execute any XSL stylesheet. Using that function would be one
solution to your problem.

Because not everybody likes XSL (it's an understatement) we've added other
utility XPath functions to make the type of transformation you're looking at
easier. So you'll probably need to loop in your process and use something
like the insert-as-last-into function:

http://ode.apache.org/xpath-extensions.html

Hope this helps,
Matthieu


>
>
> cheers, Håkon
>
> --
> Håkon Sagehaug, Software Developer
> Parallab, Bergen Center for Computational Science (BCCS)
> UNIFOB AS (University of Bergen Research Company)
>