BPEL has no goTo

Lonneke Dikmans October 30th, 2007

You might wonder why it is relevant. You could argue you have loops and switches to solve that. Let me illustrate it with two examples.

Example 1. BPMN in BPA Suite

When you use the BPA suite (10.1.3.3) to model your business processes in BPMN, you can transform the process to a BPEL process. This results in a BluePrint that can be opened in JDeveloper10.1.3.3 to add implementation details. One of the problems you run into, is the conceptual mismatch between the two modeling languages. BPMN is a graph oriented language (see this article where an example is shown) in which you are relatively free to move back and forth between steps. In contrast, BPEL is in its essence a block language, that follows a linear flow. When you represent a certain control flow in BPMN that involves moving back in the flow, you need to use another construct in BPEL to execute it, because BPEL has no goTo. You could argue that this is not a big deal, but in “On the Translation between BPMN and BPEL: Conceptual Mismatch between Process Modeling Languages”, Jan Recker and Jan Mendling explain why this is relevant. Apart from the semantical difficulties, you can run into practical obstacles. In the BPA Suite a certain transformation model is implemented to translate gateways into BPEL constructs. You can easily create a process that is valid BPMN, but that won’t translate to a BPEL process in the BPA suite. This can be a sign of either of the following problems:

  • BPEL is not the right implementation technique for the process you are modeling. Usually this is the case when you have a finite state machine where a lot of different state transitions are possible.
  • The process is not modeled correctly. Sometimes, generalizations are made on the wrong modeling level. For example, imagine a travel reservation process with a step ‘edit the reservation’. This step might return after each event. This can result in numerous loop backs. Instead, the process should move forward. For example, the first time you ‘edit the reservation’, you are completing the client data. After checking availability, you might change the flight date. Translating both of them into edit the reservation is a generalization that should be done in the implementation phase, not in the process design.

Example 2. BPEL as the Controller implementation in your MVC pattern

You run into the same thing when you are using BPEL for your navigation flow, as the controller implementation. This is possible in JBoss Seam, but also with Oracle BPEL and ADF Faces. There are several advantages when you use BPEL as a controller:

  • you can trace user steps (for support, e.g.) using the logging capabilities of BPEL
  • you can have long running sessions (go for lunch or home and resume your registration process for example) using the dehydration store
  • you can deploy a new flow separate from the running application

However, it has a couple of disadvantages:

  • page flows can have back buttons. This is not supported in BPEL. Of course you can ’simulate’ that by using loops or compensation handlers but this results in the same mismatch as there exists between BPMN and BPEL.
  • Performance hit. Every time somebody starts the webapplication, a BPEL process needs to be instantiated. This is a lot of overhead, that is not as scalable as a ‘regular’ web application.
  • you need to build a bridge between the web session and the process instance.

To conclude: whenever you catch yourself wishing BPEL had a goto, re-evaluate your process model and/or implementation choice, it is a sign something is wrong!

Leave comment

Comments: (2)

1. bex 31 October 2007, 16:17

this is indeed disturbing news… I’m sensing a huge push towards BPEL, and if it cannot handle GOTO or JUMP, then how does it handle feedback loops between business units? The lack of a back button is pretty restrictive…

Is there a formalized alternative to finite state automata that works for designing BPEL processes?

2. Lonneke Dikmans 31 October 2007, 17:51

Exactly my point: It is not a golden hammer. It is a very good hammer for automated process flows. So think before you use it, don’t be pushed…
You can actually wait for a response (have asynchronous) communication in BPEL, so feedback from a business unit is not a problem, as long as the result does not require you to go back and forth between different steps…
To emulate jumps or a ‘back’ button you can use ’switch’ and ‘while’ constructs, but this gets very messy pretty soon I think… Take a look at the first link in the blogpost, the pdf describes a formalized way to move from BPMN to BPEL. And of course, BPA Suite implemented an algorithm. But not every use case is covered because of the (semantic) mismatch between the two models.

Regards,
Lonneke

Leave your comment: