elsa-core/src/modules/Elsa.Workflows.Runtime
Sipke Schoorstra aee09bb06f
Improves workflow deletion and task scheduling (#7088)
* Refactor workflow instance deletion to use `IWorkflowRuntime` for enhanced coordination and separation of concerns.

* Remove `EnumerableTypeConverter` and update related usages for serialization.

- Deleted the `EnumerableTypeConverter` class and its JSON serialization logic.
- Removed associated type descriptor attribute in `DefaultFormattersFeature`.
- Updated `ObjectFormatter` to handle collection serialization directly with JSON.

* Remove `EnumerableTypeConverter` tests and consolidate serialization logic into `ObjectFormatter`.

- Deleted `EnumerableTypeConverterTests` as the related functionality was removed.
- Added comprehensive tests in `ObjectFormatterTests` to handle serialization of collections and arrays with JSON.

* Add integration tests for `TriggerIndexer` to handle workflows with failing materialization

- Introduced comprehensive test scenarios verifying `DeleteTriggersAsync` behavior when workflows fail to load or partially succeed.
- Enhanced error handling in `TriggerIndexer` to skip failed workflows while ensuring remaining workflows are processed.

* Add exception handling in `TriggerIndexer.DeleteTriggersAsync` and integration tests

- Enhanced `DeleteTriggersAsync` with exception handling to skip failed workflows while processing others.
- Logged warnings for failed workflows without halting execution.
- Added comprehensive integration tests to verify behavior across success, failure, and mixed scenarios.
- Refactored tests for improved clarity, maintainability, and consistency.

* Add exception handling for `ResumeWorkflowTask` to skip deleted workflow instances

- Enhanced `ResumeWorkflowTask.ExecuteAsync` to handle `WorkflowInstanceNotFoundException` gracefully when a scheduled workflow instance is missing.
- Logged warnings for skipped executions to improve observability.
- Ensured remaining workflows and scheduled tasks are processed seamlessly without disruption.

* Add thread safety to `LocalScheduler` to prevent race conditions during concurrent scheduling

- Introduced a `lock` object to synchronize access to internal dictionaries.
- Resolved `IndexOutOfRangeException` caused by concurrent modifications during startup.
- Ensured thread-safe operations in `ScheduleAsync`, `ClearScheduleAsync`, and related methods.
- Improved reliability and stability of scheduling under concurrent workloads.

* Improve exception handling, thread safety, and workflow instance deletion

- Added exception handling in `TriggerIndexer.DeleteTriggersAsync` to skip failed workflows while continuing processing.
- Enhanced `ResumeWorkflowTask` to handle missing workflow instances gracefully and log warnings.
- Introduced thread synchronization in `LocalScheduler` with `lock` to prevent concurrent access issues.
- Implemented and refactored tests to ensure behavior consistency and improve maintainability.
- Added component tests for workflow deletion scenarios, covering running, completed, and non-existent workflows.

* Add component tests for workflow instance deletion and refactor bulk delete logic

- Added comprehensive component tests for workflow instance deletion scenarios (running, completed, bulk, and non-existent instances).
- Refactored `BulkDelete` API to use `IWorkflowInstanceManager` for proper cleanup of related records (execution logs, activity executions, bookmarks).

* Add integration tests and fakes for `TriggerIndexer` to verify behavior with failing and successful workflows

- Introduced `FailingMaterializer` and `WorkingMaterializer` for simulating failing and successful workflow materializations.
- Added `TriggerDeletionTestScenario`, `TriggerTestDataBuilder`, and related test data classes to define comprehensive test cases.
- Updated `DeleteTriggersAsync` tests with scenarios for materialization failures and mixed success.
- Improved test coverage and maintainability with reusable test data builders and utilities.
2025-11-21 20:58:38 +01:00
..
ActivationValidators
Activities Addresses warnings and enforces null safety (#7050) 2025-11-12 15:53:23 +01:00
Bookmarks Merge branch 'refs/heads/main' into blueberry 2025-03-10 15:13:26 +02:00
Commands Fix race condition in Distributed Workflow Runtime during same-workflow event publishing (#6538) 2025-03-31 18:11:27 +02:00
Comparers
Constants
Contexts
Contracts Improves workflow deletion and task scheduling (#7088) 2025-11-21 20:58:38 +01:00
Entities Refactor activity execution record serialization with snapshots (#6807) 2025-07-18 14:14:19 +02:00
Exceptions Enhances workflow runtime resilience and signaling (#6643) 2025-05-13 13:51:47 +02:00
Extensions Fix typo in AddTriggerPaylodValidator method name across Scheduling, Http, and Runtime modules 2025-10-04 19:34:19 +02:00
Features Addresses warnings and enforces null safety (#7051) 2025-11-12 16:56:31 +01:00
Filters Addresses warnings and enforces null safety (#7051) 2025-11-12 16:56:31 +01:00
Handlers Addresses warnings and enforces null safety (#7051) 2025-11-12 16:56:31 +01:00
LogPersistence Refactor activity execution record capturing (#6836) 2025-08-04 08:44:42 +02:00
Matches Incremental work on restoring previous workflow runtime API surface for backward compatibility 2025-01-28 00:11:25 +01:00
Messages Merge remote-tracking branch 'origin/develop/3.5.0' 2025-05-21 09:55:35 +02:00
Middleware Improving behaviour of Run Asynchronously property for the TaskActivityAttribute 2025-08-05 13:50:35 +02:00
Models Addresses workflow identity reload conflict (#6909) 2025-09-15 11:56:01 +02:00
Notifications Addresses warnings and enforces null safety (#7050) 2025-11-12 15:53:23 +01:00
Options Removed optional purge 2025-03-12 13:58:38 +02:00
OrderDefinitions Add support for ordered and paginated trigger retrieval 2025-05-26 21:15:54 +02:00
Parameters Deprecate and clean up legacy workflow runtime components. 2025-01-28 09:26:46 +01:00
Params Deprecate and clean up legacy workflow runtime components. 2025-01-28 09:26:46 +01:00
Providers Add BulkDispatchWorkflows tests and improve activity coverage (#7026) 2025-11-04 15:44:44 +01:00
Requests Addresses warnings and enforces null safety (#7050) 2025-11-12 15:53:23 +01:00
Responses Fix race condition in Distributed Workflow Runtime during same-workflow event publishing (#6538) 2025-03-31 18:11:27 +02:00
Results Merge branch 'refs/heads/main' into blueberry 2025-03-10 15:13:26 +02:00
Services Improves workflow deletion and task scheduling (#7088) 2025-11-21 20:58:38 +01:00
Stimuli ExecuteWorkflow Activity: Add Wait For Completion option (#6153) 2024-11-26 20:37:41 +01:00
Stores Add support for ordered and paginated trigger retrieval 2025-05-26 21:15:54 +02:00
Tasks Add migration files for database schema V3.4 2025-02-22 20:48:56 +01:00
UIHints
Elsa.Workflows.Runtime.csproj Update all dependencies to new projects. 2025-05-21 00:20:13 +01:00
Elsa.Workflows.Runtime.csproj.DotSettings Fixed Log Persistence Mode Evaluation For Activity Execution (#6595) 2025-04-17 18:03:06 +02:00
FodyWeavers.xml
IsExternalInit.cs
RuntimeStimulusNames.cs Support for Writing Custom Trigger Activities Using Existing Trigger Infrastructure (#6527) 2025-03-21 23:16:56 +01:00