日付または時刻の割当て方法

次の例に、BPEL 1.1で関数getCurrentDateを使用する例を示します。

<!-- execute the XPath extension function getCurrentDate() -->
<assign>
   <copy>
      <from expression="xpath20:getCurrentDate()"/>
      <to variable="output" part="payload"
         query="ns1:invoice/invoiceDate"/>
   </copy>
</assign>

次の例に、BPEL 2.0で関数getCurrentDateを使用する例を示します。

<assign>
   <copy>
      <from>xpath20:getCurrentDate()</from>
      <to>$output.payload/invoiceDate</to>
   </copy>
</assign>

次の例では、XSD形式で指定された日時の値をformatDate関数が文字列'Jun 10, 2005'に変換し、文字列フィールド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>

次の例に、BPEL 2.0でのformatDate関数の動作を示します。

<assign>
   <copy>
      <from>ora:formatDate('2005-06-10T15:56:00','MMM dd, yyyy')</from>
      <to>$output.payload/formattedDate</to>
   </copy>
</assign>