BPEM Process Monitor - MarketPlace Tutorial

Table of Contents

 

Chapter 1.             Starting BPEM Monitor 1

Chapter 2.             Deploying the MarketPlace Sample 3

Chapter 3.             Running the MarketPlace Client/Seller 5

3.1   On Linux   5

3.2   On Windows 5

Chapter 4.             Monitoring the MarketPlace Process State 7

4.1   Obtaining the Process Instance Selection List 7

4.2   Monitoring the Running Process List 8

Chapter 5.             Running MarketPlace Client/Buyer 13

Chapter 6.             Observing a Seller/Buyer Deal in BPEM Monitor 15

Chapter 7.             Retrying the MarketPlace Seller/Buyer Sequence 17

Chapter 8.             Additional Tutorials 19

 

List of Figures

 

Figure 4‑1.    Setup Option in the Process Console To Change Monitoring Mode. 7

Figure 4‑2.    Confirmation Screen for Changing Monitoring Mode. 7

Figure 4‑3.    List of Running MarketPlace Instances 8

Figure 4‑4.    Default BPEM Console Display for the MarketPlace Process 9

Figure 4‑5.    Expanded Sequence Block for MarketPlace Process Display. 10

Figure 6‑1.    Expanded “MarketPlaceSwitch” in Sequence Block for MarketPlace Process 15

 


Preface

This tutorial will use the BPEM Process Monitor to observe the behavior of the marketplace BPEL sample process. Several scenarios will be used to highlight the features and uses of the monitor.

The BPEM Process Monitor is a standalone tool that allows for both dynamic real-time monitoring of a running BPEL process, as well as analysis of final state information for a BPEL process that has terminated. For a complete description of BPEM, see BPEM - Process Monitor Overview.



Chapter 1.      Starting BPEM Monitor

To use the monitoring tool, first launch BPEL with the following command line:

bsoap start

Then start BPEM with the following command line:

bsoap bpem

The BPEM monitor program will start and display its main window.
This tutorial assumes an "automatic" refresh mode. This is not the default. To enable automatic refresh, select one of the automatic refresh modes on the options menu. Depending on your PC platform and its performance, care should be taken when selecting fast refresh rates. For this tutorial, a 10-second refresh is sufficient.

 


Chapter 2.      Deploying the MarketPlace Sample

If the "marketplace" sample has not been deployed, then it must be done now. The following command line will deploy the marketplace sample:

bsoap deploy -p marketplace -samples

This makes the marketplace model available for execution. It can be executed multiple times without redeployment.

 

 


Chapter 3.      Running the MarketPlace Client/Seller

 

The marketplace client process can now be run to cause a "seller" to place merchandise up for sale in the marketplace. For convenience, it is helpful to request that this be done in a separate command window by using the "&" trailing option for Linux® commands, or the "Start" on Windows®.  (The command should be all on one line).

 

3.1                       On Linux

On Linux®, use the following command line:

bsoap launch -p marketplace -cc org.objectweb.orchestra.samples.marketplace.MarketPlaceClient seller truck 400 &

 

3.2                       On Windows

On Windows®, use the following command line:

bsoap launch -p marketplace -cc org.objectweb.orchestra.samples.marketplace.MarketPlaceClient seller truck 400

 

This causes the client to start and, in this case, a "seller" has requested to sell a "truck" for a minimum of $400. The command window will display the following:

[java] ClientContainer.info : Starting client...

[java] >>>>> MARKETPLACE client (seller truck 400) starting...

 

Note:

On Windows, the output displays in the same command window as BSOAP START.

 

 


Chapter 4.      Monitoring the MarketPlace Process State

 

Now the running process instance can be observed using the BPEM Monitor.

 

4.1                       Obtaining the Process Instance Selection List

To obtain the Process Instance Selection list, from the BPEL Administration Console, select Administrator Setup Monitoring Mode.  Change the Monitoring Mode from "Running Only" to "All", as shown in the following figure.

 

Figure 41.    Setup Option in the Process Console To Change Monitoring Mode

 

The following screen will then display to confirm the change.

 

Figure 42.    Confirmation Screen for Changing Monitoring Mode


4.2                       Monitoring the Running Process List

Select the BPEM monitor (which was previously started), and open the drop-down list of known process instances. Scroll down until the "marketplace" instance is displayed and select it as shown below. Note that if the marketplace is executed multiple times, then there will be multiple marketplace entries in this list, some of which will be marked "Finished", and one that will be marked "Active".  In this case, select the "Active" marketplace entry, or use the date/time to identify the correct instance.

 

