| By Michael Havey | Article Rating: |
|
| February 4, 2006 09:30 PM EST | Reads: |
36,109 |
Figure 3 shows an alternative (and inferior) representation of the imaginary hub, in which the participants are represented in separate pools (long narrow rectangles), with message flow (the dotted arrows) between them depicting the interchange of messages. Although the pools are a nice visualization of the participants, the message flow creates an indecipherable clutter that makes the diagram almost impossible to read.
The sum-of-parts approach is shown in Figure 4. As the name suggests, choreography represented this way is, in a sense, the sum of the public processes of the individual participants and the exchange of messages that drives them. This approach is suitable if there is no requirement to evaluate the sum! In Web Services Choreography Interface (WSCI, an earlier choreography specification and a precursor to WS-CDL), for example, choreography is defined as the public behavior of each participant plus the global message exchange view. Figure 4 is a convenient representation of a set of WSCI interfaces. WS-CDL, by contrast, requires a single, global, unified definition, which would be hard to synthesize from the mess of process steps in the retailer and distributor pools in the figure. We are accustomed to watching dancers in a show dance as a group. What if each dancer performed separately, and we were left to combine them in thought as a group?
In UML, activity diagrams or collaboration diagrams could be used to build the imaginary hub and sum-of-parts approaches.
Code-Level Choreography with pi4soa
A software developer using pi4soa, the new WS-CDL code editor, can either create a WS-CDL choreography from scratch or import an existing one for modification. Although the import option fits our life cycle best, no tools exist to generate WS-CDL from a model (such as the one designed in the previous section), and hence the developer is left with the less desirable option of building a fresh WS-CDL while eyeballing the model.
The choreography managed by pi4soa is a WS-CDL file in a Java project in Eclipse. The pi4soa plugin provides a graphical editor that, behind the scenes, generates WS-CDL XML code (which can be viewed in a text editor). Figure 5 shows the pi4soa editor (the large window on the right side) open in the "base types" view, which allows the developer to assemble the main building blocks of the choreography. The "participants" view, shown in Figure 6, allows the developer to build structural participant relationships.
The key information in these views is the following:
- The participants (or roles) involved in the choreography are Distributor, Retailer, and CurrentRetailer, as well as two participants meant to simplify the implementation (for reasons discussed below): Customer (to model a customer's interaction with a retailer) and DistributorBizCal (a subsystem of the distributor to model the management of business calendars for completion and switch periods).
- Each participant (or role) has a behavior and a channel. The behavior is the participant's Web service, and the channel is its inbound communication endpoint. All interactions are asynchronous. To send a message to a retailer, for example, call its Web service by placing a message on its channel.
- There are four relationships. RD represents the interface between Retailer and Distributor, CRD the interface between CurrentRetailer and Distributor, RC the interface between Retailer and Customer, and DInt the interface between Distributor and DistributorBizCal. The relationships allow communication in both directions; RD, for example, lets Retailer call Distributor, or vice versa.
- The message type (or information type) exchanged between participants is an XML document called EnergyMsg, which contains fields (or tokens) such as custID, retailer, txID, currentRetailer, and reason.
The heart of the choreography is the "choice" structure enrollmentResult, which allows exactly one of its paths to run based on the enrollment status determined in the previous private step. The simplest of the three paths, for rejection, is the "sequence" shown in Figure 8, in which the distributor, in a private step, adds the reject reason to the message (the WS-CDL "assign" activity could also have been used for this), and then, in the interaction enrollRejected, sends the message to the retailer.
The acceptance sequence in Figure 9 is more complicated. The distributor begins by sending an acceptance message to the retailer in the interaction enrollAccepted, and then, in the private step setCompletionTimer, sets an alarm to go off at the end of the completion period. Next, one of two events can occur: the completion timer expires, or the customer cancels the enrollment with the retailer. These options are modeled as sequences periodExpired and cancel in the choice structure completionPeriod. The logic of each sequence is straightforward: in periodExpired, DistributorBizCal sends an alarm notice to the distributor (periodExpired) and the distributor, in turn, sends a completion event (enrollmentComplete) to the retailer; in cancel, the customer sends a cancel event to the retailer (cancelFromCust), which the retailer forwards to the distributor (cancel).
The switch path, shown in Figure 10, is similar to the acceptance path. The distributor begins by sending a switch pending message to both the retailer and the current retailer (in the pair of interactions named switchPending), having already, in private steps, added the identity of the CurrentRetailer to the message and set the switch business calendar timer. If the timer expires (in the periodExpired interaction), the distributor sends completion messages to both retailers (switchCompleted); if the customer cancels (cancelFromCust from customer to retailer, cancel from retailer to distributor), the distributor sends a notification to the current retailer (switchCancelled).
From Model to WS-CDL to BPEL
The WS-CDL choreography closely resembles the "imaginary hub" process shown in Figure 2 (described in the previous section). In particular:
- An interaction activity in the WS-CDL choreography is equivalent to a receive event followed by a send activity in the hub's process. In both cases, the effect is to move a message from one participant to another.
- The choice control structure in the WS-CDL is equivalent to the exclusive-OR event gateway in the hub's process. In both cases, the effect is to execute exactly one of several paths.
The event choice approach also makes the individual participant process stubs easier to understand. For the retailer, once its enrollment request has been accepted by the distributor, it waits for either an enrollment completion message from the distributor or a cancellation event from the customer. For the distributor, once it has accepted the enrolment, it waits for either a period expiry notification from its business calendar system (an internal event) or the cancel event from the retailer.
The BPEL code generated by pi4soa from the energy choreography uses "pick" activities to model the event choice. Listing 1 shows, in pseudo code, the retailer's BPEL stub. There are two levels of event choice: the outer pick to determine whether the request was accepted, rejected, or caused a switch (lines 3-17), and the inner picks to manage the periods (lines 8-11 and 14-17).
The development life cycle spanning the modeling of the BPMN imaginary hub, the refinement of the WS-CDL code, and the generation of the stub BPEL process works. Viable participant processes can be derived from properly modeled, implemented, and tested choreographies.
References
- W3C Web Services Choreography Working Group, "Web Services Choreography Description Language Version 1.0" (November 2005). www.w3.org/TR/2005/CR-ws-cdl-10-20051109/
- BPMI, "Business Process Modeling Notation 1.0 Specification" (May 2004). www.bpmn.org/Documents/BPMN%20V1-0%20May%203%202004.pdf
- pi4soa sample apps: www.pi4tech.com
- Official pi4soa site: http://sourceforge.net/projects/pi4soa
- To run pi4soa, you need several Eclipse components (see pi4soa release notes for details): www.eclipse.org
- Havey, M. Essential Business Process Modeling. O'Reilly, 2005. Discusses BPMN and choreography.
- Ontario Energy Board, "Ontario Electronic Business Transactions Standards Document for Retail Settlement in the Electric Retail Open Access Industry" (December 2001). www.xmlenergy.net/oeb_ebt_wg/docs/standards/ EBTStdsDocumentDecember21.doc
Published February 4, 2006 Reads 36,109
Copyright © 2006 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Michael Havey
Michael Havey is a Chordiant consultant with 10 years of industry experience, mostly with application integration. Michael's book Essential Business Process Modeling was published by O'Reilly in August 2005.
![]() |
Steve Ross-Talbot 02/09/06 08:47:11 AM EST | |||
Great article. It was a surprise to see our CDL tools displayed. Just to ground this in business terms it is useful to consider what one migth use WS-CDL for. At the moment there are two distinct uses of WS-CDL that are activly being pursued based on the Pi4 Tech tools (www.pi4soa.org) by real projects. These are: 1) As a means of describing the overall architecture of a SOA that involves several services that need to collaborate. The description is created in the tools and then service generation to Java - which creates state machines for each service into which business logic can be placed. When this has been done monitoring is used to determine what the services are actually doing based on the WS-CDL description. It makes life much better for developers and architects because it enforces behavior across the services and guarantees interoperability. This translates into much faster design, build, test, deploy lifecyles and is proving a bit of winner. 2) As a means of describing and then monitoring existing services (so no generation). It turns out the monitoring becomes even more important. The architect/developer creates teh WS-CDL of what they expect should happen and then monitors what actually happens against the WS-CDL description using our monitor tool. This gets even more important and the boundaries between enterprises as it provides behavioral goverance that can be imposed from the inside out. Just wanted to ground it in some real world uses. Well done. Cheers Steve T |
||||
![]() |
SYS-CON Italy News Desk 02/04/06 10:22:25 PM EST | |||
Choreography is the dark continent of Web services: few onlookers have traveled there, and many question whether there are any riches to be brought home from the trip. In the first place, choreographies bear such a striking resemblance to business processes that the novice might think that the two types of artifacts are indistinguishable. |
||||
- The Top 150 Players in Cloud Computing
- Commercial vs Federal Cloud Computing
- Why IBM’s Server Chief Got Busted
- Industry Experts Discuss the State of Cloud Computing
- Cloud Expo New York Call for Papers Now Open
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- US Federal Government is Major Cloud Computing Innovator
- Google Wave
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Adaptivity & Cloud Computing: Exclusive Q&A with CEO Tony Bishop
- 4th International Cloud Expo: Photo Album
- The Top 150 Players in Cloud Computing
- SYS-CON.TV: Cloud Computing Expo Power Panel
- Commercial vs Federal Cloud Computing
- Why IBM’s Server Chief Got Busted
- 1st Annual GovIT Expo: Letter from the Technical Chair
- Industry Experts Discuss the State of Cloud Computing
- Deputy CIO of the CIA to Keynote 1st Annual GovIT Expo
- SOA World Power Panel on SYS-CON.TV
- CIA was Headed to an Enterprise Cloud All Along: Jill Tummler Singer
- Cloud Expo New York Call for Papers Now Open
- 1st Annual Government IT Conference & Expo: Themes & Topics
- Stock in Focus: Dragon Capital
- The i-Technology Right Stuff
- Who Are The All-Time Heroes of i-Technology?
- Get the Message
- Where Are RIA Technologies Headed in 2008?
- i-Technology Viewpoint: Is Web 2.0 the Global SOA?
- i-Technology Viewpoint: Thinking Outside the VC Box
- ESB Myth Busters: 10 Enterprise Service Bus Myths Debunked
- i-Technology Viewpoint: When to Leave Your First IT Job
- SOA Web Services Edge Conference Coverage on SYS-CON.TV
- Five Reasons Why Web 2.0 Matters
- SYS-CON.TV's "SOA Web Services" and "Enterprise Open Source" Programs To Air in December
- SOA World Conference & Expo SYS-CON.TV Power Panel Live From Times Square










Cloud computing is a game changer. The cloud ...





















