Welcome!

Government Cloud Authors: Elizabeth White, Liz McMillan, Gopala Krishna Behara, Raju Myadam, Kevin Jackson

Related Topics: Government Cloud, Java IoT, Microservices Expo, Open Source Cloud

Government Cloud: Article

Showcasing the Key Design Principles of SOA

A Case Study: Orchestrating Services Using Open Source BPEL

b. Creating Process Flow Directives
A BPEL process runtime life-cycle in its most basic form involves receiving a SOAP message, working with the message data in the form of variables, invoking partner web services either in sequence or in parallel to complete different steps in the process, aggregating the response from the various partner services into an outbound message and then replying to the invoker. Let's go over how this can be modeled in the BPEL process definition document.

The <sequence> activity defines a collection of activities that should be executed sequentially. There can be multiple <sequence> activities, each representing an individual collection of sub-activities needing to be executed in sequence, embedded within the root <sequence> node (refer to the Listing 6 snippet of the BPEL process definition document). The <flow> activity describes parallel paths of execution and as shown in Listing 6 and embeds the partner sequences both of which will be executed concurrently at runtime. The <receive> activity is the port of entry for a process. It represents the first item in a process that will be invoked when a message arrives. Essentially, the process waits for the message to arrive that matches the definition in the <receive> activity particularly with regards to the port type and related operation, input, output and fault messages metadata (in our case the BPEL process will consist of a second <receive> activity defined to capture the asynchronous callback message on the process callback port imagingCallbackPT). This activity captures the incoming message into a global variable "WFRequest" that is available for the remainder of the process (refer to Listing 6). It's important to point out that variables used within a BPEL process must be WSDL message types described or imported within the process context, which once defined can be assigned, queried upon using XPath expressions, transformed or used as input to subsequent service invocations.

Listing 7 is a section of the BPEL document showing the process sequence for the conversation with the Forms service endpoint as described in Listing 1. The <assign> activity consists of copying variable data and can also be used to extract or create new data off message schemas based on XPath expressions. In the assignment PrepareFormsVariables the process is simply copying the message part from the global variable "WFRequest", defined earlier, into the message part of a new variable "formRenderRequest" that is used as the parameter message to that service. The <invoke> activity is what the name suggests, it invokes a partner service defined via the partner links construct as was described earlier. Listing 7 shows an example <invoke> activity in the flow sequence for the BPEL process to converse with the external Forms system that was described earlier as a partner link. The port type "frm:FormsPT" indicates the port type on the partner to use (described in the FormsPTService.wsdl document that was imported earlier), the operation "renderPDF" specifies the operation to invoke on the service while the inputVariable and outputVariable point to a variable containing the message or message part data that is used as parameter and response, respectively, from the service during invocation.

One of the message parts of the output variable "formRenderResponse" from the forms system <invoke> activity contains the PDF form content of the pre-populated form as a binary byte array. This needs to be assigned to a message part of the global variable "imagingRequest" that is of WSDL message type "img:ImagingPT_performImageArchival" and used as a parameter to the actual invocation of the Imaging service partner link (refer to Listing 8). Since the binary stream data (PDF) needs to be available before it gets imaged, the <invoke> activity to the forms system needs to be complete prior to the invocation on the Imaging system. Since both the "FormRendering" and "Imaging" <sequence> activities are defined to be part of the parallel <flow> activity, we cannot be absolutely certain that the "RequestFormRender" invocation be complete first. Therefore, we use a BPEL <link> activity "forms-to-imaging" within the <flow> to express this dependency exclusively. The elements <sources> and <targets> respectively contain <source> and <target> elements, which are used to establish this flow relationship for synchronizing the related activities (refer to Listings 7 and 8). Listing 8 also features a <receive> activity receiving the callback message on the callback port type defined by the partner links mechanism in the BPEL document (refer to Listings 3, 4 and 5).

The <reply> activity is usually the final activity within the BPEL process. Once the message has been received and the various intermediary partner links (forms, imaging) have been invoked, the callback has been received, in essence the entire message exchange processing is complete and you would want to send back a response of some kind aggregated with the message responses from the partner systems. This is done using the <reply> activity that is similar in definition to the process's root <receive> activity with regards to the port type and operation but happens in the opposite direction in replying to the calling client of the BPEL process.

