Time for action – creating XML type variables

Let's now create the described variables:

  1. To create a new variable, we will click on the big + icon in the Variables dialog window. The Create Variable dialog window will open.

    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.

  2. Let's declare the 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:
    Time for action – creating XML type variables
  3. We could initialize the variable with the default value. This can be achieved in the Initialize tab. We could also enter the detailed description of the variable and its purpose. This can be done in the Documentation tab. We will not use these two tabs in this example.

Have a go hero – create the LowestQuantity variable

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.

What just happened?

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:

What just happened?

Declaring XML element variables

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:

Declaring XML element variables

We can see the BookData element defined within the BookWarehousingBPEL.xsd XML Schema.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset