Sunday, April 19, 2009

How to build ORYX editor in Ubuntu


Oryx editor is a web based BPMN (Business Process Modeling Notation) editor. Oryx is a project of the Business Process Technology research group at the Hasso Plattner Institute of IT Systems Engineering at the University of Potsdam, Germany. The research group is led by Professor Mathias Weske, as is the Oryx project.
This blog is focused on building Oryx from the source in Ubuntu.

RequirementsJ2SE 5 Java Runtime Environment or higher
SubVersionApache Tomcat server (5.5 or higher)
Apache Ant 1.6 or higher
Checkout the sourceFirst you have to check out the source from the SubVersion repository

svn checkout oryx-editor-read-only

After checking out the source you have to build the source using Ant. But before that you need to configure the database server which used to store the Oryx business process models. Here I have described on configuring the PostgreSQL database server.

Configure the PostgreSQL database 1.Install PostgreSQL sudo apt-get install postgresql-8.3 postgresql-plpython-8.3

2.Then we have to configure the database such that it does not require passwords for local tcp connections. Before that if the database server is started you have to stop it using the following command.
/etc/init.d/postgresql-8.3 stop
3.For that client authentication configurations for the database have to be changed. Traditionally these configurations are stored in pg_hba.conf file located at /etc/postgresql/8.3/main.

Modify the configurations as follows.

# Database administrative login by UNIX sockets
local all postgres ident sameuser


# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all trust
# IPv6 local connections:
host all all ::1/128 md5

4.Then start the database using the following command
/etc/init.d/postgresql-8.3 start

5.Now using the following commands you have to create a user called “poem” without password.
su postgres
createuser --superuser --echo poem

Now PostgreSQL database configuration process is completed such that there is user called “poem” which can connect to the database without passwords and database server trusts all the tcp local connections. Now all the requirements for the building process are completed.

Building the source

Before building the source you need to modify the configuration file located at the root of Oryx source. You need to change “deploymentdir” in to the full path to the tomcat deployment directory.
eg. deploymentdir = /opt/installations/tomcat1/apache-tomcat-6.0.18/webapps
If you go into the root of Oryx source directory you may see a dependency graph (build-dependencies.png) which depicts on how the Ant targets are inter-dependent.

Now using the following command the Oryx source can be build.
ant rebuild-all
Like wise using the ant targets you can compile, clean, build, deploy Oryx.

As well you have to create the database which stores the Oryx business process models using the following commands.
/etc/init.d/postgresql-8.3 start
ant create-db
In this case if you have configured the PostgreSQL database server correctly, no password will be asked during the database creation and the database will be created without an error.

Then to deploy the Oryx editor use the following commands.
ant deploy-all
Now if you go in to the tomcat deployment directory you may see two WAR distributions called backend.war and oryx.war. Extract both of them. Now by starting the tomcat engine you can deploy the Oryx editor.

Finally you can open the Oryx model repository in Firefox3.

How to play with software patches.

In an open source world, if you are interested in contributing to an open source project by developing the source code first of all you need to build the source code. Then you have to submit the code you developed for that project through a patch or directly changing the code. If you are not a commitor for that project you can't directly change the source code. A commitor is a person who has source code modification rights for a open source project. If you are not a commitor then you have to submit what you have done through a patch.
A patch is a textual format file which contains the modifications has been done related to the original source code of a software project in open source terms. An example of an patch is as follows.

Index: Rakefile
--- Rakefile (revision 752423)
+++ Rakefile (working copy)
@@ -175,6 +175,12 @@
web_inf.merge project("dao-hibernate-db").package(:zip)
web_inf.include project("axis2").path_to("src/main/wsdl/*")
web_inf.include project("bpel-schemas").path_to("src/main/xsd/pmapi.xsd")
+ web_inf.include project("bpel-schemas").path_to("src/main/xsd/dmapi.xsd")
+ web_inf.include project("bpel-schemas").path_to("src/main/xsd/breaks_bdi_bpel.xsd")
+ web_inf.include project("bpel-schemas").path_to("src/main/xsd/common_bpel.xsd")
+ web_inf.include project("bpel-schemas").path_to("src/main/xsd/java_util.xsd")

In a patch file it contains details on what lines have been added with a “+” sign and what lines have been removed with a “-” sign.

Let see how to create an patch file first. As I mentioned earlier first of all you have to build the source code of the project. Here you may use an version controlling software like “SubVersion” to manage and update your local source code with the online source code repository. This version controlling tool can used to create a patch for the modifications what you have done in your local source code. In SubVersion the command is as follows.

svn diff > bug-x-free.patch

The above command will create a patch file named “bug-x-free.patch”. For more details on creating custom patches can be found on here.
Then that patch file can be submitted through the particular project issue tracker (like JIRA, Bugzilla etc.)
Then the patch will be examined by a project commitor and added to the source code.
Note: Be careful to test the local modified source code whether it's working OK before submitting the patch.

Suppose you need to add a patch file to your local source code, then you can use the following command at the root of your source directory to add the patch the source code.

patch -p0 -i bug-x-free.patch

Then your source code will be modified based on the patch file.

Suppose then you want to revert the patch you added. The reverting functionality is not supported by patch command it-self. Then what you can do is to interchange the “+” with “-” in the patch file to revert the changes as those “+” and “-” signs are used to denote the added code line and removed code lines in the source code. Then again by using the above patch command you can revert the modifications occurred by the original patch file.

Sunday, April 12, 2009

Remarkable performances made by Sri Lanka in GSOC

When I went through the Google Summer of Code statistics for last four years I observed the remarkable performances made by Sri Lankan students. Especially the University of Moratuwa has become the top university for the number of accepted students for GSOC projects over the last four years with a count of 57.
This is because the Computer Science and Engineering department of University of Moratuwa promotes the students to participate to this competition. Especially the open source software organizations like WSO2 Inc. and Lanka Software Foundation promote and guide students on applying for GSOC. Though there are very few open source software organaizations located in Sri Lanka, the contribution they have made with the participation of University of Moratuwa towards this remarkable success is marvelous.
Finally I congratulate all the Sri Lankan students who were accepted in GSOC for last 4 years and made this small island, Sri Lanka into a rising star.

Wednesday, April 1, 2009

How to build Apache ODE trunk and 1.x branch using Apache Buildr

Before building a source first of all the source should be downloaded from an on-line repository or off-line source distribution. On-line repositories contains the latest updates to the code. So if your intention is to develop the source code downloading the source from on-line repository will be recommended.
Here I have described how to build the source from the on-line repository.
Apache ODE(Orchestration Director Engine) supports for “Subversion”. So first of all you have to install it.
Then use the command
svn checkout ode-1.X
to download the source.

Then you can build the source. But for that you need Apache Buildr as the build tool. Go for the Buildr installation guide if you haven't installed Apache Buildr.

Then using the command “buildr _1.2.10_ clean install TEST=no” you can build Apache ODE 1.x branch.

Or If you want to build Apache ODE from trunk then use the following command.
svn checkout ode-trunk
Now you have the source of ODE trunk. But you may need to install another version of Buildr which is >=1.3.2.Then using the command “buildr clean install TEST=no” you can build Apache ODE trunk.