Thursday, December 13, 2012

How to replace Saxon library home edition in WSO2 BPS 3.0.0 with Saxon professional or enterprise edition to obtain more functionality

Due to license restrictions, we ship saxon home edition in wso2 bps. Saxon is used as the xpath runtime for bps. However due to restrictions in saxon home edition, some functionality such as custom xpath extensions would not work out of the box for bps. However, this functionality can be obtained very easily by replacing saxon home edition jar with the saxon professional edition jar.

Following are the steps to do it.

Step 1.

Step 2.
Remove saxon.he_9.4.0.wso2v1.jar from wso2bps-3.0.0/repository/components/plugins directory.
Step 3.
Download Saxon-EE package.
Unzip and copy saxon9ee.jar to wso2bps-3.0.0/repository/components/lib directory.
Step 4.
Copy saxon-license.lic license to wso2bps-3.0.0 directory. ( Saxon license should be obtained from )
Start the server.

Thursday, October 25, 2012

How to increase the external invocation timeout for a BPEL process in BPS

There are situations where we need to invoke a service which will take quite sometime to respond within a bpel invoke. In such a scenario, you can use following settings to increase the default timeout values.

Increase the default values for MessageExchange timeout and External service invocation timeout. Also set the SO_TIMEOUT parameter and CONNECTION_TIMEOUT parameter in HttpSender.

Here, we are increasing the timeout value from default value to 10 minutes.


<tns:MexTimeOut value="600000"/>
<tns:ExternalServiceTimeOut value="600000"/>


<transportSender name="http"
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding">chunked</parameter>
        <!-- This parameter has been added to overcome problems encounted in SOAP action parameter -->
        <parameter name="OmitSOAP12Action">true</parameter>
        <parameter name="SO_TIMEOUT">600000</parameter>
        <parameter name="CONNECTION_TIMEOUT">600000</parameter>

Tuesday, October 16, 2012

How to invoke Admin Services with SoapUI

It is very very easy to invoke WSO2 Carbon Admin Services with SOAP UI.

Step 1. 
Use the AuthenticationAdmin Service to obtain the session cookie.
You can access the AuthenticationAdmin WSDL of a carbon server with the following url assuming that the server is running with default ports.


SOAP SoapUI to generate the Client for it.
Now invoke the login method. A sample request would be like

<soap:Envelope xmlns:soap="" xmlns:aut="">

In the response message, an HTTP Header will be available with a session cookie.

HTTP/1.1 200 OK

Set-Cookie: JSESSIONID=2671C3A974C0FE67BD9D1DDF665E1DC3; Path=/; Secure; HttpOnly
Content-Type: application/soap+xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 16 Oct 2012 18:48:33 GMT
Server: WSO2 Carbon Server

Step 2.

Now when invoking any other admin service, add the http header COOKIE from soap UI.

A sample request message would look like 

POST http://localhost:9763/services/ProcessManagementService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "urn:getProcessInfo"
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:9763
Content-Length: 571

<soapenv:Envelope xmlns:soapenv="">
<soapenv:Header xmlns:wsa="">
<ns1:getProcessInfoIn xmlns:ns1="">
<ns1:pid xmlns:s13="http://ode/bpel/unit-test">s13:HelloWorld2-2</ns1:pid>

Sunday, October 14, 2012

Installing WSO2 BPS on PostgreSQL

BPS requires two database schema's. One is for the registry and one for BPEL, Human Task engine. So we will need to create two database schema's on postgresql and grant permissions. Lets name the registry database as bpsRegistry and orchestration engine database as bps.
Step 1.
Install postgresql.
$ sudo apt-get install postgresql
Step 2.
Configure postgresql 
Edit postgresql.conf file located in /etc/postgresql/9.1/main directory and un-comment the following line
listen_addresses = 'localhost'

Step 3.
When postgres sql is installed, a user named postgres will be created. We need to login as this user in order to create our databases, add our default role to postgres and grant privileges.First login as root and then  change user to postgres user.
$ sudo su
$ su postgres