Figure 43.    List of Running MarketPlace Instances

 

 


The default BPEM display for the process is displayed. Resize the windows to get a view similar to the one below (loop count and statement number options are OFF, GRAPHIC mode is selected).

 

Figure 44.    Default BPEM Console Display for the MarketPlace Process

 

 


The area of interest in this demo is the "sequence" block at the end of the process. Expand it by clicking on the "+", then also expand the "flow" that is internal to the sequence. At this time, also expand each of the three variables displayed in the variables window at the bottom by clicking on the expansion icon. Resize the display and scroll until the display is similar to the following.

 

Figure 45.    Expanded Sequence Block for MarketPlace Process Display

 

The following observations can be made from the above display:

1.        Control flows sequentially from top to bottom as indicated by the arrows. A horizontal, blue bar indicates a point of parallel control flow.

2.        BPEL statements that have been executed are outlined in green and will display a timestamp. Statements that have not been executed are in red.


3.        The default timestamp format is to display the time that a statement was executed relative to the start of the process. Different timestamp formats can be selected from the "Options" menu.

4.        The "SellerReceive" statement has been executed because it is displayed in green. This graphic corresponds to the following "receive" statement in the BPEL file:

receive partnerLink="seller"

         portType="tns:sellerPT"

         operation="submit"

         variable="sellerInfo"

         createInstance="yes"

         name="SellerReceive"

5.        The client program with the "seller truck 400" parameters caused 2 things to happen: 

a.       the BPEL process was started, and

b.       the client called the "seller" link to start the transaction.

6.        The "BuyerReceive" statement has not been executed because it is displayed in red.

7.        The subsequent "switch" and "reply" statements have not been executed. The process is suspended waiting for all paths of the "flow" to be executed.

Observe in the variables window that the "sellerInfo" values have been set, but the "buyerInfo" and "negotiationOutcome" variables have not yet been set.

 

 


Chapter 5.      Running MarketPlace Client/Buyer

The marketplace client process can now be run again to cause a "buyer" to buy the merchandise being sold in the marketplace.

This can be done with the following command:

bsoap launch -p marketplace -cc org.objectweb.orchestra.samples.marketplace.MarketPlaceClient buyer truck 450

This causes the client to start and in this case a "buyer" has requested to buy a "truck" for $450.

The command window will display the following:

 

   [java] ClientContainer.info : Starting client...

   [java] >>>>> MARKETPLACE client (buyer truck 450) starting...

   [java] >>>>> MARKETPLACE client (seller truck 400) response received : Deal Successful

   [java] >>>>> MARKETPLACE client (buyer truck 450) response received : Deal Successful

 

 

Note:

On Windows, the output displays in the same command window as BSOAP START.

 

 

 


Chapter 6.      Observing a Seller/Buyer Deal in BPEM Monitor

Return to the BPEM monitor and expand the "MarketPlaceSwitch" at the bottom of the sequence. The display now looks like this.

 

Figure 61.    Expanded “MarketPlaceSwitch” in Sequence Block for MarketPlace Process

 

The following observations can be made from the above display:

1.        The "BuyerReceive" statement has now been executed because it is displayed in green and has a timestamp.

2.        The difference between the timestamp for "BuyerReceive" and "SellerReceive" represents the delay between the time when the "buyer" client was run and the time when the "seller" client was run.

3.        Within the "MarketPlaceSwitch" statement, the successful case has been executed indicating that the buyer offer price was equal to or higher than the seller asking price.

The "Variables" display window at the bottom now shows values for the "buyerInfo" and "negotiationOutcome".

 

 


Chapter 7.      Retrying the MarketPlace Seller/Buyer Sequence

 

To see different results in the BPEM monitor, the sequence starting at
Running MarketPlace client/seller can be re-executed using different parameters for the asking and offer prices, such as an insufficient bid amount.

 


Chapter 8.      Additional Tutorials

 

This overview tutorial has discussed the use of BPEM to analyze the dynamic state of a running BPEL application. The following tutorials are also available:

See BPEM Process Monitor Overview for basic BPEM operation.

See BPEM Process Monitor - Bpemdemo1 Tutorial to observe multiple paths of execution and dynamically changing variable values.