You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by Jorge Rodríguez Pedrianes <jr...@arte-consultores.com> on 2007/08/14 11:36:50 UTC
Unbounded elements problems
These days Im trying to use ODE to manage unbounded elements. For example,
I have a process that returns an array of items:
<consultaReturn>
<items>
<item>
<param1>value1</param1>
<param2>value2</param2>
</item>
<item>
<param1>value3</param1>
<param2>value4</param2>
</item>
</items>
</consultaReturn>
When, in bpel, I try to build this, I cant do it.
My bpel is:
<bpel:sequence>
<bpel:assign>
<bpel:copy>
<bpel:from>
<bpel:literal>1</bpel:literal>
</bpel:from>
<bpel:to>$numItems</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal>
<consultaReturn>
<items>
<item>
<param1 />
<param2 />
</item>
</items>
</consultaReturn>
</bpel:literal>
</bpel:from>
<bpel:to>$result</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal>
<item>
<param1>value1</param1>
<param2>value2</param2>
</item>
</bpel:literal>
</bpel:from>
<bpel:to>$auxItem</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>$auxItem</bpel:from>
<bpel:to>$result/items/item[$numItems]</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>>$numItems + 1</bpel:from>
<bpel:to>$numItems</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal>
<item>
<param1>value3</param1>
<param2>value4</param2>
</item>
</bpel:literal>
</bpel:from>
<bpel:to>$auxItem</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>$auxItem</bpel:from>
<bpel:to>$result/items/item[$numItems]</bpel:to>
</bpel:copy>
</bpel:assign>
</bpel:sequence>
But whit this ODE construct
<consultaReturn>
<items>
<item>
<param1>value3</param1>
<param2>value4</param2>
</item>
</items>
</consultaReturn>
What is the problem? Anybody know work with unbounded elements?
Thanks
RE: Unbounded elements problems
Posted by Jorge Rodríguez Pedrianes <jr...@arte-consultores.com>.
Thanks I will use xslTrasform Thanks a lot
-----Mensaje original-----
De: Alex Boisvert [mailto:boisvert@intalio.com]
Enviado el: miércoles, 15 de agosto de 2007 5:17
Para: user@ode.apache.org
Asunto: Re: Unbounded elements problems
(Been trying to send this all day... the mailing list was bouncing)
Hi Jorge,
Standard BPEL assignments (using XPath) do not have the capability to insert
data into a nested structure. The structure must already exist in order to
select the target node in the <to> expression.
Your best bet is to use XSLT, which is recommended for any complex data
transformation in BPEL:
<bpel:assign>
<bpel:from>bpel:doXslTransform("foo.xsl", $foo)</bpel:from>
<bpel:to variable="foo" />
</bpel:assign>
You can see an example here
http://svn.apache.org/repos/asf/ode/trunk/bpel-test/src/test/resources/bpel/
2.0/TestXslTransform/
There's been discussion about extending the <copy> activity to support
insertion. The current ideas/proposal can be found here:
http://cwiki.apache.org/confluence/display/ODExSITE/copy+with+insert+attribu
te
alex
On 8/14/07, Jorge Rodríguez Pedrianes <jr...@arte-consultores.com> wrote:
>
> These days I'm trying to use ODE to manage unbounded elements. For
> example,
> I have a process that returns an array of items:
>
>
>
> <consultaReturn>
>
> <items>
>
> <item>
>
> <param1>value1</param1>
>
> <param2>value2</param2>
>
> </item>
>
> <item>
>
> <param1>value3</param1>
>
> <param2>value4</param2>
>
> </item>
>
> </items>
>
> </consultaReturn>
>
>
>
> When, in bpel, I try to build this, I can't do it.
>
>
>
> My bpel is:
>
>
>
> <bpel:sequence>
>
> <bpel:assign>
>
> <bpel:copy>
>
> <bpel:from>
>
> <bpel:literal>1</bpel:literal>
>
> </bpel:from>
>
> <bpel:to>$numItems</bpel:to>
>
> </bpel:copy>
>
> <bpel:copy>
>
> <bpel:from>
>
> <bpel:literal>
>
> <consultaReturn>
>
> <items>
>
> <item>
>
> <param1 />
>
> <param2 />
>
> </item>
>
> </items>
>
> </consultaReturn>
>
> </bpel:literal>
>
> </bpel:from>
>
> <bpel:to>$result</bpel:to>
>
> </bpel:copy>
>
> <bpel:copy>
>
> <bpel:from>
>
> <bpel:literal>
>
> <item>
>
> <param1>value1</param1>
>
> <param2>value2</param2>
>
> </item>
>
> </bpel:literal>
>
> </bpel:from>
>
> <bpel:to>$auxItem</bpel:to>
>
> </bpel:copy>
>
> <bpel:copy>
>
> <bpel:from>$auxItem</bpel:from>
>
> <bpel:to>$result/items/item[$numItems]</bpel:to>
>
> </bpel:copy>
>
> <bpel:copy>
>
> <bpel:from>>$numItems + 1</bpel:from>
>
> <bpel:to>$numItems</bpel:to>
>
> </bpel:copy>
>
> <bpel:copy>
>
> <bpel:from>
>
> <bpel:literal>
>
> <item>
>
> <param1>value3</param1>
>
> <param2>value4</param2>
>
> </item>
>
> </bpel:literal>
>
> </bpel:from>
>
> <bpel:to>$auxItem</bpel:to>
>
> </bpel:copy>
>
> <bpel:copy>
>
> <bpel:from>$auxItem</bpel:from>
>
> <bpel:to>$result/items/item[$numItems]</bpel:to>
>
> </bpel:copy>
>
> </bpel:assign>
>
> </bpel:sequence>
>
>
>
> But whit this ODE construct
>
> <consultaReturn>
>
> <items>
>
> <item>
>
> <param1>value3</param1>
>
> <param2>value4</param2>
>
> </item>
>
> </items>
>
> </consultaReturn>
>
>
>
> What is the problem? Anybody know work with unbounded elements?
>
>
>
> Thanks
>
>
>
>
>
>
>
>
>
>
>
>
Re: Unbounded elements problems
Posted by Alex Boisvert <bo...@intalio.com>.
(Been trying to send this all day... the mailing list was bouncing)
Hi Jorge,
Standard BPEL assignments (using XPath) do not have the capability to insert
data into a nested structure. The structure must already exist in order to
select the target node in the <to> expression.
Your best bet is to use XSLT, which is recommended for any complex data
transformation in BPEL:
<bpel:assign>
<bpel:from>bpel:doXslTransform("foo.xsl", $foo)</bpel:from>
<bpel:to variable="foo" />
</bpel:assign>
You can see an example here
http://svn.apache.org/repos/asf/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestXslTransform/
There's been discussion about extending the <copy> activity to support
insertion. The current ideas/proposal can be found here:
http://cwiki.apache.org/confluence/display/ODExSITE/copy+with+insert+attribute
alex
On 8/14/07, Jorge Rodríguez Pedrianes <jr...@arte-consultores.com> wrote:
>
> These days I'm trying to use ODE to manage unbounded elements. For
> example,
> I have a process that returns an array of items:
>
>
>
> <consultaReturn>
>
> <items>
>
> <item>
>
> <param1>value1</param1>
>
> <param2>value2</param2>
>
> </item>
>
> <item>
>
> <param1>value3</param1>
>
> <param2>value4</param2>
>
> </item>
>
> </items>
>
> </consultaReturn>
>
>
>
> When, in bpel, I try to build this, I can't do it.
>
>
>
> My bpel is:
>
>
>
> <bpel:sequence>
>
> <bpel:assign>
>
> <bpel:copy>
>
> <bpel:from>
>
> <bpel:literal>1</bpel:literal>
>
> </bpel:from>
>
> <bpel:to>$numItems</bpel:to>
>
> </bpel:copy>
>
> <bpel:copy>
>
> <bpel:from>
>
> <bpel:literal>
>
> <consultaReturn>
>
> <items>
>
> <item>
>
> <param1 />
>
> <param2 />
>
> </item>
>
> </items>
>
> </consultaReturn>
>
> </bpel:literal>
>
> </bpel:from>
>
> <bpel:to>$result</bpel:to>
>
> </bpel:copy>
>
> <bpel:copy>
>
> <bpel:from>
>
> <bpel:literal>
>
> <item>
>
> <param1>value1</param1>
>
> <param2>value2</param2>
>
> </item>
>
> </bpel:literal>
>
> </bpel:from>
>
> <bpel:to>$auxItem</bpel:to>
>
> </bpel:copy>
>
> <bpel:copy>
>
> <bpel:from>$auxItem</bpel:from>
>
> <bpel:to>$result/items/item[$numItems]</bpel:to>
>
> </bpel:copy>
>
> <bpel:copy>
>
> <bpel:from>>$numItems + 1</bpel:from>
>
> <bpel:to>$numItems</bpel:to>
>
> </bpel:copy>
>
> <bpel:copy>
>
> <bpel:from>
>
> <bpel:literal>
>
> <item>
>
> <param1>value3</param1>
>
> <param2>value4</param2>
>
> </item>
>
> </bpel:literal>
>
> </bpel:from>
>
> <bpel:to>$auxItem</bpel:to>
>
> </bpel:copy>
>
> <bpel:copy>
>
> <bpel:from>$auxItem</bpel:from>
>
> <bpel:to>$result/items/item[$numItems]</bpel:to>
>
> </bpel:copy>
>
> </bpel:assign>
>
> </bpel:sequence>
>
>
>
> But whit this ODE construct
>
> <consultaReturn>
>
> <items>
>
> <item>
>
> <param1>value3</param1>
>
> <param2>value4</param2>
>
> </item>
>
> </items>
>
> </consultaReturn>
>
>
>
> What is the problem? Anybody know work with unbounded elements?
>
>
>
> Thanks
>
>
>
>
>
>
>
>
>
>
>
>