Step 4
Connect to the database and configure roles.
$ psql template1
Add default user to postgres.
template1=# CREATE USER nandika WITH PASSWORD 'password';

Step 5
Create the two databases.
template1=# CREATE DATABASE bps;
template1=# CREATE DATABASE bpsRegistry;
Now grant all privileges to database.
template1=# GRANT ALL PRIVILEGES ON DATABASE bps to nandika;
template1=# GRANT ALL PRIVILEGES ON DATABASE bpsRegistry to nandika;
you can use \q to quit.
Step 6.

Now, test the databases and run the db scripts found in wso2bps-3.0.0/dbscripts directory to create the db tables.
$ psql -d bpsregistry -U nandika;

Now run the postgresql.sql script to create the tables.
bpsRegistry=> \i /home/nandika/wso2bps-3.0.0/dbscripts/postgresql.sql
This should execute the sql script and create the database tables. 
Similarly, execute the postgres.sql in dbscripts/bps directory to create the bps database tables.

Note : you can use \? to view the available postgres sql commands.
Now we are done with configuring postgres sql. Lets configure bps db connection urls.
Step 7.

Go to repository/conf/datasources directory and edit master-datasources.xml and replace the existing H2 database configurations with corresponding postgresql configuration.
            <description>The datasource used for registry</description>
            <definition type="RDBMS">
                    <validationQuery>SELECT 1</validationQuery>
Next , open the file in repository/conf directory and all following.
synapse.datasources.bpsds.validationQuery=SELECT 1

Next, download and copy postgres sql driver to repository/components/lib directory. Now we have finished configurations. Go to bin directory and run to start BPS.

Open Source and Your Career

I consider that the golden rule requires that if I like a program , I must share it with other people.  - Richard Stallman

Open Source
Open source is a philosophy that promotes free distribution of technical information. (A products design and implementation details) The concept has been there long before the open source movements took it and popularized it. The above comment from Richard Stallman (The founder of free software foundation) explains the philosophy behind open source. The golden rule or the rule of reciprocity essentially states the following. One should treat others as one would like others to treat oneself”. When this rule is applied to software world, it is all about sharing the knowledge, code and skills such that we all can collectively benefit from it.

The difference between a job and a career is the difference between forty and sixty hours a week – Robert Frost
            A career is a chosen life goals or chosen field of expertise. To become a successful career person one has to acquire special skills from learning and training and it also requires lot of dedication and hard work to succeed.
            A job is done for the sole purpose of earning money. Jobs are performed over a fixed period time. Usually a person who is doing a job would turn up for the office in the morning; follow some routine tasks and would leave in the evening often without regard to the completion of the tasks. A career person on the other hand would consider work as an extension of himself. Often a person’s lifetime of achievements is tied to his career.
            Being an IT person means being a career person. The technologies in the industry is constantly evolving and changing and hence it requires constant learning in order to survive and succeed in the IT industry. Also all IT projects requires lot of dedication from the people involved in order to succeed. Any person who has done a product release would know how many long hours were required to get the product out.

Now having looked into the open source philosophy and what a career means, let us look at how one can benefit from open source development movement to succeed in an IT career.

Open source software is no longer a small time geek thing. There is worldwide adoption of open source software in many industries and its market share is continuing to increase.

1. There has been a huge change of direction in software adoption after the recession at the end of last decade. Most companies had to look at ways to cut down the costs in order to survive and this led CIO’s look for cheaper options of software. By adopting open source software, companies have to incur only a fraction of the cost of commercial software.

2. Open source software products are now available for wide variety of purposes and most of these products have been around and have matured enough for industrial deployment.

3. There is always some company behind an open source project and in some cases, there are many companies and hence the availability of enterprise class support. For example Linux kernel is developed in participation of large number of companies including the likes of IBM, HP, Red hat etc.

