$ show optimajet/WorkflowEngine.NET
OptimaJet.Workflow is a .NET workflow engine library designed for business process management and automation. It provides a core runtime for defining, executing, and persisting workflow schemes (process definitions) across multiple database backends including SQL Server, MySQL, PostgreSQL, Oracle, SQLite, and MongoDB. The engine supports multi-tenancy, version control of workflow schemes, and includes a visual HTML5 designer for creating workflows. It is architected as a library/framework layer, intended to be integrated into applications rather than running as a standalone service. The codebase demonstrates a hybrid architecture, combining modern .NET Core samples with legacy .NET Framework implementations using Windows Workflow Foundation (WWF). This duality is evident in the presence of both `OptimaJet.Workflow.Core` (modern) and `Other/WorkflowFoundation` (legacy) directories. The library relies heavily on the Provider Pattern for persistence, allowing developers to swap database backends via dependency injection. It also features a robust migration framework (FluentMigrator for SQL, custom scripts for MongoDB) to manage schema evolution, particularly around multi-tenancy support (`TenantId` columns). While the library offers solid engineering patterns like generic database abstraction (`DbObject<T>`) and async/await persistence, the codebase suffers from significant technical drift. It includes deprecated technologies such as `System.Workflow` and WCF, and sample applications rely on older versions of frameworks like ABP (v6.5.0) and .NET Core 2.2. The duplication of persistence logic across five different database providers increases maintenance overhead and the risk of schema drift between implementations.
The LLM identified 3 files worth highlighting for reuse:
This file implements a generic database abstraction layer (`DbObject<T>`) used across all SQL persistence providers. It encapsulates common CRUD operations, parameter binding, and SQL generation logic. It is a reusable component because it provides a consistent interface for data access that can be inherited by specific entity models (e.g., `WorkflowProcessInstance`, `WorkflowScheme`) without duplicating SQL construction logic. It demonstrates skill in creating a flexible, type-safe data access layer that supports multiple database dialects.
This component serves as the primary integration point for the workflow engine within an ABP-based application. It handles the initialization of the `WorkflowRuntime`, registration of persistence providers, and subscription to workflow events. It is reusable because it demonstrates a clean pattern for bootstrapping the workflow engine in a modern .NET Core environment using dependency injection. It abstracts the complexity of configuring the engine, making it easier for other engineers to adopt the library in their own ABP or ASP.NET Core projects.
This file represents the initial database schema migration for the MySQL persistence provider. It uses FluentMigrator to define the creation of workflow-related tables (`WorkflowProcessInstance`, `WorkflowScheme`, etc.) with proper indexing and constraints. It is a reusable pattern for database schema management, demonstrating how to version control the workflow engine's data store. The migration includes multi-tenancy support (`TenantId`), which is a critical architectural feature for SaaS applications using this engine.