Assigning date or time to the variables
BPEL enables many date and time operations. In this recipe, we explore how to manage date and time in BPEL processes.
Getting ready
We create an empty synchronous BPEL process (DateTime.bpel
) and adjust the request message to accept date and time. In DateTime.xsd
, we modify the process element as follows:
<element name = "process"> <complexType> <sequence> <element name = "input" type="dateTime"/> </sequence> </complexType> </element>
How to do it…
In the BPEL process, we define the variables that accept date and time as shown in the following screenshot:
Next, add the assign activity, where we define the copy rules as follows:
With the
xp20:current-date()
function, we assign the current date to theDateVar
variable.<copy> <from expression = "xp20:current-date()"/> <to variable = "DateVar"/> </copy>
With the
xp20:current-time()
function, we assign the current date to the...