elsa-core/src/modules
Sipke Schoorstra ca88051573
Improves workflow materializer handling (#7195)
* Add tenant headers support to BackgroundWorkflowCancellationDispatcher (#7040)

* Add tenant headers support to BackgroundWorkflowCancellationDispatcher

* Fix 'CreateHeaders' call

* Fix memory leak: Dispose IronCompressResult in Zstd codec (#7193)

* Initial plan

* Fix memory leak: Dispose IronCompressResult in Zstd codec and add tests

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

* Refactor tests to be more DRY using Theory and InlineData

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

* Introduce `IMaterializerRegistry` to manage workflow materializers and ensure availability checks.

* Extend `IWorkflowDefinitionService` and `CachingWorkflowDefinitionService` with workflow graph lookup methods (`TryFindWorkflowGraphAsync`). Refactor caching and materialization logic for consistency.

* Refactor caching interface and implementation: add `FindOrCreateAsync`, update `GetOrCreateAsync` to ensure non-null results, and improve exception handling.

* Refactor `GetWorkflowGraphAsync` to use `TryFindWorkflowGraphAsync` and improve exception handling for missing workflow definitions and materializers.

* Refactor caching logic to replace `GetOrCreateAsync` with `FindOrCreateAsync` for improved clarity and consistency.

* Update workflow model, add event, and mark exception obsolete

Updated `TimestampFilter.Column` to use a `null!` default value for clarity. Added `Event1` in the `hello-world.elsa` workflow and removed an unused folder entry from the project. Marked `WorkflowGraphNotFoundException` as obsolete with guidance to use `WorkflowDefinitionNotFoundException` instead.

* Add new workflow files and exception classes for Elsa

Introduced a workflow definition file "eventing.json" and new exception classes (`WorkflowDefinitionNotFoundException` and `WorkflowMaterializerNotFoundException`) to enhance handling of workflow-related errors. Also added a `WorkflowGraphFindResult` model for better workflow graph management. These changes improve the structure and functionality of the workflow system.

* Add unit tests for `CachingWorkflowDefinitionService` and related helpers

Introduce comprehensive unit tests to validate caching logic, workflow graph/materialization behavior, and cache key generation in `CachingWorkflowDefinitionService`. Add `WorkflowDefinitionServiceTests` and helper methods for streamlined test setup.

* Enable `UseElsaScriptBlobStorage` in workflow server configuration

* Refactor `BackgroundWorkflowCancellationDispatcher` to simplify object initialization and clean up XML documentation comments

* Address PR #7195 review feedback: optimize caching, improve exceptions, add test coverage (#7196)

* Initial plan

* Apply PR review feedback: Fix exceptions, optimize caching, improve error handling

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

* Add unit tests for MaterializerRegistry and LocalWorkflowClient exception handling

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

* Add unit tests for BackgroundWorkflowCancellationDispatcher tenant headers

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

* Refactor `WorkflowMaterializerNotFoundException` to improve structure and usability, update related references, and simplify object initialization in test cases.

* Update `WorkflowDefinitionServiceTests` to use `WorkflowMaterializerNotFoundException` in place of `InvalidOperationException` for materializer not found scenario

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* Potential fix for pull request finding 'Inefficient use of ContainsKey'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Refactor tests and services: simplify object initialization, use target-typed `new()` syntax, and replace `CancellationToken` with `CancellationToken.None` where applicable.

* Refactor tests in `BackgroundWorkflowCancellationDispatcherTests`: improve tenant initialization and optimize header checks by replacing `TryGetValue` with `ContainsKey`.

---------

Co-authored-by: Sverre Winkelmans <69142682+Sverre-W@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-01-19 08:59:12 +01:00
..
Elsa
Elsa.Alterations Addresses warnings and enforces null safety (#7050) 2025-11-12 15:53:23 +01:00
Elsa.Alterations.Core Addresses warnings and enforces null safety (#7050) 2025-11-12 15:53:23 +01:00
Elsa.Caching Improves workflow materializer handling (#7195) 2026-01-19 08:59:12 +01:00
Elsa.Common Improves workflow materializer handling (#7195) 2026-01-19 08:59:12 +01:00
Elsa.Dsl.ElsaScript Add Elsa Script DSL (#7076) 2025-11-25 19:57:50 +01:00
Elsa.Expressions Improves workflow deletion and task scheduling (#7088) 2025-11-21 20:58:38 +01:00
Elsa.Expressions.CSharp
Elsa.Expressions.JavaScript Upgrade projects to target .NET 10, add conditional System.Linq.Async dependencies for compatibility with earlier frameworks, and update project files for consistency across the solution. (#7062) 2025-11-21 20:55:30 +01:00
Elsa.Expressions.JavaScript.Libraries
Elsa.Expressions.Liquid Addresses warnings and enforces null safety (#7051) 2025-11-12 16:56:31 +01:00
Elsa.Expressions.Python
Elsa.Hosting.Management
Elsa.Http Improves workflow materializer handling (#7195) 2026-01-19 08:59:12 +01:00
Elsa.Identity Addresses warnings and enforces null safety (#7050) 2025-11-12 15:53:23 +01:00
Elsa.KeyValues
Elsa.Labels Restore EF Core persistence layer (#6931) 2025-09-27 20:39:18 +02:00
Elsa.Persistence.EFCore Fix Race Condition Causing Duplicate Trigger Registration in Multi-Engine Environments + Add Concurrency Tests to Prevent Regression (#7131) 2025-12-05 09:17:14 +01:00
Elsa.Persistence.EFCore.Common Fix Race Condition Causing Duplicate Trigger Registration in Multi-Engine Environments + Add Concurrency Tests to Prevent Regression (#7131) 2025-12-05 09:17:14 +01:00
Elsa.Persistence.EFCore.MySql Added logic to search for workflow-as-activities based on DefinitionId (not only versionId) (#7149) 2025-12-17 23:23:49 +01:00
Elsa.Persistence.EFCore.Oracle Remove unused target frameworks from EF Core persistence project files 2025-12-13 21:32:47 +01:00
Elsa.Persistence.EFCore.PostgreSql Remove unused target frameworks from EF Core persistence project files 2025-12-13 21:32:47 +01:00
Elsa.Persistence.EFCore.Sqlite Remove unused target frameworks from EF Core persistence project files 2025-12-13 21:32:47 +01:00
Elsa.Persistence.EFCore.SqlServer Remove unused target frameworks from EF Core persistence project files 2025-12-13 21:32:47 +01:00
Elsa.Resilience Enhances distributed lock handling with resilience (#7161) 2025-12-29 19:53:48 +01:00
Elsa.Resilience.Core Enhances distributed lock handling with resilience (#7161) 2025-12-29 19:53:48 +01:00
Elsa.SasTokens
Elsa.Scheduling Merge remote-tracking branch 'origin/develop/3.6.0' 2025-11-27 21:41:59 +01:00
Elsa.Tenants Improves tenant task management with dependencies (#7174) 2025-12-29 20:49:24 +01:00
Elsa.Tenants.AspNetCore
Elsa.WorkflowProviders.BlobStorage Added logic to search for workflow-as-activities based on DefinitionId (not only versionId) (#7149) 2025-12-17 23:23:49 +01:00
Elsa.WorkflowProviders.BlobStorage.ElsaScript Improves workflow materializer handling (#7195) 2026-01-19 08:59:12 +01:00
Elsa.Workflows.Api Improves workflow materializer handling (#7195) 2026-01-19 08:59:12 +01:00
Elsa.Workflows.Core Fix spurious duplicate activity registry warnings during startup (#7183) 2026-01-16 12:14:24 +01:00
Elsa.Workflows.Management Improves workflow materializer handling (#7195) 2026-01-19 08:59:12 +01:00
Elsa.Workflows.Runtime Improves workflow materializer handling (#7195) 2026-01-19 08:59:12 +01:00
Elsa.Workflows.Runtime.Distributed Enhances distributed lock handling with resilience (#7161) 2025-12-29 19:53:48 +01:00