Monday, October 29, 2012

Resolving Invalid State of SOA Composite

Ever wondered why a SOA composite goes to invalid state when the SOA server starts up? No matter what you try - restarting the composite from within the fusion middleware control (EM console) or undeploying - nothing would work. Only a server restart "Might" rid you of the issue.

I am carefully using "Might" here because, the SOA composite under consideration might refer to a service which could be down when the composite was started. This happens because;

The SOA server doesn't know of the service dependencies that a SOA composite has.

For instance let us consider a SOA composite A referencing external services B, C & D deployed on the same server instance. Ideally, we would like to have a service startup order where the services B, C & D are started ahead of composite A.


But that is not the reality as there is no way to set the service startup priority on the SOA server. It wouldn't be a nice idea to weave this setting at the server level as well because, consider a cyclic dependency issue where composite A references composite B and vice versa which would be too complex & cause instability.

This is a classic case for any SOA environment and the issue here is because the concrete WSDL references are used in the SOA composite to connect with the external services.

Now the question is how do we resolve these service dependency issues?

Answer lies in leveraging the SOA infrastructure capability. If you look closely into any SOA composite (source code), there will be a set of common services that will be referenced from the metadata store (MDS);


<import namespace="http://xmlns.oracle.com/bpel/workflow/taskService"
          location="oramds:/soa/shared/workflow/TaskServiceInterface.wsdl"
          importType="wsdl"/>


These service definitions are stored in the MDS repository which is available all the time for the SOA services to reference provided the underlying DB is up & running. You can check this for yourself by establishing a SOA MDS repository connection from the JDeveloper resource palette.

Similarly, as a best practice you can store all the abstract WSDL definitions of the referenced services in the MDS repository & reference them in your SOA composite. This way whenever the server tries to start the services, irrespective of the service startup order, the SOA composite starts up successfully as it will always have the abstract WSDL reference - After all, at design/compile time, the only thing that a SOA composite requires is the abstract WSDL definition. Only at runtime does the composite would require a concrete WSDL to invoke the right service.

Now, how do we let the design & runtime environments know what service reference (abstract/concrete) to use?

After storing the referenced abstract WSDLs & XSDs in the MDS repository, make the following changes to effect this;

1. Update the import statements in your composite XML to refer the WSDL/XSDs from concrete references to abstract ones;

<import namespace="http://www.oracle.com/orderprocess"
location="oramds:/apps/orderprocess/common/orderprocess_submitorder.wsdl" importType="wsdl"/>


2. Update the service wsdl location to MDS abstract WSDL reference as the soa engine would only look at this element to look up & start the services;

<reference name="SubmitOrder_OrderProcess" ui:wsdlLocation="oramds:/apps/orderprocess/common/orderprocess_submitorder.wsdl">

Leave the WSDL URL in the binding layer intact (to refer to concrete WSDL) because at runtime, the bindings will be used to invoke the actual web service.

To read more about abstract & concrete WSDLs, I recommend you to read my previous blog post here

How to store these artifacts in MDS repository? Ways to do it along with step-by-step instructions in my next post. Here it is!

Sunday, October 28, 2012

BPM 11g Subprocess (Default, Loop, Multi-Instance & Event based) Exemplified

With some common use-case references, I will be making an effort today to explain how, when & where various different sub-processes are used in BPM 11g. A subprocess is nothing but an embedded/nested subprocess within the parent process.

A subprocess - in a very simple use-case can be used to organize & modularize certain set of activities based on its function for better readability.

One important point to note here is that a subprocess must have an incoming & outgoing sequence flow akin to other BPM activities with the only exception of an event-based subprocess.

Oracle BPM 11g offers two variants of subprocess activities;

1. SubProcess (Default): This can be implemented in 3 different fashions based on its loop characteristics;

a) None: Primitive form of a subprocess to just organize & modularize activities within a certain business function as depicted in the diagram. For example, in an order process BPM process, there may be certain activities such as getting credit score of the customer from a credit bureau agency (external), checking inventory of the products in the order from the inventory management system (example JD Edwards) which constitutes a business function namely "Pre-Process Order" which can be grouped under a subprocess.

b) Loop: Think of this option as synonymous to a regular programming language's for/while/do-while construct. When this option is chosen, a loop condition needs to be specified which will let the subprocess know the number of times it would loop itself before the process control flow comes out of it. The loop condition can be specified either as a simple or XPath expression. Additionally, "Loop Maximum" value can be specified which will act as a "break" condition to come out of the loop.

If you had noticed, I referenced for/while & do-while constructs. Interesting to note here that a do-while would process the loop at least once even if the condition evaluates to false where as a while construct would loop only if the condition evaluates to true. This is exactly what the "Evaluate Before" option lets us do. By default this option is checked which means that the loop construct would act as a while and if unchecked would behave like a do-while.

Extending the order process use-case which has multiple orders in a process (bulk order processing), where the individual orders need to be processed sequentially (You might ideally would like to have them processed in parallel. But for whatever reasons - may be human resource crunch, the process analyst decides to have the orders processed serially :). Let us keep the use case going!).

c) MultiInstance: This is very similar to a loop subprocess except that this option would enable parallelism. This allows multiple instances for each item in a collection either based on the cardinality or collection data. Cardinality allows loop condition to be specified where as collection accepts the collection data. For instance, if we have a collection of orders that needs to be processed in parallel rather than sequentially, we would opt in for a MultiInstance subprocess which creates a task for the Finance user for every order simultaneously.


