JMX feature added to Activiti

I just contributed the JMX support feature to Activiti. It is merged and will be available in the coming release (release 5.16.4) of Activiti.

It is specially useful for people in operation teams. It reveals performance information and enables the operator to change some parameters on the fly.

To enable the feature it is enough to add the activiti-jmx module to dependencies. Jmx Mbean server will be automatically found and configured with the default settins.

Default configuration makes the JVM instance visible in Jconsole. If it is not visible for any reason, it can be found using this url: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi/activiti using jconsole. By default Mbeans are exposed in org.activiti.jmx.Mbeans path.

As of now these informations and operations are available via JMX:


  • getting process definitions
  • getting deployment


  • Undeploy
  • suspend, activate process definitions by id and key

Default configuration can be changed by putting these parameters in config file or setting them directly via API:

  • registryPort (Default is 1099)
  • mbeanDomain (default is “DefaultDomain”)
  • connectorPort
  • serviceUrlPath (Default is /jmxrmi/activiti)
  • createConnector (default is true)
  • disables (default is false)
  • domain (default is org.activiti.jmx.mbeanObjectDomainName)

New Mbeans are easy to add thanks to created JMX annotation. You need only to annotate attributes with @ManagedAttribute and methods with @ManagedOperation. The only possible annotation parameter is “description”. The given description will be shown as Mbean description.

There are test cases, which bring up the jmx server and actually query and change the information via JMX. They can be used as the sample for have a taste of what a jmx client can look like.
DeploymentsJMXClientTest and JobExecutorJMXClientTest are such test cases.

A short history of model designer

It all started by work of  “Prof. Dr. Mathias Weske” from University of Potsdam. He and his colleagues started an open source general purpose web based designer named as Oryx Project.
Orxy uses raphael js library for showing graphics and offers a generous GPL license.
In May 2009 the same team, established Signavio company to enhance and sell the solution. This caused the good oryx prject to be stopped.
Activiti, coming from old JBPM project, was using an eclipse based designer from its first versions. Activiti switched to Signavio probably in 2010 and more or less forgot the eclipse plugin.
After some time activiti modeler development moved to commercial KIS-Project.
Again after some months efforts moved to “Alfresco Activiti” in the form of commercial cloud services.
It is officially stated that Activiti Modelers are not going to be maintained. Only minor donated bug fixes will be merged with the code and actually in the last two years there has not been much activiti around it.

Branched Comunda is using eclipse based designer till today, but they have also started to create their own web based designer, this time from scratch and not depending on orxy. The project name is It seems to be in its early stages.

It may be worth mentioning what other workflow providers use:
Intalio uses an eclipse based designer, very similar to the one used by activiti.
JBPM: uses a branch of orxy editor.

PS: There is a good related post here, a little bit old though.

Updating git from svn

I just had to improt a huge svn repository into git.
If you spend enough time on importing, importing with git svn clone is not that hard. It keeps the history, and works very good.
The problem arose when I tried to remove big jar files from the repository. I planned to move it to maven and it was not a good idea to keep jar files in repository.
Simple removing them, left the footsteps in the history and made it unncessarily big.
I tried to rewrite history the way explained here. It took more than one week. I cancelled it.
This tools helped me:

It is rally fast and efficient. It did the job in matter of hours.

I cleane it up and pushed it into repository. Afte one week I found out, the team has done some commits on old svn.
using svn git, meant to import every thing from scratch.
I decided to write a python script, create one patch for each svn revision. Then applying them and commiting with the same description as subversion. It needed some manual work but was much faster than importing the whole svn

How to mock web services

In black box testing, sometimes we need to test a system which consumes and produces web services. Here is my experience on how to test such a system.

you need to call a the exposed web service and check how the consumed webs services are called. Exposed web service is already provided by the system, and you need only a client to call it. I used CXF. very straight forward and easy.

But the consumed web services are not there yet. They are not in the scope of tests and mostly not in our control at all.

One approach is to create fix implementation of thos web services, again using a library like CXF and  when the callback functions are called, check that the parametrs are passed correctly and resturn a suitable result for test of other parts at the same time.

This approach works fine only for the simplest cases. If you want to test different scenarios, the fixed mock web service should react differently and you have to put the logic inside it. Sometimes you meay need to have more than one implementation and re-publish the service with the alternative implementations. Not beautiful I admit.

A more beautiful approach is to use mocking frameworks. Here I have selected Mockito.

Here are the steps:

First you have to create a mock object, a normal one based on the service interface. I do it via annotation. like this:

static ServiceInterface serviceMock;

But this should be called from a web service. For any strange reason, it could not be done directly. I had to create a reflecter class to do the job:

public class ServiceProxy implements java.lang.reflect.InvocationHandler {
    private Object obj;