Many people come to think of open source software is developed by geek/hacker/academics programmers in their spare time. Although there is much such software, this is not the case with many mainstream open source projects. For example, following table shows the Linux kernel contribution data.

                                                Linux Kernel data ( Table )
As you can see, there are hundreds of companies behind Linux kernel and they had contributed thousands of developers to Linux kernel. This is a clear example of the amount of career opportunities that exist in the open source software industry.

Why participate in an open source project

Why would someone dedicate his time and skills to participate in an open source project? Well, there are many reasons. Advancing the state of the art in computing, to become part of a team that create great software, work with some highly talented people, being truly creative are some of the motivations behind participating in an open source project. Of course there is nothing like doing something useful and beneficial to others while learning and having fun.

What you gain
Being part of an open source project can benefit you as a student, as an IT professional in many ways.
1. Communication Skills
           Software projects need excellent communication throughout the development cycle to succeed. However, there is always lack of people who explain technical detail in a precise manner.  Open source participation is a great way to develop  written communication skills because , that is the only way you can participate effectively as the code is developed by individuals who are geographically dispersed, and communicated primarily using email.    

2. Programming Skills
Programming is a skill that is mastered by practice. Trying to read and understand good quality code is a great way to pick up coding technique and style.

3. Technical expertise and research skills
            Open source requires lot of self-learning and research due to the very nature of development style. Long term participant of an open source project can develop exceptional research skills and technical expertise that is par with the best in the world.

4. Networking
Open source development is a great way to get to know people from the industry around the world. Not only does it help you get to know some of the best minds but also you may be able to develop friendships across the globe.

5. Experience the entire software engineering lifecycle
            Software product development process consist of many parts including inception, developing code, testing, packaging , releasing , writing documentation , providing support, and maintenance.
            An engineer in a normal software company would only participate in few phases of the above process. For example a developer might participate in the development phase. A QA engineer would participate in the QA phase.
            However, in an open source project, this is entirely different. The core committer team would participate in all the phases of the product life cycle. They would be the developers, testers, release managers, support provides and bug fixes. Also they would be doing a lot of marketing activities such as blogging, presentations in the conferences etc. Hence a programmer in an open source project can develop excellent skills over time.

6. Reputation
            Unlike most developers in commercial software companies, a programmer in an open source project can claim his work and develop a reputation for himself.

7. Higher Studies.
            When students apply for higher studies overseas, the evaluators will be looking for factors to identify exceptional people. As such GPA, GRE etc. does not mean a lot as these are common to all students. However, a student programmer how has open source credentials has a distinct advantage.

8. Employment
            Some open source products have become industry standards for doing tasks. For example, svn and git are widely used as version control systems. Similarly, maven, ant are the standard build tools for many java projects. Therefore having skills in these products can be a great benefit in the jobs. Also, a programmer with open source credentials can easily land a job because, his skills are already proven and his work is out there in the open for all to see.
9. Your own business
            You can build your own company around open source software consultancy or product development. For example, by mastering php, drupal, joomla, wordpress etc., one can easily build a successful web development company.

Participating in open source.
            To become a valued open source contributor, you need two essential things.
1. Motivation.
            Open source is not an instant reward thing for a developer. It takes time and effort to become a valued member. Hence a programmer needs lots of motivation to keep going.     

2. Self-Learning
Of course you have to be a very good self-learner.

Join a project.

There are hundreds of great open source projects out there and there is great deal of opportunity waiting for you. You can contribute to an open source project in multiple ways.


Every project needs some developers, but also, they need many users. You can easily contribute by becoming an active user of an open source project. All you have to do is to download and use the product for your work. When you encounter problems, go to the product forums, mailing lists and ask questions. When you hit bugs, go to the project bug tracking system and report them. That way, not only you are benefiting but also making a contribution to the project as well. Also make sure to write blogs on how you use the product. Include your code samples as well. Many open source projects lack through documentation and hence your blog post could help many fellow developers out there.


