ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josef Bajada" <Josef.Baj...@go.com.mt>
Subject RE: Date manipulation functions in BPEL
Date Wed, 11 Aug 2010 14:55:31 GMT
Thanks Rafan.

It seems such an overkill to need to have a separate XSL style-sheet just to format a date
variable to a string. 
Maybe there is a simpler way?

Regards,
Josef



-----Original Message-----
From: Rafal Rusin [mailto:rafal@intalio.com] 
Sent: 11 August 2010 15:05
To: user@ode.apache.org
Subject: Re: Date manipulation functions in BPEL

Hello,

On Wed, Aug 11, 2010 at 1:56 PM, Josef Bajada <Josef.Bajada@go.com.mt> wrote:
> Hi Rafal,
>
> Thanks for your feedback. I had forgot to include the xmlns:xsd namespace. It worked
like a charm now.
>
> Any idea about how to use XSLT functions? I would like to use the format-dateTime() but
I can't find how to use it directly.
>

I think the best way is to use XSLT transforms, since those XSLT
functions require XSLT context in Saxon.
This should help:
https://svn.apache.org/repos/asf/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestXslTransform/

> Thanks,
>
> Josef
>
>
>
>
>
> -----Original Message-----
> From: Rafal Rusin [mailto:rafal@intalio.com]
> Sent: 11 August 2010 13:43
> To: user@ode.apache.org
> Subject: Re: Date manipulation functions in BPEL
>
> On Wed, Aug 11, 2010 at 12:58 PM, Josef Bajada <Josef.Bajada@go.com.mt> wrote:
>> I am trying to use ODE for some simple BPEL proof-of-concepts and I have
>> stumbled upon some difficulties to manipulate dates and times.
>>
>> I have managed to call current-dateTime() through XPath 2.0 as follows:
>>
>>
>>
>>                <bpel:from part="payload" variable="output">
>>
>>                    <bpel:query
>> queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[
>> current-dateTime()]]></bpel:query>
>>
>>                </bpel:from>
>>
>>
>>
>> However, I haven't managed to perform a simple addition like this:
>>
>>
>>
>>                <bpel:from part="payload" variable="output">
>>
>>                    <bpel:query
>> queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[
>> current-dateTime() + xs:dayTimeDuration('P1D')]]></bpel:query>
>>
>>                </bpel:from>
>
> Such thing worked for me:
>
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>            <bpws:copy>
>                <bpws:from
> expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[current-dateTime()
> + xsd:dayTimeDuration('P1D')]]></bpws:from>
>                <bpws:to><![CDATA[$response.body/hello:text]]></bpws:to>
>            </bpws:copy>
>
> Please try to make it pass first.
>
>>
>>
>>
>>
>> I also don't have any idea how to call an XSLT function such as
>> format-dateTime().
>>
>>
>>
>> I wish to do something like the following, but I have no idea how to do
>> it in BPEL. When I try the following I get an error saying that I cannot
>> use format-dateTime() in a non-XSLT context:
>>
>>
>>
>> format-dateTime(current-dateTime(), "Y-M-D H:m:s"))
>>
>>
>>
>> thanks,
>>
>> Josef
>>
>>
>
>
>
> --
> Regards,
> Rafał Rusin
> http://rrusin.blogspot.com
>



-- 
Regards,
Rafał Rusin
http://rrusin.blogspot.com
Mime
View raw message