elsa-core/src/modules/Elsa.Tenants
Sipke Schoorstra 1b8083a5c6
Update multitenancy logic and improve Result handling: (#7281)
* Update multitenancy logic and improve `Result` handling:

- Introduce `TenantsOptions` with `IsEnabled` flag to conditionally apply tenant-specific logic.
- Refactor `Result` class to support strongly-typed operations and async handlers.
- Implement tenant filters respecting multitenancy enablement.
- Enhance error logging for workflow definition addition, upgrading error handling.
- Refactor tests and storage drivers to use `IsSuccess` from `Result`.

* Update src/modules/Elsa.Workflows.Runtime/Services/DefaultWorkflowDefinitionStorePopulator.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add exception handling when accessing `Value` on failed results; introduce `ValueOrDefault` property for better null support.

* Add `ThrowIfFailure` method to handle exceptions in `Result` model and use it in `DefaultWorkflowRegistry` to ensure operation success.

* Normalize tenant ID handling by using `NormalizeTenantId()` in `DefaultWorkflowDefinitionStorePopulator`.

* Normalize tenant ID usage in unit tests by returning `tenantId.NormalizeTenantId()` in `DefaultWorkflowDefinitionStorePopulatorTests`.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-11 10:11:12 +01:00
..
Contracts Enhance Multitenancy with Runtime Tenant Management and Task Handling (#6173) 2024-12-03 15:07:55 +01:00
Endpoints/Tenants Adds ILoggerFactory support to converters (#7153) 2025-12-19 21:54:20 +01:00
Extensions Fix Multitenancy Support and Normalize Tenant ID Handling (#7217) 2026-01-30 19:54:13 +01:00
Features Update multitenancy logic and improve Result handling: (#7281) 2026-02-11 10:11:12 +01:00
Mediator Enhances Mediator with Tenant Context Propagation (#6738) 2025-06-13 14:26:51 +02:00
Options Update multitenancy logic and improve Result handling: (#7281) 2026-02-11 10:11:12 +01:00
Providers Improves tenant task management with dependencies (#7174) 2025-12-29 20:49:24 +01:00
Services Fix Multitenancy Support and Normalize Tenant ID Handling (#7217) 2026-01-30 19:54:13 +01:00
Elsa.Tenants.csproj Enhance Multitenancy with Runtime Tenant Management and Task Handling (#6173) 2024-12-03 15:07:55 +01:00
Elsa.Tenants.csproj.DotSettings Enhance Multitenancy with Runtime Tenant Management and Task Handling (#6173) 2024-12-03 15:07:55 +01:00
FodyWeavers.xml