A contributor would be a person who dig deeper into the code and fix bugs and provide patches. As a contributor, one can give new ideas to discussions, contribute additions and extensions and help in testing and documentation. Contributor is only a step away from becoming a committer.

  committer in an open source project is a programmer who commits to the source code repository. A committer's contribution consist of writing code, bug fixes, documentation additions, introduce new ideas and implement them and also participate in testing and release processes. To become a committer of an open source project, you have to demonstrate not only your technical skills but also your commitment to the project in the long term.

Your own open source project
Open source is about reuse. When Linus Torvalds started writing Linux, he did not do it from scratch. He started from Minix operating system and systematically improved it piece by piece to what finally became Linux.  Therefore, if you find some product can be improved or done in a better why, you can start your own project and develop it in a systematic way. If you have code that can be useful to others, always contribute it.  You might have some grate ideas that would change the world.

I’ve found that luck is quite predictable. If you want more luck, take more chances. —Brian Tracy

How to succeed in open source

Publish your code.
If you start your own project, there are many sites that let you host your code. Github, sourceforge and google code are some them. If you make improvements to an existing project, make sure to contribute your changes back to the project.

Show your work.
Of course, being open source means, you can claim your contributions. For example, by configuring your project with, you can show your contribution.

Writing is an essential part of being an open source programmer. You have to do your own marketing for the project. Blogging is an important part of that. Most open source foundations have their blog roll which is known as planets. Planet Apache and Planet PHP are two such examples. You can submit your blog to these blog rolls and greatly increase your visitor count. Writing articles to popular web sites is another important aspect of marketing your work. Not only you can contribute with it, but also you can earn some extra money in the process.

Let me tell you the secret that led me to my goal. My strength lies solely in my tenacity - Louis Pasteur

When we talk about success in any task, we usually take about passion, commitment, and dedication. Even though those qualities are important, when it comes to success, the single most important quality is the tenacity. That never give up attitude, that special thing that keeps you going till the end no matter what obstacles you have to face, is what matters the most.

[ My speech at Apache Meetup , Kandy ]

Monday, August 27, 2012

How to create an oracle schema ( user )

Working with oracle db is quite different from other databases because of the concepts adopted by oracle differ.

Following are the steps to create a user ( Schema ) in oracle default database known as orcl.

1. Log into oracle using SQLPlus.
C:/>sqlplus /nolog

2. Connect to the database with the desired schema name and password. Here, I am connecting with user name greg with password greg.

connect greg/greg@orcl as sysdba;

3. Now that, you are logged in to SQLPlus, create the user and unlock the account.

create user greg identified by greg account unlock;
grant ALL PRIVILEGES to greg;

If you want to connect with the Thin driver, you must specify the port number and SID.  Default SID ( system identifier ) is orcl for default orcl db. 

For example, if you want to connect to the database on host myhost that has a TCP/IP listener up on port 1521, and the SID  orcl , the connection url is.


Oracle jdbc driver is  : oracle.jdbc.OracleDriver

Always use oracle6 driver which is the latest. 

Saturday, February 18, 2012

Five principles to follow for success in learning

1. Know your outcome ( What do i  want and why)

2. Take positive action

3. Have enough sensory awareness to know if you are being effective.

4. Have behavioral  flexibility

5. Operate from a physiology and a psychology of excellence

Read more at here.


Recently, I read the book “How to measure anything” by Douglas W Hubbard. It is a real insightful book. Following are some of the excerpts from the book.

In ancient Greece , a man named Eratosthenes estimated the circumference of the earth by looking at different lengths of the shadows in different cities at noon and by applying some simple geometry.

A Nobel prize winning physicist (Enrico Fermi ) taught his students how to estimate by estimating the number of piano tuners in Chicago.

A nine year old girl (Emily Rosa) setup an experiment and debunked the growing medical practice of “therapeutic touch” and two years later become the youngest person ever to be published in JAMA.

