Activiti is a Workflow Mangement System (WfMS) that is completely written in Java. Activiti is a opensource-project initiated by alfresco. Activiti is based on a Process Virtual Machine (PVM). Simplified the PVM can execute graphs consisting of nodes and transitions. Based on this abstraction several graph-based languages can be implemented. Activiti implements BPMN 2.0 and is therefore one of the first Worflow-Engines that is able to execute BPMN 2.0.

Activiti is very flexible and can be easily extended to fit custom needs. One important customization can be done by creating an ActivityBehavior. ActivityBehaviors reflect the behavior of nodes executed by the PVM. The so called ServiceTask-activity has an attribute in its xml-representation that specifies the behavior of this Activity. It looks like this:

<serviceTask activiti:class="MyImplementation" ... >

The class MyImplementation.class or a jar containing the class have to be in {TOMCAT_HOME}/webapps/activiti-rest/WEB-INF/lib/. During runtime Activiti instantiates this class by reflection. But lets continue on how to implement the MyImplementation class.

The implementation should extend org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior. The activiti-engine executes public void execute(ActivityExecution execution) during runtime so if you want to realize custom behavior you have to override this method. At the end you should call leave(ActivityExecution execution) that tells the Engine that the activity is completed.

Some details on the concept “PVM” can be found here

You will be surprised to read about jBPM while I talked about Activiti above. jBPM 4 is also based on a PVM. The lead-architect of the Activiti-Engine is Tom Baeyens. He was a developer of jBPM before he started the work on Activiti. I think he is the/one father of the PVM-abstraction.

Sorry, the comment form is closed at this time.

© 2011 Softwareengineering in practise Suffusion theme by Sayontan Sinha