Sunday, October 7, 2007

BPEL : Changing port number

Question: Need to change default HTTP port assigned during installation( say 8888) to a different port (say 80) ?

Answer: This process involves two steps:
1. Changing the port number of the web server.
2. Changing any references to that port number elsewhere in the install.


1. Changing the port number of the web server - Changing the HTTP Listening Port

First we need to change the listener to listen on port 80 instead of the default port 8888. The OC4J web listening port is set dynamically at run time by OPMN from an available port in a given range. Follow the following steps:

a. Stop the SOA Suite running
b. Edit the file $ORACLE_HOME/opmn/conf/opmn.xml
-- Find the entry ''
-- Change the range to port 80
-- Save the file
c. Start the SOA Suite running
d. Verify that SOA Suite is now running on port 80.

Note: IE has a nasty habit of caching a page even if you do a Control Refresh, and so it may appear that your SOA Suite is running on two ports. In Firefox hitting Control Refresh causes the old port address to come back with a server not found error.

2a. Changing any references to that port number - Modify BPEL

BPEL needs to know the port number it is listening in order to construct SOAP endpoint addresses for use in WSDL and callbacks. We need to tell BPEL that the port number has changed. Follow the following steps:

i. Go to BPEL Admin,Log in as 'oc4jadmin'
ii. Change the following entries to have port 80
-- soapServerUrl
-- soapCallbackUrl
-- clusterName
-- Click 'apply'
iii. Bounce SOA Suite again to make sure the change get picked up.

Note: I don't think you really need to change clusterName but it will confuse the heck out of you if you don't!

2b. Changing any references to that port number - Reload BPEL Processes

At this point I would reload any deployed processes, making sure that I revalidated them before deploying because any partner links referring to existing processes on this server will now be pointing to the wrong port!

Note: Check your connections in connection navigator before deploying. Also check your bpel.xml file.


Note: If you plan on using ant to deploy applications then update it to the new port number. Follow the steps:
-- Edit $ORACLE_HOME/bpel/utilities/ant-orabpel.properties
-- Change the http.port property to the correct value

Now ant will deploy to the correct port on the server.

Thursday, October 4, 2007

BPEL: Returning an Immediate Response from an Asynch Process

Today I found a good material on Reynolds blog. This says about how to return an immediate response from a BPEL process created using "Asynchronous BPEL Process". Often we want to return some data to the caller of a process to indicate that the request has been received and is being processed. To do this we need to add an immediate response to the caller in addition to calling them back later when the process is completed. For example consider a process to make a booking for some resource. The process might be lengthy and the caller may need some mechanism for canceling the process before it completes. In this case returning an immediate response could give the caller a handle allowing him to call back into the specific process instance to cancel it. The process is attached at the bottom of this post.
So lets look at how we alter the template.


Creating Project: First we create our process using File->New Project in JDeveloper and choose a BPEL Process Project and select the "Asynchronous BPEL Process" template. Name the process as "ImmediateResponseBPELProcess".


Adding a Response Element: Once we have created our project we then need to add an immediate response element to the XSD.
<element name="ImmediateResponseBPELProcessProcessImmediateResponse">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>


Adding a New Message Type: Having created a new immediate response element to the XSD we then need to use that element within a new message type in the WSDL.
<message name="ImmediateResponseBPELProcessImmediateResponseMessage">
<part name="payload" element="client:ImmediateResponseBPELProcessProcessImmediateResponse"/>
</message>


Adding an Output to the Initiate Operation: Within the port type for the process we need to modify the "initiate" operation to return an immediate response of the message type we just created.
<operation name="initiate"><input message="client:ImmediateResponseBPELProcessRequestMessage"/><output message="client:ImmediateResponseBPELProcessImmediateResponseMessage"/></operation>


Adding a New Variable to the Process: We need to add a new variable to the process to hold the immediate return value.

Adding a Reply to the Process: We can add the reply operation to the process and wire it up the client partner link.


Full Process: Finally we need to complete the process. I will often return the process instance ID as a return value. This can then be used a correlation token if the client needs to call into the process again before it completes.

Once the process is finished being written, it can be deployed and executed.


At the End: So adding an immediate responsetells the caller that we have received their request and also gives them a token to call back into the process later. A complete example is uploaded here. As you can see it is very easy to do and personally I feel all "asynchronous" processes should give some immediate response.

Monday, October 1, 2007

Using BPEL or ESB or Both :Confused???

Many people asked me this question..Can I use Oracle ESB instead of BPEL to do integration work and If there is BPEL then why we go for ESB?

Well..well..The answer is simple & it lies in the description of both.

BPEL: Business Process Execution Language
ESB : Enterprise Service Bus