Three reasons why people think something cannot be measured.

  1. Concept of measurement ( not understanding what measurement actually means )
  2. Object of measurement ( The thing that is being measured is not well defined. Sloppy and ambiguous language )
  3. Method of measurement ( many procedures of empirical observation are not well known. if people were more familiar with measurement methods, then it would become apparent that many things that are defined as immeasurable are not only measurable but may already have been measured. )

Definition of Measurement

Measurement => A quantitatively expressed reduction of uncertainty based on one or more observations.

Object of measurement.

A problem well stated is a problem half solved.  - Charles Kettering ( Inventor of electrical ignition for automobiles , holder of 300 parents )

Important questions to ask

    • What do you mean by <….> ?
    • Why do you care ?

Clarification chain

    • If it matters at all, it is detectable/observable
    • If it is detectable, is can be detected as an amount ( or a range of possible amounts )
    • If it can be detected as a range of possible amounts, it can be measured.

Seven proven measurement methods.

    1. Measuring with very small random samples
    2. Measuring with population of things that you will never see all of
    3. Measuring when many other, even unknown variables are involved.
    4. Measuring the risk of rare events
    5. Measuring subjective preference and values

Rule of Five

There is 93.75 chance that, the median of a population is between the smallest and largest values in any random sample of five from that population.

Four useful measurement assumptions

    1. Your problem is not as unique as you think
    2. You have more data than you think
    3. You need less data than you think
    4. An adequate amount of new data is more accessible than you think

Putting a measurement problem in context

    1. What is the decision this measurement is supposed to support.
    2. What is the definition of the thing being measured in terms of observable consequences
    3. How exactly does this thing matter do the decision being asked
    4. How much do you know about it now ( what is your current level of uncertainty )
    5. what is the value of additional information

Definition of uncertainty and risk and their measurements

    • Uncertainty: The lack of complete certainty, that is the existence of more than one possibility . The “true” outcome, state, result is not known.
    • Measurement of uncertainty : A set of possibilities assigned to a set of possibilities. For example, there is 60% chance that this market will more than double in five years. a 30% chance that, it will grow at a slower rate, and a 10% chance the market will shrink in the same period
    • Risk :  A state of uncertainty  where some of the possibilities involve a loss , catastrophe,   or other undesirable outcome.
    • Measurement of Risk : A set of possibilities each with quantified probabilities and quantified losses. “We believe there is  a 40% chance of the proposed oil well be dry with a loss of $12 million in exploratory drilling costs.

How much do you know now ?

The most important questions of life are indeed, for the most part, really only problems of probability -- Pierre Simon Laplace

Two extremes of subjective confidence

Over confidence : When an individual routinely overstates knowledge and is correct less often that he or she expects.

Under confidence: When an individual routinely understates knowledge and is correct much often than he or she expects.

Estimation of risk is a skill that can be improved by learning

Measuring risk through modeling

It is better to be approximately right than precisely wrong. - Warren Buffet

Risk Analysis though Monte Carlo Method.

Risk Paradox

If an organization uses quantitative  risk analysis at all, it is usually for routine operational decisions. The largest most risky decisions get the least amount of proper risk analysis.

The McNamara Fallacy

The first step is to measure whatever can be easily measured. This is Ok as far as it goes. The second step is to disregard that which cant be easily be measured or give it an arbitrary quantitative value. This is artificial and misleading.   The third step is to presume that what cannot be measured easily is not important. This is blindness. The forth step is to say that, what cannot be easily measured really does not exist. This is suicide.

Value of Information

Expected value of information (EVI)= Reduction of expected opportunity loss ( EOL ) or EVI  = EOL (before information ) – EOL ( After information )

Where EOL = chance of bring wrong * cost of being wrong

Expected value of prefect information ( EVPI ) = EOL (before info )

A common measurement myth

Myth : When you have lot of uncertainty, you need lot of data to tell you something useful

Fact: If you have a lot of uncertainty now, you do not need  much data to reduce uncertainty significantly ,  When you have lot of  certainty,  then you need a lot of data to reduce uncertainty significantly

