Simple Process Using Activiti

Introduction

Recently I came across this interesting area, “business processes and workflows”. Going further from simple workflows, this is a vast area to explore. There exists numbers of workflow engines which provides generic functionality to develop workflows for any use-case. In this article, I am discussing about my first experimental work done with Activiti [1]. For this experiment I have used version 5.18.0 (latest at the moment is 6.0.0).

Prerequisites

At first you need to install Java JDK and Tomcat in your machine. Then you need to download Activiti from official website [1], or github [2]. Copy activiti-explorer.war and activiti-rest.war files in to the webapps folder of Tomcat. Finally start the Tomcat and go to URL: http://localhost:8080/activiti-explorer. To login use demo user Kermit. (username: kermit, password: kermit)

Use-case

The use-case I’m going to discuss is a software feature development process of a small company. For this example, let’s assume there are 3 roles in the company as developers; who write codes, tech-leads; who review the code and QAs; who test the code. So the team members are as follows:

Developers: Mike, Jack

Tech-leads: Chris, Brian

QAs: Sandy, Alice

To cater this requirement, you have to go to “Manage” and use “groups” and “users” tabs to set up user accounts ans assign users to groups.

Implementation

Let’s develop this scenario with Activiti. Go to “Processes” tab, “Model Workspace” and start creating a new model. Activiti Explorer provides a convenient web-UI to develop models. You can drag and drop elements from panel and create the desired workflow. You can get the explanation about each element from the User Guide [3].

Final workflow looks like follows:

workflow

In the process I have used 3 User Tasks;

Develop features: assigned to “developers” group

Code Review: assigned to “tech-leads” group

Quality Checking: assigned to “qas” group

In addition to assigning, I have put form properties for Code Review and Quality Checking to indicate the user’s opinion.

Once you save the model, you can deploy it using the Activiti Explorer and “Deployed Process Definitions” shows the deployed model. You can start a process by clicking “Start process” button on top right.

activiti-ui.png

Now the process goes as described in the workflow model. You can open new web browser and login as one of the developers and claim the task. Once a developer completes the task, tech-leads and QAs can complete their tasks respectively. Below figure depicts the view of a developer.

jack's view

So, I have discussed a very brief amount of things that you can do with Activiti, but there’s much more.

Activiti access with Java: https://www.activiti.org/userguide/#_rest_support
(You need to sync activiti-explorer and activity-rest web apps to view results in activiti-explorer)

Explore history: https://www.activiti.org/userguide/#history

Eclipse designer: https://www.activiti.org/userguide/#activitiDesigner

Activiti REST API: https://www.activiti.org/userguide/#_rest_api

Conclusion

This post is to give you a start up with Activiti workflow engine. You can associate Activiti with your application and design flexible workflows according to your necessity.

References

[1] https://www.activiti.org/

[2] https://github.com/Activiti/Activiti/releases

[3] https://www.activiti.org/userguide/#bpmnConstructs

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s