Databases 21 min read

Activiti Workflow Engine Database Design

Activiti is a BPMN workflow engine that provides components such as Process, Repository, Runtime, Task, and History services, stores definitions, runtime data, and history in a relational database schema, and is used by deploying BPMN diagrams, starting instances, and managing tasks via its Java API.

Java Tech Enthusiast
Java Tech Enthusiast
Java Tech Enthusiast
Activiti Workflow Engine Database Design

Activiti is a workflow and Business Process Model and Notation (BPMN) engine that provides a comprehensive solution for workflow management. This article covers the basics of Activiti, including its components, database design, and usage examples.

Activiti Components: Activiti consists of several key components: Process Engine, Repository Service, Runtime Service, Task Service, and History Service.

Database Design: Activiti uses a relational database to store process definitions, runtime data, and historical records. The database schema includes tables for process definitions, runtime data, and history.

Basic Usage: To use Activiti, first deploy the BPMN process diagram using the Repository Service. Then, start a process instance using the Runtime Service. Tasks can be created and completed using the Task Service. The History Service allows querying historical data.

ProcessEngine engine = ProcessEngines.getDefaultProcessEngine(); RepositoryService repositoryService = engine.getRepositoryService(); repositoryService.createDeployment().addClasspathResource("processes/apply.bpmn").deploy(); ProcessInstance instance = runtimeService.startProcessInstanceByKey("apply_processor_1", variableMap); Task firstTask = taskService.createTaskQuery().taskAssignee("zhang3").singleResult(); taskService.complete(firstTask.getId(), Maps.newHashMap("day", 4));

JavaworkflowBPMNDatabase DesignActivitiprocess-engine
Java Tech Enthusiast
Written by

Java Tech Enthusiast

Sharing computer programming language knowledge, focusing on Java fundamentals, data structures, related tools, Spring Cloud, IntelliJ IDEA... Book giveaways, red‑packet rewards and other perks await!

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.