Let's now create the described variables:
The declaration is rather simple. We have to provide the name and select the variable type. We have three choices: Type, Message Type, and Element. We select Type for the simple XML Schema types. We select Message Type for the WSDL MessageTypes
. We select Element for XML element variables.
BookstoreLocationWithLowestStockQuantity
variable. This variable will be of the type string
. We will enter the variable Name, select Type for the type, and use the magnifier glass icon to select a string
from XML Schema Simple Types:You can create the LowestQuantity
variable of the type int
yourself. We will use this variable to store the lowest book quantity in any of the bookstores. You can proceed the same way as in the previous example.
We have created two new variables, the BookstoreLocationWithLowestStockQuantity
variable and the LowestQuantity
variable. Let's look into the source code, where we should see the two new variables created, in addition to the six existing variables. From the source code tab, you can also see the BPEL syntax, if you wish to write the code directly:
Let's now declare an XML element variable. We will create a BookDataVariable
variable. This variable will store the data about the book. It will hold the XML element called BookData
.
To understand better what we will store in this variable, let's have a look at the corresponding schema, which we have defined in Chapter 2, Service Invocation:
We can see the BookData
element defined within the BookWarehousingBPEL.xsd
XML Schema.