Feeds

Programming constructs in BPEL

Part 3: BPELJ and Compensation

Providing a secure and efficient Helpdesk

In this column in our series examining BPEL and its use within Service Oriented Architecture (SOA) systems, I'll will be looking at BPELJ and Compensation.

BPELJ is an extension to the core BPEL (Business Process Execution Language), which allows the direct inclusion of Java code within a BPEL script. Compensation is actually a core element of BPEL that provides an undo-like facility for situations where part of a BPEL script fails and other parts require their effects to be undone.

BPELJ

The aim of BPELJ is to let you embed Java and J2EE processes in a BPEL process. The intention is to allow portable integration of Java and J2EE applications into BPEL across application servers. In practice, most BPEL engines have allowed integration with programming languages such as Java in one form or another for some time, but via their own proprietary extensions. Thus, there have been BPEL extensions without portability, which I personally find extremely frustrating - because I need to support multiple application server environments.

BPELJ offers a glimmer of hope, in that it aims to provide a standard extension to BPEL for inline Java. The aim of BPELJ is to combine the power of a general purpose programming language such as Java with the orchestration and integration facilities of BPEL. By doing this, developers are free to select the appropriate "programming" language for the level of task they are implementing.

The Design of BPELJ

The design of BPELJ allows Java code to be embedded directly within a BPEL script in similar way to the embedding of Java within a JSP page. That is, BPELJ allows sections of Java code, called Java snippets, to be included in BPEL process definitions. Snippets are expressions or small blocks of Java code used for such things as loop conditions, branching conditions, variable initialisation, calling methods on Java objects etc.

Within BPEL standard extension points are used to support BPELJ. For example, a new partner link type is defined that references Java code; variables can now be typed as being of a specific Java class; and BPELJ code snippets can contain valid Java code statements, with the ability to invoke methods on Java classes from within BPEL statements.

BPELJ Examples

The following BPEL script illustrates the concepts presented in the above section. I've omitted much of this example for clarity, however, the core BPELJ elements remain:


<process name="BookCheck" 

expressionLanguage="http://jcp.org/java"

bpelj:package="com.regdev.example"

xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"

targetNamespace="http://regdev.com/bp/BookCheck"

xmlns:bpelj="http://schemas.xmlsoap.org/ws/2003/03/business-process/java"

xmlns:pq="http://regdev.com/ws/external/BookCheck">

<partnerLinks>

      ...

      <partnerLink name="lookup"  

              partnerLinkType="bpelj:com.regdev.BookLookup"/>

<variables>

   ....

   <variable name="message" type="bpelj:com.regdev.TextMessage"/>

</variables>

<sequence>

...

<flow>

...

</flow>

<bpelj:snippet name="Calculate Total">

   <bpelj:code>

      ...

      subtotal = subtotal * (1 – discount.getRate());

      response.setSubtotal(subtotal);

      float taxes = subtotal * taxRate;

      float total = subtotal + taxes;

      response.setTax(taxes);

      response.setTotal(total);

      ...

   </bpelj:code>

</bpelj:snippet>

...

<invoke partnerLink="BookLookup" operation="checkRegistration">

    <input part="Title" variable="title"/>

    <input part="ISBN" variable="isbn"/>

</invoke>

...

</sequence>

</process>

Internet Security Threat Report 2014

Next page: Compensation

More from The Register

next story
Microsoft on the Threshold of a new name for Windows next week
Rebranded OS reportedly set to be flung open by Redmond
Apple: SO sorry for the iOS 8.0.1 UPDATE BUNGLE HORROR
Apple kills 'upgrade'. Hey, Microsoft. You sure you want to be like these guys?
SMASH the Bash bug! Apple and Red Hat scramble for patch batches
'Applying multiple security updates is extremely difficult'
Business is back, baby! Hasta la VISTA, Win 8... Oh, yeah, Windows 9
Forget touchscreen millennials, Microsoft goes for mouse crowd
ARM gives Internet of Things a piece of its mind – the Cortex-M7
32-bit core packs some DSP for VIP IoT CPU LOL
Lotus Notes inventor Ozzie invents app to talk to people on your phone
Imagine that. Startup floats with voice collab app for Win iPhone
prev story

Whitepapers

Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.
Intelligent flash storage arrays
Tegile Intelligent Storage Arrays with IntelliFlash helps IT boost storage utilization and effciency while delivering unmatched storage savings and performance.
Beginner's guide to SSL certificates
De-mystify the technology involved and give you the information you need to make the best decision when considering your online security options.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
Secure remote control for conventional and virtual desktops
Balancing user privacy and privileged access, in accordance with compliance frameworks and legislation. Evaluating any potential remote control choice.