ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tammo van Lessen <tvanles...@gmail.com>
Subject Re: Set value of a boolean variable
Date Wed, 04 Jan 2012 09:37:10 GMT
After rechecking the code, I see these two options:

"the right way" is IMO to use XPath:

<copy>
  <from>true()</from>
  <to>$myvar</to>
</copy>

I think this leads to cleaner, more self descriptive BPEL code. The
downside of this is: The standard Saxon (I'm talking about the XPath 2.0
processor now) is not schema aware. When using a a plain xs:boolean
variable, ODE can determine the type of the variable based on its
definition and everything is fine. If the Boolean is, however, just a
field in a more complex message, it is impossible for ODE to determine
the type of this field and will return just a string ('true' or
'false'). This needs to be kept in mind for condition checks (not for
assignments).

"the fastest way" is probably to use literal strings as this would
bypass some XPath evaluations, which turn out to be rather expensive. A
possible pitfall with condition checks in this case: If we have assigned
a literal string ('true') to a xs:boolean variable and use it in an
XPath expression, it is automatically translated to XPath's true(), so
it should either be casted to string or compared to true()/false() as
well instead of 'true'/'false'.

HTH,
  Tammo

On 04.01.2012 10:15, Waruna Ranasinghe wrote:
> Hi all,
> 
> What do you think, the most efficient way to set a value of a boolean
> variable.
> There are two options,
> 
>    1. use literal value "true" or "false"
>    2. use XPath function "true()" or "false()"
> 
> Thanks,
> Waruna

-- 
Tammo van Lessen - http://www.taval.de

Mime
View raw message