BPEL is great â€“ and so is Oracle BPEL
Probably many of you have at least a vague notion of what BPEL (Business Process Execution Language) is all about. Now, thanks to a very good presentation by Oracle’s Sandor Nieuwenhuijs at Oracle Open World today in Amsterdam. I will try to summarize what I learned today, and perhaps it can prove beneficial to some of you as well. The presentation is on the Oracle Open World Amsterdam website, and here is the link to the powerpoint for the presentation at the UK Oracle Open World For more information on Oracle BPEL Process Manager, see its homepage on OTN. An introductory document is found here. BPEL is a standard published by OASIS and backed by major vendors such as IBM, Microsoft, BEA, SAP and of course Oracle. BPEL describes an XML syntax to use for describing a Business Process through a ‘composition of invocations of (other) Business Processes – typically WebServices’. A BPEL process definition therefore is an XML document composed according an XSD (XML Schema Definition) that is maintained by OASIS. Creating Business Process definitions in the form of BPEL XML Documents can be done manually, since XML documents are just somewhat structured text-files. Oracle BPEL – a plugin for Eclipse – allows us to graphically create and edit this XML Document. That is a rather lame way of saying that BPEL Design Time offers a visually attractive and pretty productive UI for developing business process definitions. The UI is a little reminiscent of Oracle Designer’s Business Process Modeling tool – but then with a vertical layout – and also looks a little like UML’s Activity Modeling. But then again, they are all about Business Process modeling.
You cannot define your own images for use in the Design Time BPEL editor (as you could with the Oracle Designer BPM tool) – you will have to do with the ones provided by Oracle. There is not really a standard for visualizing BPEL documents but apparently there is one in the making and these images are pretty close. Oracle tells us that there is already a Beta version of the Oracle BPEL plugin for Oracle 10g JDeveloper and that a production version is probably published before the end of this year. A Business Process in BPEL terms is composed of Invocations (call-outs to WebServices), Receptions (call-ins from external Services), Decision Points with simple conditional logic and parallel flows or sequences – that in turn are also made up out of Invocations, Decision points etc. Variables can be defined as part of a Business Process, they can be assigned values from parameters passed in into the Business Process at startup, passed along in invocations, given values from the results of invocations and returned as final-result of the business process. A Business Process itself is also implemented as a WebService – in the BPEL (Runtime) Engine. Note that a web-service may return its answer a-synchronously: it will perform a call-back into the invoking web-service when the answer is available. The flow within the BPEL process from which the call originated is blocked while waiting. It is possible in BPEL to specify a time out period; when that has passed, the response from the webservice is decided not to be coming anymore and a FaultHandler is invoked or the flow is continued. The real power of BPEL is in the runtime engine. A BPEL Business Process is deployed in this engine. The BPEL Engine itself can be installed in any J2EE Application Server – Oracle supports use with WebSphere, WebLogic, JBoss and of course Oracle Application Server. The BPEL engine interprets the BPEL definition file – it registers the definition of the process. New instances of all registered processes can be started from any application by calling the WebService. The execution of the WebService that ‘wraps’ the BPEL business process is completely controlled and performed by the BPEL runtime engine. It will initialize variables, call the external webservices specified in the BPEL definition and return the results when the process instance is done. Execution of a Business Process can take a very short or a very long time – from sub-second to days or weeks. Oracle BPEL maintains the state of the currently executing Business Process instances in a database (a process called dehydration) – can be Oracle but also other databases such as DB2 and SQL Server. The BPEL Console – a simple web-application running in the J2EE application server along with the BPEL runtime engine – allows monitoring of current instances. You can drill down on individual instances, inspect all messages sent out and received as part of the process instance execution, verify what step in the process it currently is executing – typically which reception from which external service it is waiting for – and also inspect the history of all previously process instances. Until you purge (parts of) the history, full audit records are kept for past process executions, including all messages exchanged and all variables set and changed during the execution. A very nice aspect of the Console: it allows you to test a Business Process. That means you do not have to code a client that calls the WebService Oracle BPEL has set up for your business process; instead the BPEL console offers a simple HTML Form where you can provide values for input-parameters of the Business Process and then invokes that process. The console goes one step further and has a very simple way of running a stress-test on your Business Process to see how it responds to more challenging conditions. You can write simple logic – if then else, while loops etc, – in the BPEL definition, to implement rudimentary decision points. It is also possible – even according to the BPEL standards and implemented by Oracle BPEL – to embed Java Classes. This allows definition of more complex logic in the process flow without the need to call out to a WebService – for example the logic to choose between two loan-offers, which may be simply a matter of selecting the one with the lowest interest rate – is extremely simple and the overhead of invoking a webservice would be substantial and a waste. Embedding a simple Java Class to implement that logic seems a better way of doing it. However: the platform independence of your BPEL document is then compromised – it can no longer be deployed on a .Net server. Oracle BPEL also has built-in support for Apache WSIF (Web Services Implementation Framework). I do not exactly know what it is, but apparently it allows you to register simple Java programs or components written in other languages and have them act – through WSIF – as some sort of webservice. The actual invocation from BPEL however is a direct call into the Java Class without the WebService overhead of marshalling and unmarshalling of the XML-SOAP message (twice for a service that sends a response). From the Apache WSIF website:
The Web Services Invocation Framework (WSIF) is a simple Java API for invoking Web services, no matter how or where the services are provided. Please refer to the release notes before you proceed with using WSIF. WSIF enables developers to interact with abstract representations of Web services through their WSDL descriptions instead of working directly with the Simple Object Access Protocol (SOAP) APIs, which is the usual programming model. With WSIF, developers can work with the same programming model regardless of how the Web service is implemented and accessed. WSIF allows stubless or completely dynamic invocation of a Web service, based upon examination of the meta-data about the service at runtime. It also allows updated implementations of a binding to be plugged into WSIF at runtime, and it allows the calling service to defer choosing a binding until runtime.
Note: Andrej Koelewijn also mentions this WSIF support in this post on his weblog.
A very interesting post on invoking Java code directly (not through the full monty of WebServices wrappers) is found on OraBlogs: BPEL – More than Web Services by Antony Reynolds; it discusses WSIF and also embedding Java code directly in the BPEL document (comparable with Java scriptlets in JSP files). An even better post is this one Using Java from BPEL with WSIF also by Antony Reynolds
The question of whether Oracle BPEL will replace Oracle Workflow in the near or longer term future is often asked and can not yet be answered in a completely clear and satisfactory manner. It is clear that much of what Oracle Workflow offers – in highly proprietary way – is now also available through BPEL. However, there is quite a lot of overhead in wrapping every individual PL/SQL procedure that might currently be called as part of a Workflow in a WebService and making disparate calls to all those WebServices from a BPEL process. What can be done very easily in terms of integration is wrapping an entire PL/SQL and database oriented Workflow in a WebService and invoke that from BPEL. That way existing or even new workflow definitions can be integrated into BPEL. Of course in that way the details of all steps within the workflow will not be available in the Oracle BPEL Console and History. Sandor indicated that Oracle BPEL will also provide a direct call-out (not through the WebService interface) to PL/SQL program units in the near future. (I might have misunderstood or remembered incorrectly; it can be that Sandor meant a direct call to a PL/SQL based workflow rather than a specific PL/SQL program unit). Sandor indicated that Oracle Applications (aka E-Business Suite) will not migrate away from Workflow to Oracle BPEL in the very near future, even though for new webservice interaction it will use BPEL. He did expect that eventually Workflow and Oracle BPEL will come together, either by specifying workflows through BPEL definition files or by migrating all Workflow functionality and existing definition into the BPEL arena. However, given the substantial investment and code base around workflow within Oracle Apps, this will not happen overnight. Oracle BPEL is part of Enterprise Edition of the Oracle Application Server. Apparently, according to Sandor, the stand-alone tool Oracle bought (Collaxa) sold at almost the price Oracle charges for the Oracle Application Server Enterprise Edition and IBM and Microsoft sell their specific BPEL offerings at almost the same price as Oracle sells their entire Application Server. In that respect, it is not very expensive. Oracle BPEL can be downloaded from OTN. It involves a 200 Mb download, most of which is not BPEL at all but rather Eclipse. Once downloaded, it installs within 15 minutes. It ships with a truckload of demos and samples. I am looking forward to really get going with it, after this very inspiring session. One demo that would explain what Oracle BPEL does for you – even though it would create a horrible piece of coding – might be the translation of a piece of Java or PL/SQL code that invokes a number of Methods or PL/SQL procedures into a BPEL Business Process that calls those same methods or procedures, this time wrapped in WebServices. The BPEL would do the same as the original piece of code (albeit much slower) and it would demonstrate fairly well I believe what fundamentally is going on in BPEL and the BPEL runtime engine. Of course the code should contain some IF-THEN-ELSE decision logic. The parallelism offered by BPEL is not available in PL/SQL as such, but through threads does exist in Java. Perhaps that could be part of the demo as well….
Didn't find any related posts :(