Wednesday, April 11, 2007

Oracle BPEL Process Manager Client API

We did not find direct WebCenter way to access the BPEL process, but we found API “Oracle BPEL Process Manager Client API”.

This API support invoking the BPEL Process programmatically via a Java Code. The API is slightly different depending on whether you are invoking a two-way operation (which has both input and output messages) Synchronous proces or a one-way operation (which just has an input message and returns no result) Asynchronous process .

So this API provides to us two services Post Service and Request Service where its using depends on the type of BPEL process.

Asynchronous BPEL Process:
It provides only initiate operation which has input without output so we use post function to access this Operation.

Synchronous BPEL Process:
It provides only also Process operation which has input and out put so we use request function to access this operation.

**********************************************************************
How we use this API?


1- Setting the configuration for connecting to Oracle BPEL Process Manger.
Hashtable jndi = new Hashtable ();
jndi.put (Context.PROVIDER_URL, "opmn:ormi://10.10.2.141:6003/orabpel");
jndi.put (Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
jndi.put (Context.SECURITY_PRINCIPAL,”oc4jadmin”); // username of Bpel Manager
jndi.put (Context.SECURITY_CREDENTIALS,”welcome1”); //password of BPEL Manager
jndi.put ("dedicated.connection",”true”);

Locator = new Locator (“default”,”welcome1”); // default is the domain Name and welcome1 is the
Password of the domain.

deliveryService = (IDeliveryService) locator.lookupService (IDeliveryService.SERVICE_NAME);

Locator class: used to connect to the domain on the BPEL Process Manager and fetch a list of BPEL processes deployed on that server. In this case, we use the Locator class to return a handle to an IDeliveryService instance.
IDeliveryService Interface: used to invoke/initiate BPEL processes deployed on a BPEL Process Manager.

2- Passing XML messages via Java.
String SchemaInputXML = "" +
" ererer " +
" dgfdggdg " +
"
";
nm = new NormalizedMessage ();
nm.addPart ("payload", SchemaInputXML);


NormalizedMessage class: construct an XML message, construct an input message for request or construct an Output Message for response.

3- Invoking the operation.

Invoking Synchronous Process:
It call process operation which return output message and need input message
So we use the IDeliveryService.request () methods to access this process.

NormalizedMessage res = deliveryService.request ("userBPEL", "process", nm);
// userBPEL is Process Name and process is operation method name and nm is the input message.

Invoking Asynchronous Process:
It call initiate operation which need input message and does not return output so
We use IDEliveryService.post () method to access this process.

deliveryService.post (“userBPEL”,”initiate”, nm);

**********************************************************************
How to retrieve the Result?

Synchronous process:
It is easy to retrieve the result using normalizedMessage object as we saw in the synchronous invoking.

Asynchronous process:
It is not easy to get the result but we can inform the user of the process by making the Process send JMS Message or email (I did not try it ...I just read it) Or using conversation ID to identify the process instance before posting and after that use this ID to identify a specific instance and retrieve status information from it .

String convId = GUIDGenerator.generateGUID();
nm.setProperty(NormalizedMessage.CONVERSATION_ID, convId);
deliveryService.post(processID,operationName, nm);
IInstanceHandle fg = (IInstanceHandle)locator.lookupInstanceByConversationId(convId);

**********************************************************************
What we need to use this API?

oc4jclient.jar, Orabpel-common.jar and Orabpel.jar

Tuesday, April 3, 2007

WebCenter View


What is the Webcenter Suite?

It is new platform for building effective Application by supporting:
- User Interaction (portlet , Search , Content , Mobile ,VOIP, Desktop )
- System Management .
- Development Tools .
- Identity Management .


WebCenter Framework

· Portlets:
it supports using some built-in portlets which are available through a preconfigured OC4J that is automatically available to us through JDeveloper (OmniPortlet, Web Clipping, Rich Text portlet) , creating our own standards-based portlets to be consumed by any JSR 168 or WSRP-compatible portal ( where WSRP is Portal Developer Kit (PDK) plus some portlet capabilities )

· Customizable Components :
It provides new JSF components that allow developers to make any of their applications runtime customizable, with these capabilities in place; administrators can customize virtually any JSF page by minimizing/maximizing, hiding/showing, or moving any component on the page.

· Content Integration:
It support integration for content Management System such as Oracle Content DB, OracleAS Portal—or even on your file system— with our application by providing the JCR adapters or oracle adapter .

· Security:
The ADF extensions can define security for the application by defining security for an entire application, a page within the application, or for individual actions provided by customizable components.

WebCenter Services

WebCenter Services offer a variety of content management, search, and
Communication services, including:

· Oracle Content Database which is a full-fledged content management system
enables users to manage content through the Web or from desktop applications.

· Oracle Secure Enterprise Search that can search a multitude of sources, structured
and unstructured, in a variety of file formats, indexed or real-time.

· Communication Services, which help you better connect people and facilitate
Communication, these services include (Instant Messaging, Presence Server, and
Discussion forum).

· Wiki is server software that allows users to freely edit and create Web page content
using a Web browser. This ease of interaction and operation makes Wiki an
effective tool for collaborative communication.