Gopalan Suresh Raj
Web Cornucopia
Gopalan's Profile
Archives
« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today
Click me to subscribe Download Open ESB
Syndication
Search

Table of Contents
Tags
bpel choreography ejb esb http integration javacaps javaee javaone jax-ws jbi management openesb orchestration process-oriented rest sca service-oriented soa soap wsdl xml xsd
Links
 
Referrers

Today's Page Hits: 207

Map of Visitors
Locations of visitors to this page
Caveat Emptor
This is my personal weblog. The contents of this Weblog represent my personal opinion which may differ from the official views of my employer, Sun Microsystems, Inc. or any past employers. I do not speak for my employer or any past employers.
View Gopalan Suresh Raj's profile on LinkedIn
« BPEL: What is Correl... | Main | WSDL & SOAP: Binding... »
Saturday Jul 08, 2006
Jul
8
BPEL: Lifecycle of Business Process Instances
Operations are message exchanges. WSDL Web Services define a stateless model and an unordered set of operations.

However, among other features, a language used to define business processes has to at a minimum provide for the following:
BPEL is one such language that meets all the above mentioned criteria for a language used to define business processes. Since WSDL Web Services are stateless, messages that are exchanged in long-running business interactions need to be correlated to the right business process instance. As we discussed in an earlier blog entry, BPEL provides facilities that can correlate business-application specific data with business process instances.

Business process Instance:Business Process::Object:Class
A business process is a template definition to create new business process instances just as a class is a template definition to create new object instances . To quote an analogy, a business process instance is to its business process the same as an object is to its class definition.

As soon as a business process is defined using BPEL and is deployed, it is possible to create multiple instances of that business process which can run concurrently and completely independent of each other. In this blog entry, let us discuss how such business process instances are created and destroyed.

Programming languages like C++ and Java provide the new keyword to create an object of a class, and C++ provides the delete keyword for object destruction (in Java, object destruction is implicitly handled by the Garbage Collector at runtime). Contrastingly, in BPEL, creation and deletion of business process instances is implicitly handled by the BPEL Engine at runtime.

BPEL uses WSDL defined web services to communicate with partners.

Creation of a business process Instance:
At runtime, the BPEL Engine waits for a client partner to invoke a business process using the <receive> activity. A business process can also be waiting on a <pick> activity for the initial incoming message. The <receive> or <pick> activities have a createInstance attribute. If the activity (<receive> or <pick> activity) has the createInstance element set to yes, the BPEL Engine creates a new business process instance. The business process can then perform other logic, or invoke several operations on other partners, or could also wait on partners to invoke callback operations. Once an instance is created using the createInstance attribute, any other activity in the same business process instance loses its ability to create new business process instances.

Destruction of a business process Instance:
A business process instance is implicitly destroyed by the BPEL Engine when either a normal termination occurs because its last activity completes successfully, or an abnormal termination occurs either because it encounters a <terminate> activity, or a fault is encountered from which the instance cannot recover.

A web service client can start more than one interaction with a business process. For each new client invocation with a business process, a new business process instance is implicitly created as long as the createInstance attribute in the initial <receive> activity is set to yes as the following skeletal listing illustrates.

 ...
<sequence>
  <receive name="ReceiveFromCustomer" 
           createInstance="yes" 
           partnerLink="Customer" 
           operation="fileClaim" 
           portType="ns2:IFileClaim" 
           variable="FileClaimInput"/>
...

In cases where more than one activity needs to be enabled concurrently, correlation sets are used as was described in this blog entry. The following skeletal listing of the follower of a correlation gets the property values for their correlation sets from incoming messages. These subsequent steps match the data in the correlation set with the initialized data. A <receive> activity is triggered only if the data in the incoming message matches the values in the correlation set. An <invoke> or <reply> activity must send out data that matches the data in the correlation set.

 ...
<invoke name="InvokeAddNewAdjustmentJob" 
        partnerLink="Adjuster" 
        operation="addNewAdjustmentJob" 
        portType="ns4:Adjuster" 
        inputVariable="AddNewAdjustmentJobInput"/>
        
<receive name="ReceiveSubmitAdjustment" 
         partnerLink="AdjusterCallback" 
         operation="submitAdjustment" 
         portType="ns2:IAdjusterCallback" 
         variable="SubmitAdjustmentInput" 
         createInstance="no">
    <correlations>
        <correlation set="claimNumber"/>
    </correlations>
</receive>
...



Note: All examples use the Insurance Claim Scenario described in this blog entry.

Download the Java EE 5 Tools Bundle Beta from http://java.sun.com/javaee/downloads/index.jsp for FREE, and provide us feedback on the improvements you'd like to see. It combines the new Java EE 5 SDK with NetBeans IDE 5.5 Beta, NetBeans Enterprise Pack 5.5 Early Access, and Sun Java System Application Server Platform Edition 9. This bundle also contains Project Open ESB Starter Kit Beta, Java EE 5 samples, Java BluePrints, and API docs (Javadoc).

The screen-shot below shows the WSDL for the Insurance Claim scenario in the Sun NetBeans 5.5 Enterprise Pack Beta WSDL Editor
The screen-shot below shows the BPEL for the Insurance Claim scenario in the Sun NetBeans 5.5 Enterprise Pack Beta BPEL Visual Designer
   





Posted at 05:01PM Jul 08, 2006 by Suresh Gopalan in BPEL  |  Listen to this article Listen to this entry  |  Comments added Comments[0]
Tags:
Share This Post: del.icio.us | furl | simpy | slashdot | technorati | digg

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

Disclaimer: The contents of this Weblog represent my personal opinion which may differ from the official views of my employer, Sun Microsystems, Inc. or any past employers.



View blog top tags

Enter your email address:

Delivered by FeedBurner

[Valid RSS]