How to Assign a Date or Time
The following example shows an example that uses the function getCurrentDate in BPEL 1.1.
<!-- execute the XPath extension function getCurrentDate() -->
<assign>
<copy>
<from expression="xpath20:getCurrentDate()"/>
<to variable="output" part="payload"
query="ns1:invoice/invoiceDate"/>
</copy>
</assign>
The following example shows an example that uses the function getCurrentDate in BPEL 2.0.
<assign>
<copy>
<from>xpath20:getCurrentDate()</from>
<to>$output.payload/invoiceDate</to>
</copy>
</assign>
In the following example, the formatDate function converts the date-time value provided in XSD format to the string 'Jun 10, 2005' (and assigns it to the string field formattedDate).
<!-- execute the XPath extension function formatDate() -->
<assign>
<copy>
<from expression="ora:formatDate('2005-06-10T15:56:00',
'MMM dd, yyyy')"/>
<to variable="output" part="payload"
query="ns1:invoice/formattedDate"/>
</copy>
</assign>
The following example shows how the formatDate function works in BPEL 2.0.
<assign>
<copy>
<from>ora:formatDate('2005-06-10T15:56:00','MMM dd, yyyy')</from>
<to>$output.payload/formattedDate</to>
</copy>
</assign>