elsa-core/src/modules/Elsa.Common
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
..
Attributes Improves tenant task management with dependencies (#7174) 2025-12-29 20:49:24 +01:00
Codecs Fix memory leak: Dispose IronCompressResult in Zstd codec (#7193) 2026-01-16 18:20:39 +01:00
Contracts Moved compression to separate feature 2025-04-03 15:40:17 +02:00
Converters Merge 3.5.1 into 3.6.0 (#6907) 2025-09-13 13:05:52 +02:00
DistributedHosting Addresses warnings and enforces null safety (#7050) 2025-11-12 15:53:23 +01:00
Entities Refactor activity execution record serialization with snapshots (#6807) 2025-07-18 14:14:19 +02:00
Exceptions
Extensions Adds Publish Event Activity Tests (#7093) 2025-11-25 19:06:16 +01:00
Features Improves tenant task management with dependencies (#7174) 2025-12-29 20:49:24 +01:00
Helpers Improves tenant task management with dependencies (#7174) 2025-12-29 20:49:24 +01:00
Models Update multitenancy logic and improve Result handling: (#7281) 2026-02-11 10:11:12 +01:00
Multitenancy Implement null TenantId for tenant-agnostic entities (#7226) 2026-02-02 10:59:01 +01:00
RecurringTasks Implement null TenantId for tenant-agnostic entities (#7226) 2026-02-02 10:59:01 +01:00
Serialization Improves workflow deletion and task scheduling (#7088) 2025-11-21 20:58:38 +01:00
Services Moved compression to separate feature 2025-04-03 15:40:17 +02:00
Elsa.Common.csproj Replace DistributedLock meta-package with DistributedLock.Core in Elsa.Common (#7169) 2025-12-24 21:50:57 +01:00
Elsa.Common.csproj.DotSettings Enhance Multitenancy with Runtime Tenant Management and Task Handling (#6173) 2024-12-03 15:07:55 +01:00
FodyWeavers.xml