Monday, August 25, 2014

Beginning to understand BPEL

Beginning to understand BPEL

I'm beginning to learn Business Process Execution Language, BPEL, which is the language used to configure workflows in WSO2 BPS. It also is the successor to Business Process Markup Language (BPML), which I'm familiar with from the IBM Gentran / Sterling B2B Integration software.

Comparing the two languages, BPEL is much more evolved, and includes a great deal more information. Especially because the BPEL is intimately linked to WSDLs, the configuration files contain much more information that a BPML. The BPML includes mostly workflow instructions without the web-service components of BPEL. That said, it is a struggle to understand the complex structure of BPEL. This blog post is an attempt to encapsulate what I've learned from studying it over the last few days.

Multiple layers of references

There are multiple layers of references inside a BPEL to invoke a service defined in a WSDL. I count eight layers of self-references within and between a BPEL file and WSDL to invoke a service. It's difficult to understand, and I must credit Dennis Weerasiri for an excellent blog post hosted in the WSO2 library. Without that, I wouldn't know where to start in understanding BPEL. In order to easily refer to the different 'layers', I've named them. Here are the names, numbers and xpath for the layers. I'm using the same sample files Dennis used, and they are available for download from the WSO2 library.

1. NameSpaceDefinition
//@xmlns:ns0
2. Import
//import[@namespace="http://AdderService.wsdl"] 
3. Variables
//variable[@name="SquareOutput"|@name=”SquareInput] 
4. Invoke
//invoke[@name="InvokeAdderService"] 
5. PartnerLink
//partnerLink[@name="AdderPartnerLink"] 
6. PartnerLinkType (in wsdl)
//plink:partnerLinkType[@name="AdderServicePartnerlinkType"] 
7. PortType (in wsdl)
//wsdl:portType[@name="AdderServicePortType"]

The Head Bone is connected to the Tail Bone

All these levels are connected by attributes. Here are examples of the elements which connect each level:

1 → 2 The NameSpaceDefinition's address is specified in the Import.
1 → 3, 4, and 5 The NameSpaceDefinition's prefix is used in the Variables, Invoke and PartnerLink.
2 → 6, and 7 The location of the wsdl file is specified explicitly in the Import.
3 → 4 The input and output of the Invoke statement is specified in the Variables.
3 → 7 The operation attribute of the Invoke statement is the wsdl:operation in the PortType
4 → 5 The partnerLink attribute in the Invoke is the name attribute in the PartnerLink
5 → 6 The partnerRole attribute in the PartnerLink is the plink:role name in the PartnerLinkType
6 → 7 The portType attribute of the PartnerLinkType is the name attribute of the PortType


Is that clear to me? Not at all. The links between levels demonstarte the complexity inherent in the BPEL structure. However, the fact that the configuration for a business process including web services is defined in just a few files is remarkable. I have a hunch that the BPEL will be useful in defining AS2 relationships, which is a cornerstone for EDI communication.


 Cheers, Y'all!

No comments:

Post a Comment