(For more resources related to this topic, see here.)
Getting started with Activiti BPM
Let’s take a quick tour of the Activiti components so you can get an idea of what the core modules are in the Activiti BPM that make it a lightweight and solid framework. You can refer to the following figure for an overview of the Activiti modules:
In this figure, you can see that Activiti is divided into various modules. Activiti Modeler, Activiti Designer, and Activiti Kickstart are part of Modelling, and they are used to design your business process. Activiti Engine can be integrated with your application, and is placed at its center as a part of Runtime. To the right of Runtime, there are Activiti Explorer and Activiti Rest, which are part of Management and used in handling business processes.
Let’s see each component briefly to get an idea about it.
The Activiti Engine is a framework that is responsible for deploying the process definitions, starting the business process instance, and executing the tasks.
The following are the important features of the Activiti Engine:
- Performs various tasks of a process engine
- Runs a BPMN 2 standard process
- It can be configured with JTA and Spring
- Easy to integrate with other technology
- Rock-solid engine
- Execution is very fast
- Easy to query history information
- Provides support for asynchronous execution
- It can be built with cloud for scalability
- Ability to test the process execution
- Provides support for event listeners, which can be used to add custom logic to the business process
- Using Activiti Engine APIs or the REST API, you can configure a process engine
- Workflow execution using services
You can interact with Activiti using various available services. With the help of process engine services, you can interact with workflows using the available APIs. Objects of process engines and services are threadsafe, so you can place a reference to one of them to represent a whole server.
In the preceding figure, you can see that the Process Engine is at the central point and can be instantiated using ProcessEngineConfiguration. The Process Engine provides the following services:
- Repository Service: This service is responsible for storing and retrieving our business process from the repository
- Runtime Service: Using this service, we can start our business process and fetch information about a process that is in execution
- Task Service: This service specifies the operations needed to manage human (standalone) tasks, such as the claiming, completing, and assigning of tasks
- Identity Service: This service is useful for managing users, groups, and the relationships between them
- Management Service: This service exposes engine, admin, and maintenance operations, which have no relation to the runtime execution of business processes
- History Service: This service provides services for getting information about ongoing and past process instances
- Form Service: This service provides access to form data and renders forms for starting new process instances and completing tasks
The Activiti Modeler is an open source modeling tool provided by the KIS BPM process solution. Using the Activiti Modeler, you can manage your Activity Server and the deployments of business processes. It’s a web-based tool for managing your Activiti projects. It also provides a web form editor, which helps you to design forms, make changes, and design business processes easily.
The Activiti Designer is used to add technical details to an imported business process model or the process created using the Activiti Modeler, which is only used to design business process workflows. The Activiti Designer can be used to graphically model, test, and deploy BPMN 2.0 processes. It also provides a feature to design processes, just as the Activiti Modeler does. It is mainly used by developers to add technical detail to business processes. The Activiti Designer is an IDE that can only be integrated with the Eclipse plugin.
The Activiti Explorer is a web-based application that can be easily accessed by a non-technical person who can then run that business process. Apart from running the business process, it also provides an interface for process-instance management, task management, and user management, and also allows you to deploy business processes and to generate reports based on historical data.
The Activiti REST provides a REST API to access the Activiti Engine. To access the Activiti REST API, we need to deploy activiti-rest.war to a servlet container, such as Apache Tomcat. You can configure Activiti in your own web application using the Activiti REST API. It uses the JSON format and is built upon Restlet. Activiti also provides a Java API. If you don’t want to use the REST API, you can use the Java API.