官术网_书友最值得收藏!

Time for action – implementing the BPEL process

In this step, we will implement the BPEL process itself. The goal is to return the book data, including the stock quantity. For this, we would usually need to access the database to query for the stock of the specified book. In our case, we do not want to complicate the example, so we will simply return a fixed value.

To achieve this, we will use the Assign activity to assign a fixed value to a BPEL variable. Assign is one of the basic BPEL activities. We will explain the BPEL language later in this chapter.

For now, let's perform the following steps. First, we will copy BookISSN from request inputVariable to response outputVariable. Second, we will copy a number 5 to the StockQuantity element of the output message:

  1. Open our BookstoreABPEL process by selecting the already opened BookstoreABPEL.bpel tab. Alternatively, you can double-click on the BookstoreABPEL component on the composite design view or double-click on the BookstoreABPEL.bpel file from the project tree on the left-hand side window.
  2. Drag-and-drop the Assign activity from the right-hand component palette to the BPEL process in the middle between the receiveInput and replyOutput activities, as shown in the following screenshot:
  3. Double-click on the Assign activity and set the parameters. Name the activity as DetermineStockQuantity. Copy BookISSN from inputVariable to outputVariable by dragging BookISSN from inputVariable and dropping it on BookISSN in outputVariable, as shown in the following screenshot:
  4. To set the StockQuantity element of the output message, we will need to use an expression. Drag-and-drop Expression from the upper-right corner of the window to the StockQuantity element. Doing this, the Expression Builder window will appear.
  5. Click on the Conversion Functions tab and select the n()number function. Let's assume that we will return stock quantity of 5. This means we need to write number(5):
  6. Clicking on OK twice and saving all we have performed brings us to the following screenshot:

What just happened?

We implemented our first BPEL processes. It contains a very simple logic for returning the book data, including the stock quantity. It assigns the book ISSN and the stock quantity to the constant value of 5. Obviously, this is an oversimplified process, but it is sufficient for our first example and to get a feeling about BPEL. Next, we will try to deploy the BPEL process.

主站蜘蛛池模板: 巨鹿县| 全州县| 岫岩| 邹城市| 青阳县| 馆陶县| 峨眉山市| 申扎县| 大渡口区| 桦南县| 莎车县| 旌德县| 海口市| 石景山区| 宜宾市| 望江县| 临漳县| 彭泽县| 黄平县| 三原县| 犍为县| 清镇市| 云霄县| 田东县| 冕宁县| 虞城县| 武威市| 岳池县| 天全县| 民县| 林州市| 韶关市| 赫章县| 玉林市| 株洲市| 南岸区| 肇源县| 呼玛县| 扶余县| 永州市| 封丘县|