elsa-core/src/modules/Elsa.Workflows.Core/Contexts
Sipke Schoorstra b577279321
Improves tenant task management with dependencies (#7174)
* Consolidate tenant task lifecycle logic into `TenantTaskManager` and remove obsolete task event handlers (`RunStartupTasks`, `RunBackgroundTasks`, `StartRecurringTasks`). Introduce `TopologicalTaskSorter` for dependency-based task execution.

* Handles multiple tasks of the same type

Updates the topological task sorter to handle multiple tasks of the same type.

Previously, the sorter assumed a one-to-one mapping between task types and task instances, which caused issues when multiple tasks of the same type were present.
Now, it groups tasks by type and adds them to the result in the correct order.

* Add unit tests for `TopologicalTaskSorter`

Introduce `Elsa.Common.UnitTests` project with comprehensive test coverage for `TopologicalTaskSorter`, including dependency resolution, circular dependency handling, and task ordering scenarios. Update `Elsa.sln` to include the new test project.

* Update src/modules/Elsa.Common/Multitenancy/EventHandlers/TenantTaskManager.cs

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

* Unwrap background task continuation in `TenantTaskManager` to ensure proper task execution tracking.

* Update src/modules/Elsa.Common/Helpers/TopologicalTaskSorter.cs

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

* Refactor `TryGet` method to prioritize memory register lookup and update `Output` constructor to use `MemoryBlockReference`.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-29 20:49:24 +01:00
..
ActivityCompletedContext.cs
ActivityExecutionContext.Cancel.cs Remove obsolete properties and refactor activity evaluation (#6603) 2025-04-18 16:21:25 +02:00
ActivityExecutionContext.Complete.cs Send ActivityCompleted notification from middleware and remove redundant notification logic in activity execution context. (#6842) 2025-08-06 08:47:23 +02:00
ActivityExecutionContext.cs Improves tenant task management with dependencies (#7174) 2025-12-29 20:49:24 +01:00
ActivityExecutionContext.ExecutionLogEntry.cs Refactor workflow context and execution handling. 2025-01-20 17:44:31 +01:00
ActivityInputEvaluatorContext.cs Merge 3.5.1 into 3.6.0 (#6907) 2025-09-13 13:05:52 +02:00
ActivityStateFilterContext.cs
ResumedBookmarkContext.cs
SignalContext.cs
StorageDriverContext.cs Add Variable parameter to StorageDriverContext 2024-12-18 15:37:38 +01:00
TriggerIndexingContext.cs Refactor trigger indexing and update base version to 3.5.0. (#6516) 2025-03-20 12:04:51 +01:00
WorkflowExecutionContext.Cancel.cs Update workflow cancellation logic 2025-02-08 09:51:26 +01:00
WorkflowExecutionContext.cs Make correlationId parameter non-optional in WorkflowExecutionContext constructor. 2025-12-29 20:10:36 +01:00
WorkflowExecutionContext.ExecutionLogEntry.cs Implement retry attempt capturing (#6674) 2025-05-26 11:47:09 +02:00
WorkflowIndexingContext.cs