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