Monday, May 21, 2007

Create a singleton process

This article is based on the one from Matt's blog.

Sometimes you do not want have a process invoked every time. It could have impact on performance, CPU usage or additional memory and derived from this, think about garbage collection. You would like to have a process instance that can be re-used each time. Think about that you want to reuse data that was already available in a process.

What is needed, is a process that 'runs' forever and wait for input to be processed. This can be shown in the next diagram.

The Singleton process is started and will then run forever. It waits until it is accessed from another process, in this case the SingletonAccessor. The Singleton process will increase a counter and return this to the calling process. The basic mechanism is using correlation. The Singleton process is running and is using two correlation sets. One set is used to set correlation on the Singleton process, based on identifier, and one is used to set to the calling process, the Singleton accessors.

Installing the Singleton Process
The demo, download at the end of the article, has been successfully tested with Oracle BPEL PM (for Developers) version edition on Windows and Linux.

The should be unzipped to a local directory (for convince it's suggested that you unzip it in the BPEL Samples directory), in order to be deployed your BPEL PM engine.
  1. Open Oracle JDeveloper
  2. Open the workspace Singleton.jws
  3. Deploy the Singleton process to the BPEL server.
  4. Deploy the SingletonAccessor process to the BPEL server.
note: that the SingletonAccessor process is using a partnerlink pointing to the Singleton process. Make sure the URL is set correct in the bpel.xml file.

<partnerLinkBinding name="Singleton"> <property name="wsdlLocation">
</property> <property name="correlation">correlationSet</property> </partnerLinkBinding>

To run the demo, first initiate the Singleton process from the BPEL Console. ensure that you specify "Singleton/1.0" as the Singleton Id (note - this should be the default payload).

Then initiate as many instances of SingletonAccessor as you like. You should see that they all call the same process instance of Singleton.

Download the example file here.

Tuesday, May 15, 2007

Oracle SOA Suite: Reinstall repository (dehydration store)

During the installation of the SOA Suite, it depends on the installation, if it creates automatically the repository. The following schemas are created, by a default install.
  • orabpel
  • oraesb
  • orawsm
With the advanced install it expects that these three schemas are already there. But it can also be that for some reason you want to re-install the schemas. To (re)install the schemas or just one of these schemas, Oracle provides a script on the installation disk to peform this. This can be found at:


The following files can be used; there is a Windows and Unix flavour:
  • irca.bat
Make sure the database en the listener is started. Stop SOA components on the Oracle Application Server, if they are still running.

Start the script, in the example I assume you are running on Linux (as I do :-) ). First the script will ask the location of the database, then it will ask if you want to overwrite the schema.


Integration Repository Creation Assistant (IRCA)
(c) Copyright 2006 Oracle Corporation. All rights reserved.

Enter database "host port serviceName" [localhost 1521 orcl]:
Enter sys password:
Running IRCA for all product(s):
connection="localhost 1521 orcl", , orabpelUser=ORABPEL, esbUser=ORAESB, orawsmUser=ORAWSM

Validating database ...
Validating database character set ...

Running prerequisite checks for ORABPEL ...
WARNING: This script will overwrite the existing ORABPEL schema.
Do you wish to continue? (y/n) y
Enter password for ORABPEL:
Loading ORABPEL schema (this may take a few minutes) ...

Running prerequisite checks for ORAESB ...
WARNING: This script will overwrite the existing ORAESB schema.
Do you wish to continue? (y/n) y
Enter password for ORAESB:
Loading ORAESB schema (this may take a few minutes) ...

Running prerequisite checks for ORAWSM ...
WARNING: This script will overwrite the existing ORAWSM schema.
Do you wish to continue? (y/n) y
Enter password for ORAWSM:
Enter password for ORAWSM: Loading ORAWSM schema (this may take a few minutes) ...

INFO: ORABPEL schema contains 225 valid objects.
INFO: ORAESB schema contains 180 valid objects.
INFO: ORAWSM schema contains 90 valid objects.

IRCA completed.
Please check for any ERROR message above and also check the log file
/tmp/irca2007-05-15_12-22-05PM.log for any error or other information.

If you are using Oracle Managed Files, you must make some changes in the files. This is written in the following article.

Sometimes you ESB repository does not behaves as expected. In the $ORACLE_HOME/integration/esb/bin directory a script called 'reset.bat|sh' is available. This script will cleanup the ESB repository. Look in the config file, esbsetenv.bat|sh for the connection to the database.

Sunday, May 06, 2007

Human Tasks and Workflow

For a long time Oracle had a product called Oracle Workflow. This product (version 2..6.x) is a work flow product that was based on PL/SQL. It had it own GUI tool to develop and deploy work flow definitions. It is still be used in the Oracle E-Business Suite and some customers are using it in their applications.

Since Oracle has its own SOA product, there was an overlap on work flow functionality. In the statement of direction (SOD) Oracle explains that the Oracle BPEL will take over this functionality. This sounds strange why BPEL can take over workflow.

A few years ago, I was involved in projects based on Oracle Workflow. When I was looking into BPEL to find similarities with Oracle Workflow, if found out BPEL was just the right work flow tool, it covers all the functions I needed. Looking back now, when I doing only SOA related projects, it looks strange, from a SOA perspective, to see BPEL as a work flow product. But these two views can co-exists along this product. This is big advantage. Two worlds, SOA and Workflow, comes together in this product.

Projects that are completed related to SOA can be implemented for BPEL/ESB. But this also applies to projects that are completely based on work flow, including human-work flow. The functionality offered by Oracle SOA/BPEL covers almost all the functions the user requires.

For customers using Oracle Workflow and want to migrate to BPEL, for the work flow functionality, there is no migration path. A redesign of the OWF application to be taken into account.

There are a lot of advantages of the work flow functions in BPEL are:
  • The technology is based on Java/XML
  • Design en implementation is doen in JDeveloper (IDE)
  • A rich Java API exists for workflow and BPEL.
  • A default end-user application is supplied for work flow.