Skip to content

vfadeevGit/artgallery-demo

Repository files navigation

Public Service Automation Demo (Jmix + BPMN)

This repository contains a demo project showcasing how to build a process-driven public service automation system with Jmix, BPMN 2.0, and supporting tools.
It is based on the tutorial “Simplifying Process Automation of Public Services: Develop Smart, not Hard”.

The scenario demonstrates how to accept public requests (e.g., artist portfolio submissions for an Art Gallery), process them through a workflow, and manage approvals/rejections via an admin panel.


🚀 What is Jmix?

Jmix is a Java-based application development platform designed for enterprise software.
It provides:

  • Model-driven development for data-centric apps
  • Visual BPMN designer for workflow automation
  • Add-ons for REST APIs, security, reporting, email, geospatial data, and more
  • Enterprise-grade security built on Spring Boot

This demo specifically uses:

  • Jmix BPM Add-on → to model and execute BPMN 2.0 workflows
  • Jmix REST API Add-on → to expose backend endpoints
  • Jmix Studio → to generate UI screens, process forms, and boilerplate code

🏗 Project Overview

The project demonstrates:

  • A public website where users can submit requests (built with GrapesJS)
  • An NGINX webserver running inside Docker to serve the static site
  • A Jmix backend application to:
    • Persist incoming requests
    • Trigger BPMN workflows on submission
    • Provide an admin UI to manage requests
    • Execute process-driven tasks (approve/reject)

Workflow example:

  1. User submits a request (Name, Email, Portfolio).
  2. The request is stored in the Jmix backend as a PublicRequest entity.
  3. A BPMN process instance starts automatically.
  4. A supervisor reviews the request via a generated process form.
  5. The request is either approved or rejected, and the process finishes.

📂 Project Structure (IntelliJ IDEA / Jmix Studio)

src/
 └── main/java/com/haulmont/artgallerydemo
     ├── entity/                # JPA entities (e.g., PublicRequest)
     ├── service/               # Application services (PublicService, DataService)
     ├── bpm/                   # BPMN process models
     ├── listeners/             # Event listeners (PublicRequestEventListener)
     └── security/              # Security configuration
resources/
 ├── application.properties     # Jmix and Spring Boot config
 └── bpm/                       # BPMN process definition XML files

Key classes:

  • PublicRequest → Entity storing request data
  • PublicService → REST controller (@RestService + @RestMethod)
  • DataService → Service for persistence logic
  • PublicRequestEventListener → Starts BPMN process on entity save
  • ArtgalleryDemoSecurityConfiguration → Allows anonymous access to public REST endpoints

⚙️ Prerequisites

  • Java 17+
  • IntelliJ IDEA (Community or Ultimate) with Jmix plugin
  • Docker Desktop (for NGINX webserver)
  • Node.js (optional, for editing GrapesJS site)

🛠 Setup & Run

1. Clone the repository

git clone https://github.com/<your-org>/public-service-automation-demo.git
cd public-service-automation-demo

2. Start the NGINX web server

docker run -it --rm -d -p 8181:80 --name webserver \
  -v ~/GrapesJS-Demo/site-content:/usr/share/nginx/html nginx

3. Run the Jmix backend

./gradlew bootRun
  • Backend UI: http://localhost:8080
  • REST endpoint: POST http://localhost:8080/rest/services/public/create

4. Try it out

  • Open the website form (http://localhost:8181)
  • Submit a request
  • Check the Public Requests menu in the Jmix app
  • Follow the BPM – Process Instances menu to see workflow progress

📚 Learnings from this Project

  • REST Integration: Build REST controllers the Jmix-native way (@RestService).
  • Persistence: Use DataManager to save and retrieve entities.
  • Process Automation: Trigger BPMN processes via entity events.
  • UI Generation: Create process-driven forms with Jmix Studio.
  • Security: Configure anonymous access for public APIs.

🔗 Useful Links


📜 License

This project is provided for educational and demonstration purposes.
Feel free to fork and adapt it for your own public service automation scenarios.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors