You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by "Jackson, Douglas" <do...@siemens.com> on 2009/02/03 19:15:53 UTC

RE: BPEL assignment question

Hi!
I have not been able to get the xquery stuff to work.  I created an extremely simple BPEL to test it.  I am attaching a zip file with all
of the files from the process.  I would appreciate it if someone could
tell me where I am going wrong.  (The commented out from clause works)
The process throws an Uninitialized variable for me.  I built the ode from the trunk.  I also built off the 1.2 branch with the same results.  What is the minimum version of Ode in which this would work?
Thanks in advance!
-Doug.

-----Original Message-----
From: Ford, Mark [mailto:mark.ford@ll.mit.edu] 
Sent: Monday, January 26, 2009 8:00 AM
To: user@ode.apache.org
Subject: Re: BPEL assignment question

My guess is that you need to wrap the expression within a CDATA or escape the XML.


On 1/24/09 6:52 PM, "Jackson, Douglas" <do...@siemens.com> wrote:

Hi!
I do get some warnings that I cannot explain at bpel compile time - I set the expressionLanguage="...xquery1.0" on the process node and on the <from> node:
WARN - GeronimoLog.warn(92) | Unrecognized element in BPEL dom: {http://xxx/yyy}c-info

WARN - GeronimoLog.warn(92) | null:449: warning: [XPath20Syntax] The string "
          " is not a valid XPath 2.0 expression: empty string

WARN - GeronimoLog.warn(92) | Unrecognized element in BPEL dom: {http://xxx/yyy}a-request
-Doug.

-----Original Message-----
From: Jackson, Douglas [mailto:douglas.s.jackson@siemens.com]
Sent: Saturday, January 24, 2009 12:06 PM
To: user@ode.apache.org
Subject: RE: BPEL assignment question

Hi!
Thank you Karthick and Mark for your responses!

I followed your advice, but now the variable that I am assigning the XQuery value to says it is uninitialized when I refer to it in another copy just after the copy that set the variable.  There are no errors from the XQuery or BPEL prior to referring to the variable in the subsequent copy.  Is there anything I can do to figure out what is going wrong?
I am going to try to simplify the XQuery (removing variable references) to see if that makes any difference.

Any debugging advice would be appreciated.
Thanks!
-Doug.

-----Original Message-----
From: Karthick Sankarachary [mailto:sankarachary@intalio.com]
Sent: Friday, January 23, 2009 3:27 PM
To: user@ode.apache.org
Subject: Re: BPEL assignment question

Douglas,

I couldn't agree more with Mark's recommendation to use XQuery for
constructing XML nodes, whether it be an element, attribute or what have
you. And, yes that feature has been pretty well tested.

For more details, please refer to the
constructors<http://www.w3.org/TR/xquery/#id-constructors>section in
the XQuery spec. It lets you not only write static XML fragments,
but also build dynamic XML fragments on the fly.

Regards,
Karthick

On 1/23/09, Ford, Mark <ma...@ll.mit.edu> wrote:
>
> You should look at XQuery for this use case. I haven't tested with ODE yet
> but I saw a post from a while back that the trunk supports XQuery with the
> following namespace:
>
> urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0
>
> Your example below would look like this in XQuery:
>
> <from expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0">
>
>    <c-info xmlns="http://xxx/yyy">
>
>       <c-id>{$unique-id}</c-id>
>       <client-id>{$client-id}</client-id>
>       (: other elements go here :)
>    </c-info>
> </from>
>
> The text between the curly braces is executable and will produce the
> results you're looking for. This is a very simple example of a literal style
> XQuery expression. I find this a much better way of constructing elements.
> Often times you can collapse many different copy operations into a single
> operation which greatly simplifies the coding and maintenance of the
> process.
>
>
>
> On 1/23/09 2:16 PM, "Jackson, Douglas" <do...@siemens.com>
> wrote:
>
> Hi!
> I am trying to create a complex element in an assignment without first
> creating a literal element and subsequently filling in values.
>
> I tried an assignment like the following:
>
>         <from>concat('&lt;c-info xmlns="http://xxx/yyy"&gt;',
>                     '&lt;c-id&gt;', $unique-id, '&lt;/c-id&gt;',
>                     '&lt;client-id&gt;', $client-id, '&lt;/client-id&gt;',
>                     '&lt;type&gt;', 'Type', '&lt;/type&gt;',
>                     '&lt;owner&gt;',
> $req-msg.req-part/p:r-info/p:user-name, '&lt;/owner&gt;',
>                     '&lt;group&gt;',
>                          $req-msg.req-part/p:r-info/p:group,
>                     '&lt;/group&gt;',
>                   '&lt;/process-info&gt;')</from>
>
> But Ode interpreted it as:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <c-info xmlns="http://xxx/yyy">&lt;c-info xmlns="http://xxx/yyy
> "&gt;&lt;c-id&gt;1232736236359-63&lt;/c-id&gt;&lt;client-id&gt;cmid&lt;/client-id&gt;&lt;type&gt;Type&lt;/type&gt;&lt;owner&gt;fred&lt;/owner&gt;&lt;group&gt;cgroup&lt;/group&gt;&lt;/c-info&gt;</c-info>
> This would expand to a lot of code with literal + replacement...
>
> I guess I could write an extension function that would convert the string
> to a node...
>
> Ode could add a new form of <from> like <literal-with-replacement> that
> allowed the variables to be substituted. :)
> -Doug.
>
>
>
>


--
Best Regards,
Karthick Sankarachary


Re: BPEL assignment question

Posted by Alex Boisvert <bo...@intalio.com>.
XQuery should work on both 1.x branch and trunk.  We've recently added some
documentation at
http://cwiki.apache.org/confluence/display/ODExSITE/XQuery+Extensions

If you have test case that fails, please open a Jira issue and we'll take a
look at it.

alex


On Tue, Feb 3, 2009 at 10:33 AM, Ford, Mark <ma...@ll.mit.edu> wrote:

> I went through this exercise a week or so ago and wasn't able to get Xquery
> working off of the 2.0 trunk (Build 87). I don't know when Xquery support
> was added, but I'm reasonably sure that you have to use the 2.0 trunk.
>
> Don't start with your own simple process. Instead, look at the Xquery test
> cases that ODE has and see if you can get those to run. If you can, then
> follow those examples. I couldn't get them to work but I haven't followed up
> with the latest build or filed a bug report. The errors I had were on
> deployment - some bogus message about an attempt to reference an undeclared
> variable.
>
> Here's the link I got last time I asked:
>
> http://tinyurl.com/aj6d7d
>
>
>
> On 2/3/09 1:15 PM, "Jackson, Douglas" <do...@siemens.com>
> wrote:
>
> Hi!
> I have not been able to get the xquery stuff to work.  I created an
> extremely simple BPEL to test it.  I am attaching a zip file with all
> of the files from the process.  I would appreciate it if someone could
> tell me where I am going wrong.  (The commented out from clause works)
> The process throws an Uninitialized variable for me.  I built the ode from
> the trunk.  I also built off the 1.2 branch with the same results.  What is
> the minimum version of Ode in which this would work?
> Thanks in advance!
> -Doug.
>
> -----Original Message-----
> From: Ford, Mark [mailto:mark.ford@ll.mit.edu]
> Sent: Monday, January 26, 2009 8:00 AM
> To: user@ode.apache.org
> Subject: Re: BPEL assignment question
>
> My guess is that you need to wrap the expression within a CDATA or escape
> the XML.
>
>
> On 1/24/09 6:52 PM, "Jackson, Douglas" <do...@siemens.com>
> wrote:
>
> Hi!
> I do get some warnings that I cannot explain at bpel compile time - I set
> the expressionLanguage="...xquery1.0" on the process node and on the <from>
> node:
> WARN - GeronimoLog.warn(92) | Unrecognized element in BPEL dom: {
> http://xxx/yyy}c-info <http://xxx/yyy%7Dc-info>
>
> WARN - GeronimoLog.warn(92) | null:449: warning: [XPath20Syntax] The string
> "
>          " is not a valid XPath 2.0 expression: empty string
>
> WARN - GeronimoLog.warn(92) | Unrecognized element in BPEL dom: {
> http://xxx/yyy}a-request
> -Doug <http://xxx/yyy%7Da-request%0A-Doug>.
>
> -----Original Message-----
> From: Jackson, Douglas [mailto:douglas.s.jackson@siemens.com]
> Sent: Saturday, January 24, 2009 12:06 PM
> To: user@ode.apache.org
> Subject: RE: BPEL assignment question
>
> Hi!
> Thank you Karthick and Mark for your responses!
>
> I followed your advice, but now the variable that I am assigning the XQuery
> value to says it is uninitialized when I refer to it in another copy just
> after the copy that set the variable.  There are no errors from the XQuery
> or BPEL prior to referring to the variable in the subsequent copy.  Is there
> anything I can do to figure out what is going wrong?
> I am going to try to simplify the XQuery (removing variable references) to
> see if that makes any difference.
>
> Any debugging advice would be appreciated.
> Thanks!
> -Doug.
>
> -----Original Message-----
> From: Karthick Sankarachary [mailto:sankarachary@intalio.com]
> Sent: Friday, January 23, 2009 3:27 PM
> To: user@ode.apache.org
> Subject: Re: BPEL assignment question
>
> Douglas,
>
> I couldn't agree more with Mark's recommendation to use XQuery for
> constructing XML nodes, whether it be an element, attribute or what have
> you. And, yes that feature has been pretty well tested.
>
> For more details, please refer to the
> constructors<http://www.w3.org/TR/xquery/#id-constructors>section in
> the XQuery spec. It lets you not only write static XML fragments,
> but also build dynamic XML fragments on the fly.
>
> Regards,
> Karthick
>
> On 1/23/09, Ford, Mark <ma...@ll.mit.edu> wrote:
> >
> > You should look at XQuery for this use case. I haven't tested with ODE
> yet
> > but I saw a post from a while back that the trunk supports XQuery with
> the
> > following namespace:
> >
> > urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0
> >
> > Your example below would look like this in XQuery:
> >
> > <from
> expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0">
> >
> >    <c-info xmlns="http://xxx/yyy">
> >
> >       <c-id>{$unique-id}</c-id>
> >       <client-id>{$client-id}</client-id>
> >       (: other elements go here :)
> >    </c-info>
> > </from>
> >
> > The text between the curly braces is executable and will produce the
> > results you're looking for. This is a very simple example of a literal
> style
> > XQuery expression. I find this a much better way of constructing
> elements.
> > Often times you can collapse many different copy operations into a single
> > operation which greatly simplifies the coding and maintenance of the
> > process.
> >
> >
> >
> > On 1/23/09 2:16 PM, "Jackson, Douglas" <do...@siemens.com>
> > wrote:
> >
> > Hi!
> > I am trying to create a complex element in an assignment without first
> > creating a literal element and subsequently filling in values.
> >
> > I tried an assignment like the following:
> >
> >         <from>concat('&lt;c-info xmlns="http://xxx/yyy"&gt;',
> >                     '&lt;c-id&gt;', $unique-id, '&lt;/c-id&gt;',
> >                     '&lt;client-id&gt;', $client-id,
> '&lt;/client-id&gt;',
> >                     '&lt;type&gt;', 'Type', '&lt;/type&gt;',
> >                     '&lt;owner&gt;',
> > $req-msg.req-part/p:r-info/p:user-name, '&lt;/owner&gt;',
> >                     '&lt;group&gt;',
> >                          $req-msg.req-part/p:r-info/p:group,
> >                     '&lt;/group&gt;',
> >                   '&lt;/process-info&gt;')</from>
> >
> > But Ode interpreted it as:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <c-info xmlns="http://xxx/yyy">&lt;c-info xmlns="http://xxx/yyy
> >
> "&gt;&lt;c-id&gt;1232736236359-63&lt;/c-id&gt;&lt;client-id&gt;cmid&lt;/client-id&gt;&lt;type&gt;Type&lt;/type&gt;&lt;owner&gt;fred&lt;/owner&gt;&lt;group&gt;cgroup&lt;/group&gt;&lt;/c-info&gt;</c-info>
> > This would expand to a lot of code with literal + replacement...
> >
> > I guess I could write an extension function that would convert the string
> > to a node...
> >
> > Ode could add a new form of <from> like <literal-with-replacement> that
> > allowed the variables to be substituted. :)
> > -Doug.
> >
> >
> >
> >
>
>
> --
> Best Regards,
> Karthick Sankarachary
>
>
>
>
>
> --
> Mark Ford
> MIT Lincoln Laboratory
> 244 Wood Street
> Lexington MA 02420
> (781) 981-1843
>

Re: BPEL assignment question

Posted by Karthick Sankarachary <sa...@intalio.com>.
Douglas,

False alarm, we actually do support the use of the expressionLanguage
attribute across the board.

The bad news is that, under certain circumstances, we neglected to (a)
correctly bind the variables used in the context of the XQuery expression
and (b) make sure that the XQuery result has an owner document.

The good news is that these issues have now been resolved in the 1.X branch
as well as the trunk (please refer to revisions 740551 and 740569
respectively).

Let me know if you have questions.

Regards,
Karthick

On 2/3/09, Karthick Sankarachary <sa...@intalio.com> wrote:
>
> Douglas,
>
> Sorry, this is my bad. It turns out that we blissfully ignore the
> expression language attribute in the source ('from-spec") of the <copy>
> element (shown in the "from-spec" variant below).
>
> <from expressionLanguage="anyURI"?>expression</from>
>
> For now, at least until I resolve the problem, please set the
> expressionLanguage attribute globally on the <process> element.
>
> Best Regards,
> Karthick Sankarachary
>
>
> On Tue, Feb 3, 2009 at 10:15 AM, Jackson, Douglas <
> douglas.s.jackson@siemens.com> wrote:
>
>> Hi!
>> I have not been able to get the xquery stuff to work.  I created an
>> extremely simple BPEL to test it.  I am attaching a zip file with all
>> of the files from the process.  I would appreciate it if someone could
>> tell me where I am going wrong.  (The commented out from clause works)
>> The process throws an Uninitialized variable for me.  I built the ode from
>> the trunk.  I also built off the 1.2 branch with the same results.  What is
>> the minimum version of Ode in which this would work?
>> Thanks in advance!
>> -Doug.
>>
>> -----Original Message-----
>> From: Ford, Mark [mailto:mark.ford@ll.mit.edu]
>> Sent: Monday, January 26, 2009 8:00 AM
>> To: user@ode.apache.org
>> Subject: Re: BPEL assignment question
>>
>> My guess is that you need to wrap the expression within a CDATA or escape
>> the XML.
>>
>>
>> On 1/24/09 6:52 PM, "Jackson, Douglas" <do...@siemens.com>
>> wrote:
>>
>> Hi!
>> I do get some warnings that I cannot explain at bpel compile time - I set
>> the expressionLanguage="...xquery1.0" on the process node and on the <from>
>> node:
>> WARN - GeronimoLog.warn(92) | Unrecognized element in BPEL dom: {
>> http://xxx/yyy}c-info <http://xxx/yyy%7Dc-info>
>>
>> WARN - GeronimoLog.warn(92) | null:449: warning: [XPath20Syntax] The
>> string "
>>          " is not a valid XPath 2.0 expression: empty string
>>
>> WARN - GeronimoLog.warn(92) | Unrecognized element in BPEL dom: {
>> http://xxx/yyy}a-request
>> -Doug <http://xxx/yyy%7Da-request%0A-Doug>.
>>
>> -----Original Message-----
>> From: Jackson, Douglas [mailto:douglas.s.jackson@siemens.com]
>> Sent: Saturday, January 24, 2009 12:06 PM
>> To: user@ode.apache.org
>> Subject: RE: BPEL assignment question
>>
>> Hi!
>> Thank you Karthick and Mark for your responses!
>>
>> I followed your advice, but now the variable that I am assigning the
>> XQuery value to says it is uninitialized when I refer to it in another copy
>> just after the copy that set the variable.  There are no errors from the
>> XQuery or BPEL prior to referring to the variable in the subsequent copy.
>>  Is there anything I can do to figure out what is going wrong?
>> I am going to try to simplify the XQuery (removing variable references) to
>> see if that makes any difference.
>>
>> Any debugging advice would be appreciated.
>> Thanks!
>> -Doug.
>>
>> -----Original Message-----
>> From: Karthick Sankarachary [mailto:sankarachary@intalio.com]
>> Sent: Friday, January 23, 2009 3:27 PM
>> To: user@ode.apache.org
>> Subject: Re: BPEL assignment question
>>
>> Douglas,
>>
>> I couldn't agree more with Mark's recommendation to use XQuery for
>> constructing XML nodes, whether it be an element, attribute or what have
>> you. And, yes that feature has been pretty well tested.
>>
>> For more details, please refer to the
>> constructors<http://www.w3.org/TR/xquery/#id-constructors>section in
>> the XQuery spec. It lets you not only write static XML fragments,
>> but also build dynamic XML fragments on the fly.
>>
>> Regards,
>> Karthick
>>
>> On 1/23/09, Ford, Mark <ma...@ll.mit.edu> wrote:
>> >
>> > You should look at XQuery for this use case. I haven't tested with ODE
>> yet
>> > but I saw a post from a while back that the trunk supports XQuery with
>> the
>> > following namespace:
>> >
>> > urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0
>> >
>> > Your example below would look like this in XQuery:
>> >
>> > <from
>> expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0">
>> >
>> >    <c-info xmlns="http://xxx/yyy">
>> >
>> >       <c-id>{$unique-id}</c-id>
>> >       <client-id>{$client-id}</client-id>
>> >       (: other elements go here :)
>> >    </c-info>
>> > </from>
>> >
>> > The text between the curly braces is executable and will produce the
>> > results you're looking for. This is a very simple example of a literal
>> style
>> > XQuery expression. I find this a much better way of constructing
>> elements.
>> > Often times you can collapse many different copy operations into a
>> single
>> > operation which greatly simplifies the coding and maintenance of the
>> > process.
>> >
>> >
>> >
>> > On 1/23/09 2:16 PM, "Jackson, Douglas" <do...@siemens.com>
>> > wrote:
>> >
>> > Hi!
>> > I am trying to create a complex element in an assignment without first
>> > creating a literal element and subsequently filling in values.
>> >
>> > I tried an assignment like the following:
>> >
>> >         <from>concat('&lt;c-info xmlns="http://xxx/yyy"&gt;',
>> >                     '&lt;c-id&gt;', $unique-id, '&lt;/c-id&gt;',
>> >                     '&lt;client-id&gt;', $client-id,
>> '&lt;/client-id&gt;',
>> >                     '&lt;type&gt;', 'Type', '&lt;/type&gt;',
>> >                     '&lt;owner&gt;',
>> > $req-msg.req-part/p:r-info/p:user-name, '&lt;/owner&gt;',
>> >                     '&lt;group&gt;',
>> >                          $req-msg.req-part/p:r-info/p:group,
>> >                     '&lt;/group&gt;',
>> >                   '&lt;/process-info&gt;')</from>
>> >
>> > But Ode interpreted it as:
>> >
>> > <?xml version="1.0" encoding="UTF-8"?>
>> > <c-info xmlns="http://xxx/yyy">&lt;c-info xmlns="http://xxx/yyy
>> >
>> "&gt;&lt;c-id&gt;1232736236359-63&lt;/c-id&gt;&lt;client-id&gt;cmid&lt;/client-id&gt;&lt;type&gt;Type&lt;/type&gt;&lt;owner&gt;fred&lt;/owner&gt;&lt;group&gt;cgroup&lt;/group&gt;&lt;/c-info&gt;</c-info>
>> > This would expand to a lot of code with literal + replacement...
>> >
>> > I guess I could write an extension function that would convert the
>> string
>> > to a node...
>> >
>> > Ode could add a new form of <from> like <literal-with-replacement> that
>> > allowed the variables to be substituted. :)
>> > -Doug.
>> >
>> >
>> >
>> >
>>
>>
>> --
>> Best Regards,
>> Karthick Sankarachary
>>
>>
>


-- 
Best Regards,
Karthick Sankarachary

Re: BPEL assignment question

Posted by Karthick Sankarachary <sa...@intalio.com>.
Douglas,

Sorry, this is my bad. It turns out that we blissfully ignore the expression
language attribute in the source ('from-spec") of the <copy> element (shown
in the "from-spec" variant below).

<from expressionLanguage="anyURI"?>expression</from>

For now, at least until I resolve the problem, please set the
expressionLanguage attribute globally on the <process> element.

Best Regards,
Karthick Sankarachary


On Tue, Feb 3, 2009 at 10:15 AM, Jackson, Douglas <
douglas.s.jackson@siemens.com> wrote:

> Hi!
> I have not been able to get the xquery stuff to work.  I created an
> extremely simple BPEL to test it.  I am attaching a zip file with all
> of the files from the process.  I would appreciate it if someone could
> tell me where I am going wrong.  (The commented out from clause works)
> The process throws an Uninitialized variable for me.  I built the ode from
> the trunk.  I also built off the 1.2 branch with the same results.  What is
> the minimum version of Ode in which this would work?
> Thanks in advance!
> -Doug.
>
> -----Original Message-----
> From: Ford, Mark [mailto:mark.ford@ll.mit.edu]
> Sent: Monday, January 26, 2009 8:00 AM
> To: user@ode.apache.org
> Subject: Re: BPEL assignment question
>
> My guess is that you need to wrap the expression within a CDATA or escape
> the XML.
>
>
> On 1/24/09 6:52 PM, "Jackson, Douglas" <do...@siemens.com>
> wrote:
>
> Hi!
> I do get some warnings that I cannot explain at bpel compile time - I set
> the expressionLanguage="...xquery1.0" on the process node and on the <from>
> node:
> WARN - GeronimoLog.warn(92) | Unrecognized element in BPEL dom: {
> http://xxx/yyy}c-info <http://xxx/yyy%7Dc-info>
>
> WARN - GeronimoLog.warn(92) | null:449: warning: [XPath20Syntax] The string
> "
>          " is not a valid XPath 2.0 expression: empty string
>
> WARN - GeronimoLog.warn(92) | Unrecognized element in BPEL dom: {
> http://xxx/yyy}a-request
> -Doug <http://xxx/yyy%7Da-request%0A-Doug>.
>
> -----Original Message-----
> From: Jackson, Douglas [mailto:douglas.s.jackson@siemens.com]
> Sent: Saturday, January 24, 2009 12:06 PM
> To: user@ode.apache.org
> Subject: RE: BPEL assignment question
>
> Hi!
> Thank you Karthick and Mark for your responses!
>
> I followed your advice, but now the variable that I am assigning the XQuery
> value to says it is uninitialized when I refer to it in another copy just
> after the copy that set the variable.  There are no errors from the XQuery
> or BPEL prior to referring to the variable in the subsequent copy.  Is there
> anything I can do to figure out what is going wrong?
> I am going to try to simplify the XQuery (removing variable references) to
> see if that makes any difference.
>
> Any debugging advice would be appreciated.
> Thanks!
> -Doug.
>
> -----Original Message-----
> From: Karthick Sankarachary [mailto:sankarachary@intalio.com]
> Sent: Friday, January 23, 2009 3:27 PM
> To: user@ode.apache.org
> Subject: Re: BPEL assignment question
>
> Douglas,
>
> I couldn't agree more with Mark's recommendation to use XQuery for
> constructing XML nodes, whether it be an element, attribute or what have
> you. And, yes that feature has been pretty well tested.
>
> For more details, please refer to the
> constructors<http://www.w3.org/TR/xquery/#id-constructors>section in
> the XQuery spec. It lets you not only write static XML fragments,
> but also build dynamic XML fragments on the fly.
>
> Regards,
> Karthick
>
> On 1/23/09, Ford, Mark <ma...@ll.mit.edu> wrote:
> >
> > You should look at XQuery for this use case. I haven't tested with ODE
> yet
> > but I saw a post from a while back that the trunk supports XQuery with
> the
> > following namespace:
> >
> > urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0
> >
> > Your example below would look like this in XQuery:
> >
> > <from
> expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0">
> >
> >    <c-info xmlns="http://xxx/yyy">
> >
> >       <c-id>{$unique-id}</c-id>
> >       <client-id>{$client-id}</client-id>
> >       (: other elements go here :)
> >    </c-info>
> > </from>
> >
> > The text between the curly braces is executable and will produce the
> > results you're looking for. This is a very simple example of a literal
> style
> > XQuery expression. I find this a much better way of constructing
> elements.
> > Often times you can collapse many different copy operations into a single
> > operation which greatly simplifies the coding and maintenance of the
> > process.
> >
> >
> >
> > On 1/23/09 2:16 PM, "Jackson, Douglas" <do...@siemens.com>
> > wrote:
> >
> > Hi!
> > I am trying to create a complex element in an assignment without first
> > creating a literal element and subsequently filling in values.
> >
> > I tried an assignment like the following:
> >
> >         <from>concat('&lt;c-info xmlns="http://xxx/yyy"&gt;',
> >                     '&lt;c-id&gt;', $unique-id, '&lt;/c-id&gt;',
> >                     '&lt;client-id&gt;', $client-id,
> '&lt;/client-id&gt;',
> >                     '&lt;type&gt;', 'Type', '&lt;/type&gt;',
> >                     '&lt;owner&gt;',
> > $req-msg.req-part/p:r-info/p:user-name, '&lt;/owner&gt;',
> >                     '&lt;group&gt;',
> >                          $req-msg.req-part/p:r-info/p:group,
> >                     '&lt;/group&gt;',
> >                   '&lt;/process-info&gt;')</from>
> >
> > But Ode interpreted it as:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <c-info xmlns="http://xxx/yyy">&lt;c-info xmlns="http://xxx/yyy
> >
> "&gt;&lt;c-id&gt;1232736236359-63&lt;/c-id&gt;&lt;client-id&gt;cmid&lt;/client-id&gt;&lt;type&gt;Type&lt;/type&gt;&lt;owner&gt;fred&lt;/owner&gt;&lt;group&gt;cgroup&lt;/group&gt;&lt;/c-info&gt;</c-info>
> > This would expand to a lot of code with literal + replacement...
> >
> > I guess I could write an extension function that would convert the string
> > to a node...
> >
> > Ode could add a new form of <from> like <literal-with-replacement> that
> > allowed the variables to be substituted. :)
> > -Doug.
> >
> >
> >
> >
>
>
> --
> Best Regards,
> Karthick Sankarachary
>
>

Re: BPEL assignment question

Posted by "Ford, Mark" <ma...@ll.mit.edu>.
I went through this exercise a week or so ago and wasn't able to get Xquery working off of the 2.0 trunk (Build 87). I don't know when Xquery support was added, but I'm reasonably sure that you have to use the 2.0 trunk.

Don't start with your own simple process. Instead, look at the Xquery test cases that ODE has and see if you can get those to run. If you can, then follow those examples. I couldn't get them to work but I haven't followed up with the latest build or filed a bug report. The errors I had were on deployment - some bogus message about an attempt to reference an undeclared variable.

Here's the link I got last time I asked:

http://tinyurl.com/aj6d7d



On 2/3/09 1:15 PM, "Jackson, Douglas" <do...@siemens.com> wrote:

Hi!
I have not been able to get the xquery stuff to work.  I created an extremely simple BPEL to test it.  I am attaching a zip file with all
of the files from the process.  I would appreciate it if someone could
tell me where I am going wrong.  (The commented out from clause works)
The process throws an Uninitialized variable for me.  I built the ode from the trunk.  I also built off the 1.2 branch with the same results.  What is the minimum version of Ode in which this would work?
Thanks in advance!
-Doug.

-----Original Message-----
From: Ford, Mark [mailto:mark.ford@ll.mit.edu]
Sent: Monday, January 26, 2009 8:00 AM
To: user@ode.apache.org
Subject: Re: BPEL assignment question

My guess is that you need to wrap the expression within a CDATA or escape the XML.


On 1/24/09 6:52 PM, "Jackson, Douglas" <do...@siemens.com> wrote:

Hi!
I do get some warnings that I cannot explain at bpel compile time - I set the expressionLanguage="...xquery1.0" on the process node and on the <from> node:
WARN - GeronimoLog.warn(92) | Unrecognized element in BPEL dom: {http://xxx/yyy}c-info

WARN - GeronimoLog.warn(92) | null:449: warning: [XPath20Syntax] The string "
          " is not a valid XPath 2.0 expression: empty string

WARN - GeronimoLog.warn(92) | Unrecognized element in BPEL dom: {http://xxx/yyy}a-request
-Doug.

-----Original Message-----
From: Jackson, Douglas [mailto:douglas.s.jackson@siemens.com]
Sent: Saturday, January 24, 2009 12:06 PM
To: user@ode.apache.org
Subject: RE: BPEL assignment question

Hi!
Thank you Karthick and Mark for your responses!

I followed your advice, but now the variable that I am assigning the XQuery value to says it is uninitialized when I refer to it in another copy just after the copy that set the variable.  There are no errors from the XQuery or BPEL prior to referring to the variable in the subsequent copy.  Is there anything I can do to figure out what is going wrong?
I am going to try to simplify the XQuery (removing variable references) to see if that makes any difference.

Any debugging advice would be appreciated.
Thanks!
-Doug.

-----Original Message-----
From: Karthick Sankarachary [mailto:sankarachary@intalio.com]
Sent: Friday, January 23, 2009 3:27 PM
To: user@ode.apache.org
Subject: Re: BPEL assignment question

Douglas,

I couldn't agree more with Mark's recommendation to use XQuery for
constructing XML nodes, whether it be an element, attribute or what have
you. And, yes that feature has been pretty well tested.

For more details, please refer to the
constructors<http://www.w3.org/TR/xquery/#id-constructors>section in
the XQuery spec. It lets you not only write static XML fragments,
but also build dynamic XML fragments on the fly.

Regards,
Karthick

On 1/23/09, Ford, Mark <ma...@ll.mit.edu> wrote:
>
> You should look at XQuery for this use case. I haven't tested with ODE yet
> but I saw a post from a while back that the trunk supports XQuery with the
> following namespace:
>
> urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0
>
> Your example below would look like this in XQuery:
>
> <from expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0">
>
>    <c-info xmlns="http://xxx/yyy">
>
>       <c-id>{$unique-id}</c-id>
>       <client-id>{$client-id}</client-id>
>       (: other elements go here :)
>    </c-info>
> </from>
>
> The text between the curly braces is executable and will produce the
> results you're looking for. This is a very simple example of a literal style
> XQuery expression. I find this a much better way of constructing elements.
> Often times you can collapse many different copy operations into a single
> operation which greatly simplifies the coding and maintenance of the
> process.
>
>
>
> On 1/23/09 2:16 PM, "Jackson, Douglas" <do...@siemens.com>
> wrote:
>
> Hi!
> I am trying to create a complex element in an assignment without first
> creating a literal element and subsequently filling in values.
>
> I tried an assignment like the following:
>
>         <from>concat('&lt;c-info xmlns="http://xxx/yyy"&gt;',
>                     '&lt;c-id&gt;', $unique-id, '&lt;/c-id&gt;',
>                     '&lt;client-id&gt;', $client-id, '&lt;/client-id&gt;',
>                     '&lt;type&gt;', 'Type', '&lt;/type&gt;',
>                     '&lt;owner&gt;',
> $req-msg.req-part/p:r-info/p:user-name, '&lt;/owner&gt;',
>                     '&lt;group&gt;',
>                          $req-msg.req-part/p:r-info/p:group,
>                     '&lt;/group&gt;',
>                   '&lt;/process-info&gt;')</from>
>
> But Ode interpreted it as:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <c-info xmlns="http://xxx/yyy">&lt;c-info xmlns="http://xxx/yyy
> "&gt;&lt;c-id&gt;1232736236359-63&lt;/c-id&gt;&lt;client-id&gt;cmid&lt;/client-id&gt;&lt;type&gt;Type&lt;/type&gt;&lt;owner&gt;fred&lt;/owner&gt;&lt;group&gt;cgroup&lt;/group&gt;&lt;/c-info&gt;</c-info>
> This would expand to a lot of code with literal + replacement...
>
> I guess I could write an extension function that would convert the string
> to a node...
>
> Ode could add a new form of <from> like <literal-with-replacement> that
> allowed the variables to be substituted. :)
> -Doug.
>
>
>
>


--
Best Regards,
Karthick Sankarachary





--
Mark Ford
MIT Lincoln Laboratory
244 Wood Street
Lexington MA 02420
(781) 981-1843