Backend Development 18 min read

Implementing a Student Leave Approval Workflow with Flowable and Spring Boot

This article provides a step‑by‑step guide to building a student leave approval process using Flowable BPMN, Spring Boot 2.7.5, MySQL, and related dependencies, covering environment setup, Maven configuration, application properties, Java classes, REST endpoints, diagram generation, and database tables.

Top Architect
Top Architect
Top Architect
Implementing a Student Leave Approval Workflow with Flowable and Spring Boot

In this tutorial a top‑level architect walks through creating a complete leave‑approval workflow for students using Flowable and Spring Boot. The guide starts by listing the required environment (JDK 1.8, Maven 3, SpringBoot 2.7.5, Flowable 6.6.0, MySQL 8) and the Maven <properties> , <parent> , and <dependencies> needed for Flowable, MySQL, MyBatis, Lombok, and testing.

The application.properties file is shown with server port, Flowable UI admin credentials, database connection URL, and logging configuration, emphasizing the necessity of the &nullCatalogMeansCurrent=true flag for automatic table creation.

A custom FlowableConfig class is provided to set Chinese fonts for generated process diagrams, preventing garbled characters. The configuration implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> and overrides the configure method.

Result and TaskVO value objects are defined using Lombok annotations to encapsulate API responses and task list items.

The core LeaveController exposes REST endpoints for submitting a leave request, listing teacher and dean tasks, approving or rejecting tasks, re‑submitting, and generating process diagrams. Each endpoint interacts with Flowable services ( RuntimeService , TaskService , RepositoryService ) and returns a standardized Result object.

Diagram generation uses Flowable's ProcessDiagramGenerator to stream a PNG image of the current process state, handling cases where the process has already finished.

The BPMN XML definition ( stuLeave ) is included, showing start event, user tasks for student submission, teacher approval, a decision gateway based on leave days, dean approval, end event, and conditional sequence flows for approval and rejection.

Finally, the article explains Flowable’s table prefixes (ACT_RE, ACT_RU, ACT_HI, ACT_GE, ACT_ID) and how they store repository, runtime, history, general, and identity data, with a note on monitoring task IDs via the ACT_RU_TASK table.

BackendJavaworkflowBPMNSpringBootFlowable
Top Architect
Written by

Top Architect

Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.

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.