2. Event SubProcess: This is the next variant of subprocess which can exist independently in a main BPM process which means that it doesn't need an input & output sequence flow. Whenever, an event is triggered this subprocess can listen to those events and get invoked. Similar to event based gateway, catch & throw events, the event-based subprocess can be triggered with a message event, timer event, signal or on error. Also, the same can be configured to be "Interrupting" which will break the main process flow on event.

Let us now add some flavor to the order process use-case by adding fraud handling capability. We will now build a event-based subprocess which will handle fraud and will be triggered based on a message. The finance reviewer can trigger a fraud event which will be sent to the fraud analysis team for further diagnosis.


That completes the BPM 11g subprocesses usage. Watch out for more on individual subprocesses & their intricacies in my next posts.

Saturday, October 27, 2012

Abstract WSDL vs Concrete WSDL

In recent times, the abstract WSDL terminology is used more than ever and I am seeing more & more coffee-table discussions on this topic. In this post I will make an effort to provide an illustrated explanation in regards to the differences & usage of concrete and abstract WSDL.

First up, abstract WSDL is not a new technology. A typical WSDL (Web Services Description Language) consists of the following sections; types, messages, portType, binding & service elements. A quick look at what each of these sections define will ease the task of clarification of the differences;

Types - Defines the data type definitions for messages that will be exchanged by the web service. Generally defined from a schema (XSD)

Message - Defines the set of actual messages that will be exchanged. A message can consist of one or more parts which is a logical separation which together constitutes the message.

PortType - Defines the abstract operations provided/available and abstract messages involved. Operation refers to the messages involved in the transaction.

Bindings - Defines the message format and protocol information for operations defined by the portType.

Service - Defines the endpoint where the webservice will be exposed

Based on these definitions, we can figure out that the Types, Message & PortType sections of a WSDL definition is abstract (since it has no information pertaining to the communication protocol & how or where the service is exposed) where as the Bindings & Service section is concrete.


Hence, if we have a WSDL which just has these elements (excluding the Bindings & Service sections), then the WSDL is referred to as "Abstract WSDL". This WSDL definition cannot be used to connect to the webservice due to the 'missing information' on where & how the service is exposed. But there are certain advantages with abstract wsdl which we will see in a bit.

Definition of concrete WSDL now becomes a no-brainer. If a WSDL has all the sections - including the concrete parts such as Bindings & Service then it is referred to as a concrete WSDL. This WSDL defnition can be used to connect to the actual service since it has the protocol and service endpoint information.

Now, where exactly do we use an abstract WSDL?

Coming to the world of SOA, I am taking the example of Oracle SOA composites referencing external services. Ever wondered why some SOA composites are in "Invalid State" even though all the services that it references are up & available? This is because of the usage of concrete WSDL reference where the referenced service is not available yet when the caller service composite starts up. There is no way for the server to know about the service dependencies when it starts. By leveraging the concept of the abstract WSDL, we would be able to effectively resolve dependencies both at design time as well as runtime.

More on resolving service dependency issues in SOA on my next post here

Thursday, October 18, 2012

Enabling Business-Driven Development Through Oracle BPM

Recently I was talking to the VP of Business Operations of a leading financial services company. The excerpt from the discussion below;


"How do I empower my business analysts/line of business users to take full control of our business processes?"

"After all, the people in our organization who best understands the business processes are our business analysts. But what we traditionally see is that the Information Technology trying to overwhelm and drive business which is a tragedy. I feel it is imperative for my business analysts to take control of our key business processes which are now driven by our IT whims & fancies."

"But the question that I would like to ask you is how to do it? and more importantly what solution can you offer?" 


The first thing that we need to understand here is that;

"There are really no IT projects in an enterprise. It is only the business processes that drives business which require IT to move it forward"

More often than not, this is forgotten. Honestly speaking the IT wing of a business knows very little about the business and business has very little control on the IT. Increasingly this is the same deficiency or insufficiency more and more businesses are facing. In trying to be agile on their business fronts they are unable to reflect at the same speed on their IT which has now become a critical part.

How to bridge this gap?



The answer lies in ensuring a seamless integration between the business and IT which we term as "Business-Driven Development".

Top three things to enable and sustain this approach are;

We need a technology that will

Equip your business analysts to design & model the business processes who is better placed to understand them

Enable them to share their business process models with the IT (Developers) to get them implemented. What we are trying to enable here is a top-down development approach driven purely by business

Empower stakeholders and LOB users to monitor the key performance indicators (KPIs) on the business processes in real-time so as to take immediate actions to resolve them

Oracle Business Process Management Suite (BPM) along with Oracle Business Activity Monitoring (BAM) - part of the Oracle Fusion Middleware stack can help you achieve all of the above and much more.

Lets delve into these for a moment and look at the components which will help us in achieving the goal.

Oracle Business Process Composer: This is purely a web-based modelling tool which will enable the business analysts of your organization to take control of the core business processes. The composer equips business analysts to work in groups, perform iterative model design/development, configure business rules, share the models with IT for further development, deploy them on server and much more. The important thing to note here is that a business process model can be developed from scratch without any IDE installation - all from within your web browser. I am sure the business guys are going to love this.

Oracle Business Process Workspace: Again a web-based workspace portal which allows all business users under various organization  roles to login and perform actions on their tasks.

Oracle Business Activity Monitoring: A web-based process monitoring dashboard which enables operational visibility into the business processes real-time. Again the BAM dashboards can be built by business users from within the browser based on the KPIs.

Is this not cool technology to take your business forward. Worrying less about IT and concentrating more on business development & growth has always been a dream. Now, take advantage of the latest & greatest technology from Oracle to move your business FORWARD!

Please feel free to write back to me if you need more information on this topic.