Book Image

WS-BPEL 2.0 Beginner's Guide

Book Image

WS-BPEL 2.0 Beginner's Guide

Overview of this book

Table of Contents (19 chapters)
WS-BPEL 2.0 Beginner's Guide
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – deploying and testing the second BPEL process


To deploy and test our second BPEL process, we will redeploy the whole SOA composite, which now includes both BPEL processes. Let's perform the following steps:

  1. Right-click on the project in the project tree and select the Deploy submenu.

  2. Then, select Deploy to Application Server.

  3. We will use the default deployment configuration, but make sure that we check the Overwrite any existing composites with the same revision ID option.

  4. Choose the IntegratedWebLogicServer server for the deployment and click on Finish.

After the successful deployment, we are ready to test the process. We will use Enterprise Manager Console. As we created the new BPEL process within the same application, we deployed it inside the Bookstore composite application. After clicking on the application, click on the Test button, which will now have two options, BookstoreA and BookstoreB.

  1. Test the BookstoreBBPEL process by clicking on it.

  2. Let's do the test for the 1111-1111 ISSN. To perform the test, first select the XML View.

  3. This time we will enter the request message in plain XML. For this, simply enter the required data in the following predefined XML form:

  4. After clicking on the Test Web Service button, we will see the screen with the response of 10:

What just happened?

We successfully tested our second BPEL process. First, we redeployed the whole SOA composite application, which now consists of the two BPEL processes. Then, we invoked the BookstoreBBPEL process and monitored the response for different ISSNs.

Note

There are other ways to test the BPEL process than using the Enterprise Manager. The SOA Suite test framework can be used directly from JDeveloper to test and debug SOA composites. A popular option is using the SoapUI tool, which can generate the requests and show the responses in a similar way, as we did with the Enterprise Manager. For more information on SoapUI, visit http://www.soapui.org/.

To get more insight into the BPEL execution, a nice option is to click on the Launch Flow Trace button. This opens a new window, which shows the execution flow trace. Our BPEL process is relatively simple; therefore, we see only one component. If we click on the BookstoreBBPEL instance, we will see another view named Audit Trail:

An even more interesting view is the Flow view, which can be activated on the Flow tab. It shows the visual execution flow. For our process, it will look like the following screenshot:

Clicking on any activity on the visual flow allows us to inspect the variables, which is very useful for debugging.

With this, we have concluded our discussion. You have successfully developed, deployed, and tested your second BPEL process, which is already a bit more complex than the first one. Still, it was an oversimplified BPEL process, which took four parameters as an input (the book ISSN, title, edition, and publishing year) and returned the quantity of the book together with the ISSN. However, this time different ISSN returned different stock quantities.

In the next chapter, we will use both BPEL processes, BookstoreABPEL and BookstoreBBPEL, and will orchestrate them into a more complex process.

Have a go hero – test the process

It's your turn now. Test the BookstoreBBPEL process for different parameters, including ISSNs 2222-2222, 3333-3333, and others, and verify that the process returns the correct response.

Pop Quiz – BPEL basics

Q1. Try to answer which of the following items are true:

  1. BPEL is a language for composing services and orchestrating and coordinating the flow of services.

  2. BPEL is a programming-in-the-small language.

  3. BPEL is used to implement specific functionalities.

  4. BPEL is used to compose (orchestrate) functionalities exposed though services (service interfaces) into composite applications.

  5. BPEL is a graphical language.

  6. BPEL code uses XML syntax.

Q2. Which is the latest version of the BPEL language?

  1. 1 .0.

  2. 1 .1.

  3. 2 .0.

Q3. BPEL process starts with which root-element activity?

Q4. Does BPEL support variables?

Q5. Which activity is used to manipulate variables?

Q6. What is the correct syntax of the <if> activity?

  1. <if><then><else>.

  2. <if><then><endif>.

  3. <if><then><else><endif>.

  4. <if><elseif><endif>.

  5. <if><elseif><else>.

Q7. What is the default expression and query language in BPEL?

  1. XQuery.

  2. XPath.

Q8. What is the purpose of the <receive> activity?

  1. To send response to the client.

  2. To wait for incoming messages.

  3. To receive e-mail messages.

Tip

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.