https://grokonez.com/java-integration/activiti-rest-api-spring-boot-example

How to implement Activiti REST API with Spring Boot Example

In this tutorial, we’re gonna look at an example that uses Activiti REST API with Spring Boot.

Related Articles:

I. Activiti REST API Overview

Activiti Engine includes a REST API that can be used by: - deploying the activiti-rest.war file to a servlet container, - or including the servlet and it’s mapping in the application and add all activiti-rest dependencies to the classpath.

By default the Activiti Engine will connect to an in-memory H2 database, so with Spring Boot, we just need to add dependency as below to make it run:

<dependency>
	<groupId>com.h2database</groupId>
	<artifactId>h2</artifactId>
</dependency>

<dependency>
	<groupId>org.activiti</groupId>
	<artifactId>activiti-spring-boot-starter-basic</artifactId>
	<version>5.22.0</version>
</dependency>

<dependency>
	<groupId>org.activiti</groupId>
	<artifactId>spring-boot-starter-rest-api</artifactId>
	<version>5.17.0</version>
</dependency>

Activiti REST API supports:

  • Deployment: get/create/delete Deployments, get resources inside a Deployment.
  • <li><strong>Process Definition</strong>: get one or list of Process Definitions, get resource content or BPMN model of a Process Definition, activate/suspend, get/add/delete candidate starters.</li>
    
    <li><strong>Model</strong>: get/update/create/delete Models, get/set editor source for a Model.</li>
    
    <li><strong>Process Instance</strong>: get/delete/activate/suspend Process Instances, add/remove Users, get/create/update Variables.</li>
    
    <li><strong>Execution</strong>: get Executions, execute an action or get active activities, query, get/create/update Variables.</li>
    
    <li><strong>Task</strong>: get/update/delete Tasks, query for Tasks, get/create/update Variables, get/create/delete identity links, get Events, get/create/delete Attachments.</li>
    
    <li><strong>History</strong>: get/delete/query for Historic Process Instances, Task Instances, Activities Instances, Variables Intances.</li>
    
    <li><strong>User</strong> & <strong>Group</strong>: get/create/update/delete information.</li>
    
    <li><strong>Database Table</strong>, <strong>Engine</strong>, <strong>Runtime</strong>, <strong>Job</strong>...</li>
    
For more details, please visit: Activiti User Guide - REST API

In the example, we will test some of them to see how it works.

II. Practice

1. Technology

- Java 1.8 - Maven 3.3.9 - Spring Tool Suite – Version 3.8.4.RELEASE - Spring Boot: 1.5.3.RELEASE

2. Step by step

2.1 Create Spring Boot project

Using Spring Tool Suite/Eclipse to create Project and add Dependencies to pom.xml file:

https://grokonez.com/java-integration/activiti-rest-api-spring-boot-example

How to implement Activiti REST API with Spring Boot Example

#activiti #springboot #restapi

How to implement Activiti REST API with Spring Boot Example » grokonez
2.45 GEEK