Deploying the BPEL Process Definition
A BPEL process definition is comprised of the BPEL process document, the related WSDL contract defining the process port types/operations and partner links, the partner WSDL documents, and other relevant schema files. This mass of files, also called Process Archive, need to be bundled into a .ZIP file and deployed to the jBPM-BPEL runtime under your application server. jBPM provides an automatic discovery mechanism that looks for files under the zipped process archive for the .bpel process document that internally indicates the location of the interface WSDL and schema document. The jBPM DeploymentServlet will deploy the process definition by registering the process service endpoint and publishing the process WSDL files. The deployed process definitions are available under the jBPM-BPEL console http://<machine>:8080/jbpm-bpel/processes.jsp. At this point, the BPEL process is fully available to external clients as a composite service, aptly called WorkflowOrderService (please refer to Listing 5).

Imaging System Callback
In an earlier section I had mentioned the Imaging system responding in an asynchronous manner on a JMS message queue with the status of the image archival process. A MessageDrivenBean (MDB) listening on that particular JMS queue will upon receipt of the javax.jms.Message trigger a callback into the imagingCallbackPT (shown in Listing 5) of the deployed composite service (identified in the program listing by JNDI context "service/WorkflowOrder" and "WorkflowOrderService" in the generated composite service's WSDL document). Listing 9 describes how that works. The MessageDrivenBean is created in the standard J2EE 1.4 manner along with the required ejb-jar.xml descriptor (containing bean definitions, the message desination it must listen on and the JNDI service reference context that includes the WSDL document of the composite service) and deployed on the same server as the Imaging endpoint.

Developing the Client Assembly for the Process
There are a few different approaches in developing the clients for the composite service assembly we just created and deployed to the BPEL runtime engine. If you set up a JAX-RPC Web service endpoint, which our orchestration service eventually ends up as upon deployment to the server, you can leverage the J2EE 1.4 client programming model using any of the JAX-RPC implementing frameworks like JBossWS or the Java Web Services Developer Pack (JWSDP). The J2EE 1.4 platform supports the WS-I Basic Profile that basically ensures that the Web services developed are portable across any JAX-RPC implementation and interoperable with other Web services (like those created using .NET or other competing platforms) supporting the same profile.

For the purpose of illustrating this, I have described a client assembly developed using the JWSDP's wscompile tool to create the required client artifacts like SEIs, User Types, Exception Types, Serializers and the WSDL/Java mapping meta data jaxrpc-mapping.xml file (as stated earlier, you could just as well have used the JBossWS wstools utility to do the same). Essentially there are three types of Web service clients: Static Stubs, Dynamic Proxy and Dynamic Invocation Interface (DII) [10]. A static stub is essentially a Java class that is statically bound to an SEI. The stub, or client proxy object, is generated using the wscompile (or wstools) utility with the aid of a configuration file and defines all the methods that the SEI defines. Both utilities read the composite service's WSDL file (the location of which is specified in the configuration file) and generate the runtime files based on information in the WSDL file. I like the fact that the static stub approach requires less effort to create the plumbing in order to talk to Web service endpoints even though we must regenerate the stub and other infrastructure files each time our composite service's WSDL contract changes.

Among the mass of files that the wscompile tool generates is the stub (WorkflowPT_Stub) and Implementation WorkflowOrderService_Impl class. Listing 10 shows a simple Java client for our WorkflowPT composite service. Note that a stub object is created using the WorkflowOrderService_Impl object that maps Java to XML and assembles the SOAP message to be sent. The endpoint address that the stub uses to access the service is set and then the stub is cast to the WorkflowPT SEI. Next, the input and return parameter objects to the service are then defined and set. Last, the initiateWorkflow() method is called on the stub, passing in the input parameter objects, to begin the runtime process of assemblying the SOAP message to to be passed on to the appropriate SOAP handler and thereby on to the endpoint service implementation by the BPEL runtime which triggers the process workflow that was defined earlier.

Conclusion
BPEL is typically used for complex processes that require coordinating between multiple services to fulfill a centralized business goal and is currently the most portable way to integrate complex interactions by using a standard process integration model. BPEL supports some of the commonly used features of a WS-* process language construct such as XML and WSDL typed variables, property based message correlations, expressions and queries using XPath, transformations using XSLT, fault/event handlers along with structured logic constructs and flow directives and support for robust workflow features such as parallel execution, flow sequencing and chaining. The JBoss jBPM platform provides the runtime infrastructure and persistence model on which the compositions can be deployed and executed. Building composite services this way, abstracted into message interactions baked into platform-independent XML, all working towards the fulfillment of a common business goal showcases the key design principles of SOA: cohesiveness, loose coupling, interoperability and reusability.

References

  1. "An SOA Case Study: Integrating Adobe LiveCycle Forms using JBossWS" by Rizwan Ahmed, SOA Magazine July 2009.
  2. "RESTful SOA with Open Source" by Rizwan Ahmed, SOA Magazine August 2009.
  3. "Business Process Execution Language", Wikipedia.org.
  4. "Web Services Business Process Execution Language version 2.0", OASIS Standard.
  5. "Introduction to jBPM-BPEL", JBoss.com User documentation.
  6. "jBPM User Guide - Chapter 7: Persistence".
  7. "JBossWS- JAX RPC User Guide", JBoss.org.
  8. "JBossWS - User Guide", JBoss.org.
  9. "Java SOA Cookbook" by Eben Hewitt, O'Reilly Media Inc.
  10. "Developing Web Services with Java Enterprise Edition 1.4 Platform".

More Stories By Rizwan Ahmed

Rizwan Ahmed is an IT Systems Architect and author. He has about 10 years of experience in the public and private sector architecting technology, systems and security solutions. He holds Bachelor's and Master's degrees from the Indian Institute of Technology and the Florida State University, respectively. Passionate about open source as contributor and evangelist, he is also a frequent speaker at Java user groups, conferences and sponsored workshops. He holds the Sun Certified Java Programmer, Certified Information Systems Security Professional (CISSP), Certified Secure Software Lifecycle Professional (CSSLP) and the Project Management Professional (PMP) credentials. He lives with his wife and two kids in Columbia, SC.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


@ThingsExpo Stories
With tough new regulations coming to Europe on data privacy in May 2018, Calligo will explain why in reality the effect is global and transforms how you consider critical data. EU GDPR fundamentally rewrites the rules for cloud, Big Data and IoT. In his session at 21st Cloud Expo, Adam Ryan, Vice President and General Manager EMEA at Calligo, examined the regulations and provided insight on how it affects technology, challenges the established rules and will usher in new levels of diligence arou...
Organizations planning enterprise data center consolidation and modernization projects are faced with a challenging, costly reality. Requirements to deploy modern, cloud-native applications simultaneously with traditional client/server applications are almost impossible to achieve with hardware-centric enterprise infrastructure. Compute and network infrastructure are fast moving down a software-defined path, but storage has been a laggard. Until now.
DXWorldEXPO LLC announced today that All in Mobile, a mobile app development company from Poland, will exhibit at the 22nd International CloudEXPO | DXWorldEXPO. All In Mobile is a mobile app development company from Poland. Since 2014, they maintain passion for developing mobile applications for enterprises and startups worldwide.
Digital Transformation is much more than a buzzword. The radical shift to digital mechanisms for almost every process is evident across all industries and verticals. This is often especially true in financial services, where the legacy environment is many times unable to keep up with the rapidly shifting demands of the consumer. The constant pressure to provide complete, omnichannel delivery of customer-facing solutions to meet both regulatory and customer demands is putting enormous pressure on...
The best way to leverage your CloudEXPO | DXWorldEXPO presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering CloudEXPO | DXWorldEXPO will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at CloudEXPO. Product announcements during our show provide your company with the most reach through our targeted audienc...
IoT is at the core or many Digital Transformation initiatives with the goal of re-inventing a company's business model. We all agree that collecting relevant IoT data will result in massive amounts of data needing to be stored. However, with the rapid development of IoT devices and ongoing business model transformation, we are not able to predict the volume and growth of IoT data. And with the lack of IoT history, traditional methods of IT and infrastructure planning based on the past do not app...
"Akvelon is a software development company and we also provide consultancy services to folks who are looking to scale or accelerate their engineering roadmaps," explained Jeremiah Mothersell, Marketing Manager at Akvelon, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
IoT is rapidly becoming mainstream as more and more investments are made into the platforms and technology. As this movement continues to expand and gain momentum it creates a massive wall of noise that can be difficult to sift through. Unfortunately, this inevitably makes IoT less approachable for people to get started with and can hamper efforts to integrate this key technology into your own portfolio. There are so many connected products already in place today with many hundreds more on the h...
More and more brands have jumped on the IoT bandwagon. We have an excess of wearables – activity trackers, smartwatches, smart glasses and sneakers, and more that track seemingly endless datapoints. However, most consumers have no idea what “IoT” means. Creating more wearables that track data shouldn't be the aim of brands; delivering meaningful, tangible relevance to their users should be. We're in a period in which the IoT pendulum is still swinging. Initially, it swung toward "smart for smart...
DXWorldEXPO LLC, the producer of the world's most influential technology conferences and trade shows has announced the 22nd International CloudEXPO | DXWorldEXPO "Early Bird Registration" is now open. Register for Full Conference "Gold Pass" ▸ Here (Expo Hall ▸ Here)
As data explodes in quantity, importance and from new sources, the need for managing and protecting data residing across physical, virtual, and cloud environments grow with it. Managing data includes protecting it, indexing and classifying it for true, long-term management, compliance and E-Discovery. Commvault can ensure this with a single pane of glass solution – whether in a private cloud, a Service Provider delivered public cloud or a hybrid cloud environment – across the heterogeneous enter...
The Jevons Paradox suggests that when technological advances increase efficiency of a resource, it results in an overall increase in consumption. Writing on the increased use of coal as a result of technological improvements, 19th-century economist William Stanley Jevons found that these improvements led to the development of new ways to utilize coal. In his session at 19th Cloud Expo, Mark Thiele, Chief Strategy Officer for Apcera, compared the Jevons Paradox to modern-day enterprise IT, examin...
DXWorldEXPO LLC announced today that ICC-USA, a computer systems integrator and server manufacturing company focused on developing products and product appliances, will exhibit at the 22nd International CloudEXPO | DXWorldEXPO. DXWordEXPO New York 2018, colocated with CloudEXPO New York 2018 will be held November 11-13, 2018, in New York City. ICC is a computer systems integrator and server manufacturing company focused on developing products and product appliances to meet a wide range of ...
Headquartered in Plainsboro, NJ, Synametrics Technologies has provided IT professionals and computer systems developers since 1997. Based on the success of their initial product offerings (WinSQL and DeltaCopy), the company continues to create and hone innovative products that help its customers get more from their computer applications, databases and infrastructure. To date, over one million users around the world have chosen Synametrics solutions to help power their accelerated business or per...
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
We are seeing a major migration of enterprises applications to the cloud. As cloud and business use of real time applications accelerate, legacy networks are no longer able to architecturally support cloud adoption and deliver the performance and security required by highly distributed enterprises. These outdated solutions have become more costly and complicated to implement, install, manage, and maintain.SD-WAN offers unlimited capabilities for accessing the benefits of the cloud and Internet. ...
Charles Araujo is an industry analyst, internationally recognized authority on the Digital Enterprise and author of The Quantum Age of IT: Why Everything You Know About IT is About to Change. As Principal Analyst with Intellyx, he writes, speaks and advises organizations on how to navigate through this time of disruption. He is also the founder of The Institute for Digital Transformation and a sought after keynote speaker. He has been a regular contributor to both InformationWeek and CIO Insight...
Join IBM November 1 at 21st Cloud Expo at the Santa Clara Convention Center in Santa Clara, CA, and learn how IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Cognitive analysis impacts today’s systems with unparalleled ability that were previously available only to manned, back-end operations. Thanks to cloud processing, IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Imagine a robot vacuum that becomes your personal assistant tha...
"MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
I think DevOps is now a rambunctious teenager - it's starting to get a mind of its own, wanting to get its own things but it still needs some adult supervision," explained Thomas Hooker, VP of marketing at CollabNet, in this SYS-CON.tv interview at DevOps Summit at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.