Measurement Inversion

In a business case, the economic value of measuring a variable is usually inversely proportional to  to how much measurement attention it usually gets.

If your only tool is a hammer, then every problem looks like a nail.  - Abraham Maslow

Example : It is discovered that function point analysis of the cost of an IT project was no more accurate then that of the initial estimate project managers made and therefore function point analysis did not reduce any of the uncertainty of the cost estimate and hence added no value. 

Measurement methods

Decompose it. Many measurements start by decomposing an uncertain variable into constituent parts to identify directly observable things that are easier to measure.

Decomposition effect. The phenomenon that the decomposition itself often turns out to provide such a sufficient reduction in uncertainty that further observations are not required.

Assume you are not the first to measure it. ( Do internet search )

Internet search tips

1. If I am really new to a topic, I do not start with google, I start with wikipedia.

2. Use search terms then tend to be associated with research and quantitative data. ( Eg, if you need to measure software quality or customer perception, do not just search those terms alone. Instead , include terms like “table”, “survey” , “control group” “correlation” “standard deviation “

3. Think of internet research in two levels. Search engines and topic specific repositories. For example, if you are looking for statistical data use sites like census , CIA fact book ect.

4. Try multiple search engines.

5. If you find marginally related research that still does not directly address your topic, be use to read the bibliography.

Basic method of observation : If one does not work , try the next

  • Follow its trail like a clever detective. Do forensic analysis of data you already have.
  • Use direct observation. Start looking, counting, and or sampling if possible.
  • If it has not left any trail so far, add a tracer to it so it starts leaving a trail
  • If you cannot follow a trail at all, create the conditions to observe it. ( Experiment )

Willingness to pay is a measure of how much a thing is valued.

Homo Absurdus : The weird reasons behind our decisions

Anchoring : Thinking of a number affects the value of a subsequent estimate even on a completely unrelated issue. A scientist asked his subjects to write down the last for numbers of their social security number and the number of physicians in new york city. and it was found that there is .4 correlation between the estimate of physicians and the last digits of social security number.

Halo/ horns effect : if people see one attribute that predisposes them to favor or disfavor one alternative, they are move likely to interpret additional subsequent information in a way that supports their conclusion regardless of what the additional information is.

For example, if you initially have a positive impression on a person, you are likely to interpret additional information about that person in a positive light. ( the halo effect). Likewise, an initially negative impression has the opposite effect ( The horns effect )  This effect happens even when the initially perceived positive or negative attributes should be unrelated to subsequent evaluations.

Bandwagon bias : When within the group of people, people are likely to follow what others seem to follow.

Emerging preferences: Once people begin to prefer an alternative, they will actually change their preferences about this additional information in a way that supports the earlier decision.

Measuring text ratability in lexile

New technology measures

Prediction Markets (Dynamic aggregation of opinion) can be used to measure people option.

Summarizing the philosophy

It it is something really important, it is something you can define. If it is something that exist at all, its something you have observed somehow.

It is is something important and something uncertain , you have a cost of being wrong and a chance of being wrong

You can quantify your current uncertainty with calibrated estimates.

you can compute the value of additional information by knowing the “threshold” of the measurement where it begins to make a difference compared to your existing uncertainty.

Once you know what's worth to measure something you can put the measurement effort in context and decide on the effort it should take. 

Knowing just a few methods of random sampling , controlled experiments, or even merely improving on the judgment of experts can lead to a significant reduction in uncertainty

Saturday, February 4, 2012

Nice tool to deal with Key Stores

Really nice tool to manipulate key stores. It provides facilities to even export the private key from jks.

Thursday, January 19, 2012

The Law of Requisite Variety

"The variety in the control system must be equal to or larger than the variety of the perturbations in order to achieve control"

This simply means that a flexible system with many options is better able to cope with change. One that is tightly optimized for an initial set of conditions might be more efficient whilst those conditions prevail but fail totally should conditions change.