Imixs Micro is a lightweight distributed workflow management system based on the Imixs-Workflow technology. This system can be used, for example, as a workflow service in an industrial production plant.
This repository contains the architecture and implementation details for a distributed workflow management system designed for industrial applications. The system consists of an enterprise-process-management layer and multiple micro-process-management layers used in production workstations. The messaging between the different services is utilizing a combination of WebSocket communication and REST APIs for efficient and scalable operations.
-
Enterprise-Process Server
- Runs Imixs-Workflow engine on a Jakarta EE server
- Manages high-level processes (e.g., customer orders)
- Communicates with workstations via WebSockets and REST
-
Micro-Process Workstations
- Raspberry Pi-based interfaces for production equipment
- Running lightweight Imixs-Workflow Micro Kernel for local process management
- Communicate with Enterprise-Process server and other workstations
The goal of the messaging between the Enterprise-Process Server and the Workstations is bi-directional messaging pattern. To start a new production processes on dedicated workstation based on the model definition, the Enterprise-Process Server opens a WebSocket connection to the workstation. To signal the completion of a production process the workstation sends a Message via Rest API to the Enterprise-Process service. Furthermore a Workstation can start processes on other Workstations in Bidirectional message flow based on WebSockets only.
- Direction: Unidirectional (Enterprise-Process → Workstation )
- Technology: WebSockets
- Purpose: Rapid distribution of production orders
- Implementation: Quarkus with jakarta.websocket API
- Direction: Unidirectional (Workstation → Enterprise-Process)
- Technology: REST API
- Purpose: Status updates and process completion notifications
- Implementation: Utilizing existing Imixs-Workflow REST API
- Direction: Bidirectional
- Technology: WebSockets
- Purpose: Fast, real-time communication for short-lived sub-processes
- Implementation: Quarkus with jakarta.websocket API
-
WebSocket Client
- Implemented using jakarta.websocket API
- Sends production orders to workstations
-
REST API Endpoints
- Existing Imixs-Workflow REST API
- Receives status updates and process completion notifications from workstations
-
WebSocket Server
- Implemented using jakarta.websocket API via Quarkus
- Receives production orders from Enterprise-Process server
-
WebSocket Client and Server
- For workstation-to-workstation communication
- Implemented using jakarta.websocket API via Quarkus
-
REST Client
- Implements calls to Imixs-Workflow REST API on Enterprise-Process server
- Sends status updates and process completion notifications
- Efficiency: Fast distribution of production orders via WebSockets
- Simplicity: Streamlined implementation on resource-constrained workstations
- Scalability: Efficient handling of multiple workstations
- Flexibility: Tailored communication patterns for different interaction types
- Error Handling: Robust mechanisms for WebSocket connection failures
- Connection Management: Auto-reconnect for WebSocket connections on workstations
- Security: Proper authentication and authorization for all communication channels
You can test Imixs-Micro with Docker. The project provides a docker compose setup to simulate a test environment with a Enterprise Workflow Server and three workstations.
First make sure to build the project with:
$ ./imixs-micro-engine/mvnw clean package -Dquarkus.container-image.build=true
To command will build the docker image to simulate a workstation.
To build the client code you can run:
$ mvn clean install
Now you can start the test environment with:
docker compose up
This will start the Enterprise Workflow server and tree workstations.
╭────────────────────────────╮
│ Enterprise Workflow Server │
│ Imixs-Process Manager │
╰──────┬────────────────┬──┬─╯
│ Web Socket │ │ Web Socket
│ │ ╰─────────────>>──────────╮
╔═╧═╧═╧═╧═╧═╧═══╗ ╔═╧═╧═╧═╧═╧═╧═══╗ ╔═╧═╧═╧═╧═╧═╧═══╗
║ Workstation-1 ║ ║ Workstation-2 ║ ║ Workstation-3 ║
║ Raspberry Pi ║ ║ Raspberry Pi ║ ║ Raspberry Pi ║
╚═╤═╤═╤═╤═╤═╤═══╝ ╚═╤═╤═╤═╤═╤═╤═══╝ ╚═╤═╤═╤═╤═╤═╤═══╝
│ │ ╰──────<<──>>────────╯
│ │ Web Socket (Bidirectional)
╭──┴─────╮ ╭──┴─────╮
│Sensor-1│ │Sensor-2│
╰────────╯ ╰────────╯
You can test the docker status with the command docker ps
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2fec832b21c4 imixs/imixs-micro-engine:latest "java -jar /deployme…" About a minute ago Up About a minute 8443/tcp, 0.0.0.0:8082->8080/tcp, [::]:8082->8080/tcp imixs-micro-workstation-2-1
2f6c8548b6c5 imixs/imixs-micro-engine:latest "java -jar /deployme…" About a minute ago Up About a minute 8443/tcp, 0.0.0.0:8083->8080/tcp, [::]:8083->8080/tcp imixs-micro-workstation-3-1
8530ae17c165 imixs/imixs-micro-engine:latest "java -jar /deployme…" About a minute ago Up About a minute 8443/tcp, 0.0.0.0:8081->8080/tcp, [::]:8081->8080/tcp imixs-micro-workstation-1-1
450c33d928a5 postgres:13.11 "docker-entrypoint.s…" 6 days ago Up About a minute 5432/tcp imixs-micro-imixs-db-1
85674cfa3e4e imixs/imixs-process-manager:latest "/opt/jboss/wildfly/…" 6 days ago Up About a minute 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp, 0.0.0.0:8787->8787/tcp, :::8787->8787/tcp, 0.0.0.0:9990->9990/tcp, :::9990->9990/tcp imixs-micro-imixs-app-1
You can now login to the Enterprise Workflow server from your Web Browser: http://localhost:8080
Use the user id 'admin' and the password 'adminadmin'. You will see the Imixs-Process Manager Web Interface where you can upload your workflow models.
Next go to "Models" and upload the model order-1.0.0.bpmn
from the /workflow directory
Now you can start a new "Customer Order" workflow: