Tuesday, February 19, 2013

How to send a message to REST service from OSB

If we want to post a message to REST service using OSB, we can do it in the following way.

Step1 : Create an generic business service.

  Select the type as Messaging Service


Choose xml as input and output message type


Select the default options in the next tabs and give the endpoint of the REST service to be invoked
 
Thats all we need to do for the business service.

Step2: Create a proxy service of xml service type


Select the defaults and complete the configuration of the proxy service.

Step 3: Create a message flow as shown below. Invoke the above created business service in the message flow as a service call out.

In the Request Action step do the following .

The first assign statement set the payload to be send to the REST service.

The critical steps are the following.

Using the TransportHeader step, set the headers to consume the rest service as shown below

In the next Insert step, overwrite the HTTP method to whatever we require. i.e: GET,POST,PUT,DELETE.MERGE etc.



Thats about the service configuration. Now test the proxy service by sending the required payload for the REST service.


Friday, February 8, 2013

Failed to resolve outbound connection pool JNDI for Adapter

There are situations the Adapter outbound connection pool configuration might not reflect at run time and often the service invocation fails due to failure to locate the JNDI.

If we verify the Adapter Configuration screen, the outboundconnection pool JNDIs will be visible.
So why does this error happen?

In such situations its worth to check whether the connection pool JNDI configuration is really updated in the weblogic-ra.xml file.

The weblogic-ra.xml file is located inside every Adapter.rar/META-INF

Most probably the entries we seen in the console will not be available in the weblogic-ra.xml.

To resolve this isssue, unzip the Adapter.rar file to a location, add the connection instance details manually to weblogic-ra.xml and repack the Adapter.rar .


Now copy this Adapter.rar to a new location under the domain.




Before installing the new RAR file, delete the existing adapter from admin console

Goto admin console ->deployments->Goto the respective adatper and delete it .






Once it is deleted , install the newly packed Adapter.rar file from the new location.








At the end select the plan.xml from the same folder itself.

Once the adapter is installed, verify the outbound connection pool configuration and ensure that all the JNDIs are visible over there
Note : If any change done to this JNDI configuration, then the adapter has to be updated to reflect the change.

Monday, January 28, 2013

Failed to bind - Apache Tomcat startup error

By default tomcat runs on port 8080. But if any other application is using this port, tomcat wont start properly unless we change the binding port.

To change the port do the following

Goto Tomcat installation/unzipped folder



Goto the conf folder and open the server.xml file


Change the default port to the available port


Save the file

Goto the bin folder and make a copy of startup.bat as startup-always.bat



Edit the startup-always bat file

Instead of call

"%EXECUTABLE%" start %CMD_LINE_ARGS%

change to in the startup-always.bat

call "%EXECUTABLE%" run %CMD_LINE_ARGS%



Now run the new batch file startup-always.bat

It will start Tomcat and now the welcome page will appear as



Tuesday, January 15, 2013

Customizing BPM process using BPM Composer

Business needs to be agile!  Which means business has to respond to the customer needs very quickly. Technology should support business in achieving this agility.

In BPM it is possible to customize the business process by the business analysts. To customize an existing process it is not required to have the deep technical knowledge. Business can change the implementation of a  process using the BPM composer.

The approach is to make the project as a template by the developer and publish to MDS.

The business analyst can create an customized version of the process from this template project using BPM Composer

I am using the same process used in my previous blog for this example.

The first step is to convert the BPM project to template as follows


Create a MDS Database connection from JDev


Create an IDE connection using the above MDS connection


Identify the activities which can be customized by business people from the BPM Composer.

Here lets take ApproveRequest task as the customizable activity. Ensure the permissions given is "Must Implement"


Now the ApproveRequest task will have an identification as it is customizable


Save the changes and publish the project to MDS as shown below


Create a new folder under the location as shown below and click OK


This will publish the project as a template to MDS

Now logon to BPM Composer



Click on the "New Project" icon



Give appropriate name for the process and select the template as "ReservationProject"


Click on next and Finish


The new process will appear in the next screen. Click on the highlighted link to customize it


The activity which has to be implemented will be highlighted as below



On the right hand side menu, choose the Human Task section under Business Catalog.
Drag and drop the ApproveRequest Task to the highlighted activity




The various activity parameters can be changed as per the new business requirement

 Here I have changed the description of the activity and the Action values


Validate the project and Save



Now go to the project menu and select the deployment option



 Give the necessary info for deployment and deploy the customized version of processs

Calling Async BPEL process from BPM

BPM can call Async BPEL processes. To achieve this feature BPM uses the send and receive activities

Here is a sample BPM process which calls an Async BPEL Process

The BPM process does hotel room reservation. It has three roles.
1) The assistant who is making a request for room reservation
2) The manager who approves assistant's request
3) The receptionist who finally confirms the reservation

Please refer my previous blog on how to create a sample BPM processs


Here is the sample BPM process which does the reservation job



Now lets create a Async BPEL Process which takes a string value as input and sends the string "VERIFIED" as output


 Deploy this BPEL process

Now add the send and receive activity to the flow in the manager's swim line as shown below


 We can see the warning signs on the Send and Receive activities now. To remove the warnings we need to configure the parameters for these activities.

Go to the composite.xml of the BPM project and add a webservice resource using the wsdl of the deployed Async BPEL process


 Now click on the Send Activity and configure the service details as follows

Similarly configure the call back operation for the receive activity


Now the warnings on the Send and Receive activity will be disappeared

Now deploy the BPM Project and logon to the BPM workspace.

The deployed process will be visible in the application list


Click on the link , and initiate the process by submitting a booking request


Now open the em console and we can see an instance of the BPEL process got created for the VerificationAsync Process

 After some delay now the Approval Request will appear in the task list. The call to BPEL for verification is completed before the approval task is created.


Now Approve the request and the flow will move to confirm reservation, which will be done by the receptionist