    public static Object newInstance(Object obj) {
        return java.lang.reflect.Proxy.newProxyInstance(
            new ServiceProxy(obj));

    private ServiceProxy(Object obj) {
        this.obj = obj;

    public Object invoke(Object proxy, Method m, Object[] args)
        throws Throwable {
        Object result;
        try {
            result = m.invoke(obj, args);
        } catch (Exception e) {
            throw new RuntimeException("unexpected invocation exception: " +

        return result;

then it is easy, you can define your web service mock and start it.

service = (ServiceInterface)         ServiceProxy.newInstance(serviceMock);
serviceEndpoint = Endpoint.publish(
				"http://localhost:8080/myService", service);

Every thing is ready now. you can run the system and use the mock, just like a normal mock.
As an example of the usage, this code tests if a method is called in web service. Obviously all the mock language of Mockito can be used for more complex tests.


Enjoy your testing !

To present it in a more concrete way I have created a sample usage. It could be found here:

There is also a worldline version. It uses resource locator to find web service.

Synchronous and Asancronous binary tree comparison

if you have not taken “Principles of reactive programming” course about advanced Scala and Aker framework, probably you are not using internet properly, think again. It is a wonderful course from EPFL, one of the hardest in Coursera.

To pass this course you have to complete some programming excersized. One of them is “Actor Binary Tree”, In this example you have to implement an asynchronous search binary tree. When you insert a node, it is distributed asynchronously through the tree. Nothing is locked and this makes it really fast. The sender actor gets acknowledged when the insertion is done.

In theory the idea is really beautiful,  but how useful is it in reality? Why we have to use this relatively complex architecture. The answer is that because it is asynchrouns nothing is locked and you should have a very high performance.

But how it comares with a similar pure java implementation ? For consistency usually we lock the tree. That definitely will not compete. But if we use an immutable version we do not need to worry about the consistency.

To do the comparison I searched and found an immutable binary tree in Kansas State University.

To compare I will insert large numbers of nodes in both implementations and wait untill all are acknowledged and measure the time. In Java implementation different number of threads is tried.



The maximum TPS of Scala version is 2952 and java version 2701739, more than 90 times.

So the conclusion is, at least if the operation itself is fast and not IO intensive, it is no use in usage of asynchronous type of programming. The overhead of aker is considerable if the operations themselves are fast.


The source for java implementation is available in github.



Scala, Scala

It is a while I am following courses on coursera. It is really amazing.

Right now I am followin “Principles of reactive programming”. I have to say it is just fascinating !

Programming assignments are anything but easy. Needs a lot of time.

Idea of Future, Response and observables  are so natural. I have to do a comparison to the same facilities in Java and Python.

I really recommend the courses.

Expression Language Validation

We used juel as an expression language EL implementation in one our projects. The problem we had, was that we could not afford waiting for the expression to be checked at runtime. For example if you are accessing a pojo field, and that field does not exist, they you only know it in runtime.

To fix this, I created an extension and added a validate method. This method traverses the tree and checks all possible options to make sure the expression is valid with given objects.

I offered the new extention to the community, but they thought it is better to keep the Juel to minimum required to match the standard.

I am going  to publish as an extension to Juel in seperate branch. Maybe someone else also can make use of it. Not planned yet though.

Python Library for bluetooth

Just for its fun, I have started to build a remote control robot, using

– Mindstorm

– Raspberry pi

– Camera

– Joystick

– python

First step is to read joystic in python. I checked pygame.joystick and it works fine.

Sending values to NXT over Bluetooth is not that simple. There are not much on we. I checked jaraco.nxt . The source looks very sophisticated and a large range of commands are supported. For me it did not work for any reason.

Second attempt was “Roboter Platform“. A simple low library which works. Does not cover all commands but works find for what I want. The good part is it is very easy to see how things work and expand it.

Now I am able to send information in Message formats to NXT. The next step would be to control the movement of Robot with Joystick.


DBVisualizer custom JDK

VisualDB is a handy tool to browse and check the Database schemes. It is not the most fancy and powerful tool available though.

One of my colleagues had a problem of installing new JDK and seems that Visual-db had some problems with Java 7. So the question is how to make visual-db use a specific version of JDK.

I am not if this is documented some where or not, but took some time for him to solve the problem.

The solution is to copy the JDK directly in its directory. Visual-db, will use the jdk in its own directory if available. If there is no JDK in directory, then it uses the default JDK installed on machine. In our case, the name of the directory was jre and it was directly inside visual-db directory. It works  fine with version 5 and 6 of Java but maybe not with latest version 7.

MDA Approach for Card Scheme conversion

The idea is to use MDA approach for conversion of one card schema to the other one. The traditional way is to write java code field by field. What I suggested is to use MDA (Model Driven Approach) for the conversion. The idea is to define the model in a kind of object model, use XML to make the model and create the framework to execute the mode.

During the implementation I understood that usage of standard EL (Expression Language) would be very handy and I successfully tried Juel.

In this way, the conversion rules are much more meaningful and understandable. It is also possible to change them dynamically without recompiling.

There is only one important negative point and that one is type safety. Not all expression in Juel are checked against syntax in type of loading. My next task on this subject is to find how can I guaranty type safety, at least at the same level as java code.