Initializing a variable with an XML literal
During the initialization phase, the variable receives its initial XML content. This content can be subject to various manipulations during the BPEL process flow. We are able to instantly assign the content of the variable if the source of the data already exists. This recipe explains how to initialize a variable with the XML content.
Getting ready
We create a new synchronous BPEL process (VarInit.bpel
). We modify the request and response messages. The request message has the following schema:
<element name = "process"> <complexType> <sequence> <element name = "name" type = "string"/> <element name = "birthYear" type = "int"/> </sequence> </complexType> </element>
We need to provide the name and year of birth when starting the BPEL process instance. Similarly, we change the response message schema as follows:
<element name = "processResponse"> <complexType> <...