BPEL (Business Process Execution Language)
What is BPEL (Business Process Execution Language)
BPEL (Business Process Execution Language) is an XML-based language that allows web services, APIs and human processes in a service-oriented architecture (SOA) to interconnect and share data in a business workflow.
Historically, many businesses used a single large monolithic program to create and execute business processes. One line-of-business program would be responsible for everything from inventory to payroll. These programs would often become fragile and difficult to maintain.
In response to these challenges, many businesses now use smaller web services or microservices to handle business functions. BPEL acts as the glue or the common language that each of these services speaks so they can work together toward a common goal.
How is BPEL used in business?
Consider booking a business trip as an example where BPEL can be used. An employee starts the workflow for booking a flight. A list of available flights is pulled from a travel website. They select one. Their manager receives a notification and clicks a button to approve the expense. The system generates and sends a purchase order to accounting, and then books the flight on the airline website. It enters the expense and approval into the finance tracking software, and then sends the booking information and schedule to the employee and manager.
BPEL is an important tool in enterprise application integration. It defines how microservices interact. It can also act as the middleware layer that handles all communication between participating services.
In SOA, many small services are designed and built. Each service will operate independently and offer an API or way to interface with the other services. BPEL can be used as a common interface between the services to exchange data and control information.
BPEL code can be created manually or by a business process management program through a GUI. This allows workers with limited technical knowledge to read and create BPEL flows.
BPEL choreography vs. orchestration
BPEL offers two paradigms of operation: choreography or orchestration. Orchestration is now the primary way to implement BPEL.
In choreography there is no central program that manages BPEL processes. Each service directly communicates with the other services it relies on without central authority. This can be thought of like a choreographed dance, each dancer knows their role and how they fit in their place, so they don't collide, but there is no director on the stage during the performance.
While choreographed systems can be simple to set up in small deployments, they can quickly grow unwieldy when many pieces are added and are more difficult to integrate new processes or to change the underlying services. Therefore, orchestrated BPEL implementations are now the standard.
In an orchestrated system, a central program manages the BPEL processes and communicates with the services. Each service does not need to be aware of the other services, only the central director. This can be thought of like an orchestra playing music.
Each instrument only has its own sheet music to read from. The conductor is on stage directing each section and ensuring that they work together as a whole. Orchestrated systems often require additional setup but are more agile and resilient.
History and subtypes of BPEL
The BPEL standard is maintained by OASIS, a nonprofit standards group. It has undergone several revisions and extensions during its history.
BPEL was first standardized by collaboration between IBM's Web Services Flow Language and Microsoft's XLang. This first version was named Business Process Execution Language for Web Services (BPEL4WS) when it was submitted in 2003. In 2004 it was formally renamed as Web Services Business Process Execution Language 2.0 (WS-BPEL). In 2007 an extension BPEF4People, or WS-HumanTask, was added to formally define steps that require human interaction. In general, the abbreviation BPEL is used to refer to the latest versions.
Programs that provide BPEL include the following:
- Microsoft BizTalk
- Oracle BPEL Process Manager
- SAP PowerDesigner
- IBM Business Automation Workflow
BPEL and BPMN
Business Process Modeling Notation (BPMN) is a visual language to express business logic and information flows. It builds on Unified Modeling Language. There is no direct connection between BPEL and BPMN.
There are methods to map BPMN processes and flows into BPEL executable code, but they cannot be directly converted from one to the other. BPMN can be a helpful way to help model a BPEL before it is implemented or to help explain a BPEL flow.
BPEL and WSDL
Web Services Description Language (WSDL) is a standard way for web services to describe the interfaces it uses when exchanging data. WSDL will include the variable and function the service uses. BPEL uses the WSDL descriptors of the web service to correctly interface with it.
BPEL code structure
BPEL uses XML notation. It therefore uses text with opening and closing tags.
The first element is the <process> tag. It defines the name of the process and namespaces used in the process. Next it will define <partnerLinks> for the participating services. Global variables are defined in the <variable> tag.
The process can call other services using <invoke> or can send to another process with <receive>.
The main body defines how the activity proceeds. Activities can be defined to be sequentially in a <sequence> or in parallel as part of a <flow>. Data flow can be controlled with loops using <while> and conditionals with <switch> and <pick> tags.
See how AI is helping to drive business process optimization, steps to implement automation in IT workflows and the difference between low-code development and business process management. Also, explore basic SOA principles that still apply to microservices, how application containers offer a new approach to SOA and the evolution of microservices governance from SOA.