Why BPEL???
BPEL is optimized for coding and managing Business processes. You can go for BPEL if you are dealing with complex Business logic which involves complex transformations, database operations and workflow. Many people have done integration projects successfully using BPEL.

Then why ESB???
You go for ESB if you need connectivity with simple transformation, routing and a low cost. Its principle objective is to join two different services bi-directionally, quickly and efficiently. One of many advantages is the possibility of virtualizing a service transparently to its consumer, providing transformation from its native format into a canonical one, as well as reliable routing. It also provides the facility of Domain Value mapping lookups.

Its also worth noting that doing integration work with Oracle ESB is not only quicker to "build" but its also quicker in its execution.

So,

ESB: Need connectivity, simple transformations routing and low cost solution.

BPEL/BPEL+ESB: Complex business logic, Integration with Workflow, Complex transforms, Complex database operations, Have Long running processes which may or may not be stateful.

JDeveloper 11g available

New JDeveloper 11g preview version is available for download.

Follow the link to download:-

http://www.oracle.com/technology/software/products/jdev/htdocs/soft11tp.html

Thursday, September 27, 2007

New to SOA?? : Useful Links

Some of the interesting links on SOA which is taken from Marc Kelderman blog are mentioned below. These links will be helpful for those who are planning to start and for those also who are still learning.
To start with Oracle SOA here are some of useful links:

Webservice standards :-
BPEL
WS-Addressing
WSDL
SOAP
XPath
XQuery
XSLT
XPath
WSIF

Oracle SOA Suite software :-
The Oracle SOA Suite
Oracle JDeveloper

Oracle SOA Suite general :-
Oracle Fusion Middleware (functional)
Oracle Fusion Middleware (technical)
Oracle SOA Suite
BPEL
ESB
Business Rules
Business Activity Monitor
Business Process Analysis

Installation :-
Installation Guide
ESB Performance patch
SOA/BPEL patches
General (Metalink -> Patches -> Advanced -> Product (SOA)BPEL)

Documentation :-
The Administration Guide
The BPEL Developers Guide
The ESB Developers Guide
The Adapters Guide
The Workflow Guide
Business Rules User Guide
Business Rules Reference
General oracle documentation
BPEL Correlation

Tutorials :-
SOA Quick start guide
SOA Tutorial (ESB/BPEL/Rules/Workflow)

Performance :-
BPEL Tuning
Tuning in a nutshell
SOA Monitor performance

API :-
BPEL Process Manager
Worflow API
Business Rules

Oracle Forum :-
Oracle SOA
Oracle BPEL

Oracle Blogs :-
My Own blog
Matt Wright'Blog
Antony Reynolds Blog
http://clemensblog.blogspot.com/
AMIS SOA blog
IT-Eye SOA

Oracle General :-
Oracle Technical Network (OTN)
Oracle Metalink (Support)

BPEL : ORABPEL-05002

Question: Error ORABPEL-05002 in domain log??

Failed to handle dispatch message ... exception ORABPEL-05002Message handle error.An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessage";the exception is: Transaction was rolled back: timed out;nested exception is: java.rmi.RemoteException:No Exception - originate from:java.lang.Exception: No Exception - originate from:; nested exception is: java.lang.Exception: No Exception - originate from:

Answer: The root cause of this problem is poor performance of the dehydration store database. If you are using Oracle Lite as dehydration store, switch to use Oracle 9i or 10g.( Better use 10g above version 10.2.0.1)

Following set ups you need to perform for overcoming such problem:

1. Increase the maxConnection number of the BPELServerDataSource. OC4J has too few available connections to the dehydration database.
Location: /j2ee/home/config/data-sources.xml

2. Size of message is too big. Two ways to deal with this problem:

a. Increase the transaction timeout
Location :/j2ee/home/config/server.xml

b. Decrease the auditLevel from BPELConsole. It will reduce the amount of data saved to the dehydration store.
Location: BPEL Console -> Manage BPEL Domain -> Configurations tab.

BPEL : How to read a file in middle of a process?

Question: How to read a file in middle of a BPEL process?

Answer: Following are the ways to read a file in mid of a BPEL process:

1. Using File Adapter: Avoid using the file adapter to read a file. The read file adapter is used to trigger the BPEL process in most cases. So in this scenario, the file adapter is not a good choice. Also it needs to use correlation sets to read files in the middle of a process.

2. Using Embedded Java code: It can solve the problem but it is not recommended and also it is hard to maintain.

3. Using built-in XPath function: The good way to read a file in the middle of a BPEL process is to use the built-in XPath function --> ora:readfile.

Example:

1. Drag an Assign activity in the swim lane at proper place

2. Create an Assign rule using the ora:readfile("file location", "xml schema path") XPath function

3. Assign the result to a variable.