How dromara/warm-flow works
Main Components
• Client/Application / External Systems: These are your consumers (or integrators) that invoke the workflow engine API and potentially use the integrated workflow designer.
• Workflow Core Engine (warm-flow-core): This module implements the workflow logic, including task execution, condition evaluation, event listeners, flow charts, and workflow rules. It is organized into subpackages such as core, condition, config, entity, dto, handler, invoker, listener, ORM service layers, key generators, and utility classes.
• ORM and Data Access Layer (warm-flow-orm): A distinct module that supports various ORM frameworks (MyBatis, MyBatis-Plus, JPA, Easy-Query, MyBatis-Flex). It contains DAO implementations, mapper files, entity definitions, and configuration files for interacting with multiple types of databases (MySQL, Oracle, PostgreSQL, SQL Server, etc.).
• Plugin System (warm-flow-plugin): This comprises extensions like JSON conversion tools and mode plugins, which provide additional integrations (for example, JSON converters using different libraries such as FastJson, Gson, Jackson, etc.) and extend workflow engine capabilities.
• Workflow UI / Designer (warm-flow-ui): Several UI modules (including warm-flow-vue3-dFlow, warm-flow-vue3-logic-flow, and others) are provided in Vue3 and possibly other frontend frameworks. They serve the purpose of workflow designing, element configuration, and runtime monitoring. This module can be embedded as a jar to directly integrate a workflow designer into applications.
Relationships and Interactions
• The Client/Application interacts with the Workflow UI (designer) or directly with the API exposed by the core engine.
• The Workflow Core Engine handles the process flows and business logic, and it relies on the ORM layer to persist workflow definitions, task instances, progress status, and audit trails.
• The ORM layer abstracts database interactions via multiple supported frameworks. It communicates with the underlying databases (MySQL, Oracle, etc.) using DAOs and mapper configurations.
• The Plugin system hooks into both the core engine and UI modules to add specialized functions (e.g., dynamic JSON conversion, modes for condition evaluation, extra expression languages, or tenant-specific logic).
• There is also an integration between the core module and utility/extension packages (like listeners, strategy implementations, and variable evaluations) that add flexibility and dynamic configuration to the workflow process.
Architectural Patterns & Design Principles
• Multi-Module/Multi-Layer Architecture: The project is split into distinct Maven modules (core, ORM, plugin, UI) that each address specific concerns.
• Plugin/Extension Architecture: The use of plugins (with providers for JSON conversion and workflow modes) shows a clear separation of core functionality and pluggable extensions.
• Abstraction over Persistence: The ORM module abstracts data access and can swap between different ORM frameworks and databases thanks to its interface-driven design.
• Event-Driven and Listener Pattern: The core engine contains several listener and handler components to respond to workflow events and variable changes.
• Emphasis on Configurability: With numerous configuration files, scripts, and support for dynamic expressions (via SpEL and custom strategies), the design is focused on achieving flexibility.
Relevant Technologies and Frameworks
• Spring-based support (and also Solon support) for dependency injection, configuration, and auto-configuration.
• ORM frameworks: MyBatis, MyBatis-Plus, JPA, MyBatis-Flex, Easy-Query.
• Vue3 for the UI modules.
• Java (compatible with Java 8 and Java 17), along with common Java libraries for utilities, JSON, and expression language handling.
• Maven for multi-module project management.
• Deployment scripts and CI/CD pipelines (as seen in the .github and .gitee directories).