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" <dj...@ugs.com> on 2007/01/25 18:52:42 UTC

getVariableData question

The BPEL 1.1 spec says the following:

"When only the first argument is present, the function extracts the
value of the variable, which in this case must be defined using an XML
Schema simple type or element. Otherwise, the return value of this
function is a node set containing the single node representing either an
entire part of a message type(if the second argument is present and the
third argument is absent) or the result of the selection based on the
locationPath (if both optional arguments are present). If the given
locationPath selects a node set of a size other than one during
execution, then the standard fault bpws:selectionFailure MUST be thrown
by a compliant implementation."

How can you then write BPEL code to determine the count of nodes such
as:
    <from expression="count(bpelx:getVariableData(some-req-msg',
some-part', /xxx:request/yyy:id'))"/>
    <to variable="count">

If there were no "yyy:id" or more than 1 then the getVariableData would
seem
to have to throw a SelectionFailure.

Thanks in advance!
-Doug.


Re: getVariableData question

Posted by Assaf Arkin <ar...@intalio.com>.
On 1/25/07, Jackson, Douglas <dj...@ugs.com> wrote:
>
> The BPEL 1.1 spec says the following:
>
> "When only the first argument is present, the function extracts the
> value of the variable, which in this case must be defined using an XML
> Schema simple type or element. Otherwise, the return value of this
> function is a node set containing the single node representing either an
> entire part of a message type(if the second argument is present and the
> third argument is absent) or the result of the selection based on the
> locationPath (if both optional arguments are present). If the given
> locationPath selects a node set of a size other than one during
> execution, then the standard fault bpws:selectionFailure MUST be thrown
> by a compliant implementation."
>
> How can you then write BPEL code to determine the count of nodes such
> as:
>     <from expression="count(bpelx:getVariableData(some-req-msg',
> some-part', /xxx:request/yyy:id'))"/>
>     <to variable="count">
>
> If there were no "yyy:id" or more than 1 then the getVariableData would
> seem
> to have to throw a SelectionFailure.


The XPath expression can always select the yyy:id elements from the message
part returned by getVariableData:

count(bpelx:getVariableData(some-req-msg', 'some-part')/xxx:request/yyy:id)

Assaf

Thanks in advance!
> -Doug.
>
>


-- 
CTO, Intalio
http://www.intalio.com