Commit graph

6764 commits

Author SHA1 Message Date
Sipke Schoorstra 79a64e90fd
Remove unused ClearCompletionCallbacks method from WorkflowExecutionContext. 2025-12-29 20:06:27 +01:00
Sipke Schoorstra 4e9b6d0a01
Merge remote-tracking branch 'origin/patch/3.5.4' into release/3.6.0 2025-12-29 20:00:03 +01:00
Sipke Schoorstra 72597f733f
Update base_version to 3.6.0 in GitHub workflow configuration. 2025-12-29 19:58:36 +01:00
Sipke Schoorstra 8f6ce7eb8c
Merge remote-tracking branch 'origin/main' into release/3.6.0 2025-12-29 19:57:50 +01:00
Sipke Schoorstra ca268c16ad
Enhances distributed lock handling with resilience (#7161)
* Add retry mechanism for distributed locks with transient error handling and logging

- Introduced Polly-based retry pipeline for distributed lock acquisition in `DistributedWorkflowClient` to handle transient errors such as network issues or database connection failures.
- Added detailed logging for retry attempts and lock release errors.
- Updated project dependencies to include Polly.

* Refactor transient exception handling to shared resilience module.

Migrated transient exception detection logic from scheduling module to a new shared resilience module. Updated services, jobs, and features to utilize the centralized `ITransientExceptionDetectionService`. This change improves maintainability and promotes reusability across modules.

* Add unit tests for transient exception detection and resilience strategy evaluation.

- Introduced comprehensive unit tests for `DefaultTransientExceptionDetector`, `ResilienceStrategyCatalog`, `ResilienceStrategyConfigEvaluator`, and `TransientExceptionDetectionService`.
- Added helper classes and test data factories to facilitate reusable test patterns for resilience modules.
- Updated solution to include `Elsa.Resilience.Core.UnitTests` project.

* Add component tests for distributed lock resilience

- Introduced new tests to verify retry behavior during transient lock acquisition and release failures.
- Added `TestDistributedLockProvider` and related mocks for simulating transient failures.
- Updated `WorkflowServer` test services to support the new distributed lock test scenarios.

* Refactor distributed lock resilience tests

- Consolidated test logic: streamlined test providers, injected services, and reusable test patterns.
- Simplified `TestDistributedLockProvider` implementation with enhanced initialization and failure simulation.
- Reorganized tests for transient acquisition/release failures to use parameterized `Theory` for improved maintainability.

* Refactor transient exception handling: rename interfaces and classes for consistency, update references across codebase, and improve code readability.

* Apply suggestion from @Copilot

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

* Simplify WorkflowServer setup and DistributedLockResilienceTests by replacing IDistributedLockProvider with TestDistributedLockProvider.

* Remove unused `using` directives in unit tests to improve code cleanliness.

* Remove `TransientExceptionTypes` helper and inline its usage in tests for improved maintainability.

* Add descriptive `DisplayName` attributes to unit tests for improved test clarity.

* Fix redundant exception checking in TransientExceptionDetector (#7162)

* Initial plan

* Fix redundant exception checking in TransientExceptionDetector

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>

* Extract MaxRetryAttempts constant in DistributedLockResilienceTests (#7164)

* Initial plan

* Extract MaxRetryAttempts constant to eliminate hardcoded magic number

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>

* Make TestDistributedLockProvider thread-safe with Interlocked operations (#7163)

* Initial plan

* Make TestDistributedLockProvider thread-safe using Interlocked operations

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>

* Update src/modules/Elsa.Workflows.Runtime.Distributed/Services/DistributedWorkflowClient.cs

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

* Update test/component/Elsa.Workflows.ComponentTests/Scenarios/DistributedLockResilience/DistributedLockResilienceTests.cs

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

* Update src/modules/Elsa.Workflows.Runtime.Distributed/Services/DistributedWorkflowClient.cs

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

* Update src/modules/Elsa.Resilience.Core/Services/DefaultTransientExceptionStrategy.cs

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

* Include `CancellationToken` in distributed lock handling methods for improved cancellation support.

* Initial plan (#7168)

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

* Cache detector list in TransientExceptionDetector to avoid repeated allocations (#7167)

* Initial plan

* Cache detector list in field to avoid repeated allocations

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

* Use IReadOnlyList instead of List for better intent expression

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>

* Fix TestDistributedLockProvider registration to properly decorate IDistributedLockProvider (#7166)

* Initial plan

* Fix TestDistributedLockProvider registration to use Decorate pattern and fix variable reference bug

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

* Add runtime check for TestDistributedLockProvider registration

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>

* Refactor `DistributedWorkflowClient` to simplify `Lazy<ResiliencePipeline>` initialization.

* Add integration tests for DistributedWorkflowClient lock resilience (#7165)

* Initial plan

* Fix compilation error: use correct parameter name transientExceptionDetector

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

* Add integration tests for DistributedWorkflowClient lock resilience

- Add SimpleWorkflow for testing distributed lock scenarios
- Add tests exercising RunInstanceAsync with transient lock failures
- Verify retry logic works correctly with actual workflow execution
- Test both acquisition and release failure scenarios
- Decorate IDistributedLockProvider to use TestDistributedLockProvider

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

* Address code review feedback

- Add explanatory comment for TestDistributedLockProvider cast
- Remove unnecessary blank line for consistent formatting

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>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* Simplify transient exception strategy by refactoring message pattern matching logic.

* Enhance distributed lock mock to support per-lock failure configuration and improve resilience tests.

* Refactor `TestDistributedLockProvider` to streamline failure handling logic and improve code clarity.

* Remove unused methods and redundant test case from `DistributedLockResilienceTests`.

* Refactor `DistributedLockResilienceTests` to simplify workflow client creation, consolidate assertion logic, and remove redundant test cases.

* Format `ResilienceStrategyCatalogTests` by removing redundant line breaks in test setup.

* Refactor `TransientExceptionDetectorTests` to simplify test setup, consolidate test cases, and remove redundant logic.

* Handle `InvalidOperationException` in `XunitLogger` to suppress logging errors during inactive tests.

* Update workflows to use .NET 10 and adjust resilience tests project configuration.

* Refactor distributed runtime feature and integrations to improve resilience handling, configure services fluently, and add cancellation safeguards in background services.

* Update `base_version` to `3.7.0` in GitHub workflow configuration.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
2025-12-29 19:53:48 +01:00
Copilot 37921b5ee0
Restore Literal handling in ActivityExecutionContext.TryGet (#7075)
* Initial plan

* Add Literal handling back to ActivityExecutionContext.TryGet

This restores support for dynamic Literal inputs that was removed in version 3.5.2.
When an Input is created with a Literal, the Literal becomes the MemoryBlockReference.
Since Literals hold values directly rather than in the memory register, they need
special handling in TryGet to return their value.

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

* Improve test coverage for Literal handling in ActivityExecutionContext

- Removed ineffective unit tests that only checked type relationships
- Added explicit integration test for TryGet with Literal references
- Added integration test for Get with Input<T> containing Literal
- All tests now directly verify the fixed TryGet behavior

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>
2025-12-29 10:29:55 +01:00
Sipke Schoorstra b22956c792
Update branch check in release workflow to include release/* branches 2025-12-28 20:57:30 +01:00
Sipke Schoorstra fa2254f41b
Update GitHub workflows to include 'release/*' branch targeting 2025-12-27 20:55:24 +01:00
Sipke Schoorstra fa04e1ebcd
Adds activity host registration support (#7172)
* Add support for activity host registration across workflows

Introduced new APIs and updates to enable registering custom activity hosts in the workflow management system. This includes modifications to attributes, service registrations, and extensions to streamline integration for advanced activity hosting scenarios.

* Remove unused `using` directives across Workflow Management module

* Add support for host method activity registration and description

Introduce new APIs to enable activity registration from public async methods (Task/Task<T>) on CLR types. Includes `HostMethodActivitiesOptions`, `HostMethodActivity`, `HostMethodActivityProvider`, and `HostMethodActivityDescriber` for dynamic activity generation and execution.

* Refactor host method activity execution and cleanup.

Reworked `HostMethodActivity` to support resumable workflows, improved parameter handling with pluggable value providers, and removed obsolete `AgentExecutionContext`. Enhanced method resolution, async handling, and input/output descriptor logic for better flexibility and maintainability.

* Refactor `Bookmark` model to use mutable properties and update XML documentation.

* Refactor `BookmarkExecutionContextExtensions` to improve structure, add `GenerateBookmarkTriggerToken` method, and enhance maintainability.

* Add extensibility for host method parameter binding with pluggable value providers

Introduced `IHostMethodParameterValueProvider` interface for custom parameter resolution, along with `DefaultHostMethodParameterValueProvider`, `DelegateHostMethodParameterValueProvider`, and `FromServicesAttribute` for flexible binding options. Enhances host method activity execution by supporting DI resolution and workflow input handling.

* Refactor nullable usage and improve bookmark management logic

Updated null assignment for consistency across files and refined logic for detecting and handling newly added bookmarks. Adjusted method signatures and parameters in the DecoratedStoryWriterAgent class for more explicit input handling. These changes enhance code readability, maintainability, and robustness.

* Update src/modules/Elsa.Workflows.Management/Activities/CodeFirst/HostMethodActivityProvider.cs

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

* Ensure `CallbackMethodName` is set and skip bookmarks with empty values

* Update src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs

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

* Update src/modules/Elsa.Workflows.Management/Contracts/IHostMethodActivityDescriber.cs

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

* Update src/modules/Elsa.Workflows.Core/Attributes/InputAttribute.cs

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

* Refactor `CodeFirst` namespace to `HostMethod` for improved clarity and align with updated activity execution logic. Enhance DI-based parameter resolution and update XML documentation for `HostMethodActivitiesOptions`.

* Add `Penguin` activity host with sample activity methods and register in Elsa pipeline

* Add `TestHostMethod` activities and corresponding component tests. Register `TestHostMethod` as an activity host in the workflow server.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-27 20:52:52 +01:00
Sipke Schoorstra 3778a14e54
Update AttributeUsage targets for InputAttribute, OutputAttribute, and ActivityAttribute. 2025-12-25 22:13:37 +01:00
Matt 411ca0a332
Merge pull request #7157 from elsa-workflows/copilot/add-workflow-dispatch-notification
Add notifications for workflow dispatch events.
2025-12-25 00:57:45 +00:00
copilot-swe-agent[bot] 2ff1693cd5 Replace flaky Task.Delay with TaskCompletionSource for deterministic test synchronization
- Added TaskCompletionSource fields to Spy class for each notification type
- Test handlers now signal completion through TaskCompletionSource
- Tests await TaskCompletionSource instead of arbitrary delays
- Eliminates timing-dependent flakiness in CI systems

Co-authored-by: KnibbsyMan <23156317+KnibbsyMan@users.noreply.github.com>
2025-12-24 23:47:55 +00:00
Sipke Schoorstra 3ed1833b85
Merge branch 'release/3.6.0' 2025-12-24 21:55:03 +01:00
Copilot 53245cafbd
Replace DistributedLock meta-package with DistributedLock.Core in Elsa.Common (#7169)
* Initial plan

* Replace DistributedLock meta-package with DistributedLock.Core in Elsa.Common

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>
2025-12-24 21:50:57 +01:00
Matt 31eff52d24
Merge pull request #7148 from dwoldo/dwoldo/add-commit-strategy-defaults
Add Default Workflow and Activity Commit Strategy Support
2025-12-23 00:32:26 +00:00
Sipke Schoorstra 90dbdc48d9
Update branch check in release workflow to target main instead of develop/main. 2025-12-21 13:57:00 +01:00
Sipke Schoorstra 14b8ba5ffe
Update branch check in release workflow to target develop/main instead of develop/3.6.0. 2025-12-21 13:52:58 +01:00
copilot-swe-agent[bot] f834b040f9 Add workflow dispatch notifications
- Created WorkflowDefinitionDispatching and WorkflowDefinitionDispatched notifications
- Created WorkflowInstanceDispatching and WorkflowInstanceDispatched notifications
- Updated BackgroundWorkflowDispatcher to emit notifications before and after dispatch
- Added integration tests to verify notifications are emitted correctly

Co-authored-by: KnibbsyMan <23156317+KnibbsyMan@users.noreply.github.com>
2025-12-20 22:30:43 +00:00
copilot-swe-agent[bot] 6fc21c5590 Initial plan 2025-12-20 22:13:07 +00:00
Sipke Schoorstra 103063ee69
Refactor Finish activity tests and workflows. Migrate integration tests to component tests, introduce new workflows for advanced scenarios, and enhance runner utilities to simplify execution logic. 2025-12-20 15:53:57 +01:00
Sipke Schoorstra 7646867ac5
Add ClearCompletionCallbacks method to WorkflowExecutionContext and update Finish activity to use it (#7154)
Fixes #6707
2025-12-20 14:59:00 +01:00
Sipke Schoorstra 75b8122fd9
Updates package versions
Updates Elsa Studio, Elsa Extensions, and Microsoft package
versions to their latest stable releases for the 3.5.3 patch.
2025-12-20 14:39:09 +01:00
Sipke Schoorstra 9e6144922c
Adds ILoggerFactory support to converters (#7153)
* Refactor `Send.OkAsync` calls to use named `cancellation` parameter for consistency. Update `Finish.cs` to explicitly reference `WorkflowExecutionContext` when clearing callbacks.

* Add `ILoggerFactory` support to Flowchart and Connection converters

Refactor `FlowchartJsonConverter` and `ConnectionJsonConverter` to accept `ILoggerFactory` via dependency injection. Update methods to enhance logging for missing activities and connections. Convert static methods to instance methods, and introduce nullability checks for connections. Update `WorkflowExecutionContext` to expose public callbacks management APIs.

* Switch Flowchart execution to Token-Based strategy and refine null checks in ConnectionJsonConverter

* Refactor `ConnectionJsonConverter` to improve object initialization and formatting consistency

* Improve logging and nullability handling in `ConnectionJsonConverter`

Enhance logging for missing source or target activities by leveraging `_logger` for additional context. Refine null checks for source and target activity retrieval. Simplify object initialization and clean up redundant code.

* Refine null checks in `ConnectionJsonConverter` for improved safety

* Correct initialization of `Connection` object in `FlowchartJsonConverter`.

* Update src/modules/Elsa.Workflows.Core/Activities/Flowchart/Serialization/FlowchartJsonConverter.cs

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

* Remove redundant whitespace in `ConnectionJsonConverter` constructor.

* Remove redundant whitespace in `FlowchartJsonConverter`.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-19 21:54:20 +01:00
Sipke Schoorstra b854c0272a
Remove unused Docker services, volumes, and solution references.
Removed unnecessary Docker services, configuration files, and volumes from `docker-compose.yml`. Cleaned up unused project references in `Elsa.sln`. Streamlined local development setup by eliminating redundant resources.
2025-12-19 19:31:01 +01:00
Sipke Schoorstra 9eea009133
Remove elsa-server.yml workflow and update solution configuration. 2025-12-19 19:27:21 +01:00
Sipke Schoorstra 709a723fee
Merge branch 'develop/3.6.0' 2025-12-19 19:12:21 +01:00
Sipke Schoorstra d0db8e55b8
Updates base version to 3.6.0
Updates the base version and Elsa Server image to align with the 3.6.0 release.

This ensures that the CI/CD pipelines use the correct version for building and publishing packages.
2025-12-19 19:12:07 +01:00
Sipke Schoorstra c42868981c
Merge branch 'develop/3.7.0' into develop/3.6.0 2025-12-19 19:09:23 +01:00
Sipke Schoorstra fbe9ca64f0
Fix Switch activity behavior and add testing utilities for RunWorkflowResult and improve (#7151)
* Add testing utilities for `RunWorkflowResult` and improve `Switch` activity behavior

- Introduced `RunWorkflowResultAssertions` for xUnit-based workflow testing.
- Added `RunWorkflowResultExtensions` for journal-based activity execution context handling.
- Refactored `Switch` activity to track scheduled activities and correctly complete execution when all scheduled activities finish.
- Marked `RunActivityExtensions` methods as obsolete, recommending the use of `WorkflowTestFixture`.

* Update src/common/Elsa.Testing.Shared.Integration/RunActivityExtensions.cs

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

* Update src/modules/Elsa.Workflows.Core/Activities/Switch.cs

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

* Add XML documentation to Switch activity callback method (#7152)

* Initial plan

* Add XML documentation to OnChildActivityCompletedAsync method

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>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
2025-12-19 17:05:12 +01:00
Matt 3fd9f5b3af
Merge pull request #7146 from Jelger-Quadira/add-workflow-instance-export-name-provider
Add nameprovider for workflow-instances export files.
2025-12-17 23:57:10 +00:00
j03y-nxxbz 48b574a411
Added logic to search for workflow-as-activities based on DefinitionId (not only versionId) (#7149)
* Inital commit:

1. Fixed problem: (re-)added logic to search for workflow-as-activities based on DefinitionId (not only versionId)

2. Added tests for Deserialiazation so this logic cannot disappear "unnoticed" in the future.

* Found one flaw:
workflowDefinitionId is also used in other activities. Therefore, we must make sure to only search by workflowDefinitionId when the value is a string (e.g. when workflow used as activity, the value will always be a constant string, because the workflowDefinitionId cannot be resolved using expressions)

* Final attempt:
1) First try to find the activity by type name
2) Even if a descriptor is found by its type name, there might be multiple versions of a workflow-as-activity, hence; if the workflowDefinitionVersionId is specified, then this can override the initially found activity descriptor by type name.
3) Lastly, only when no activity descriptor is found by type name AND the activity JSON contains the property "workflowDeftinitionId", then we can search by workflowDefinitionId

* Add `net8.0` and `net9.0` targets, update package versions for resilience libraries.

* Exclude `net10.0` target framework from MySQL EF Core project due to Pomelo compatibility constraints.

* Remove unnecessary whitespace in MySQL EF Core project file

* Refactor `ActivityJsonConverterTests` to streamline registry setup and improve readability.

* Adds null activity descriptor lookup mock

Ensures the custom property lookup path is tested by mocking type name lookups to return null when searching for ActivityDescriptors.

* Fix activity descriptor override assignment in `ActivityJsonConverter`

Corrects the assignment logic for `activityDescriptor` and ensures `activityTypeVersion` uses the overridden descriptor's version when a custom property match is found.

* Apply suggestion from @Copilot

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

* Refactor `ActivityJsonConverter` for readability and logic improvements

- Adjust null-check handling for `activityDescriptor` overrides.
- Improve comment clarity and consolidate lambda expressions.
- Remove unnecessary whitespace.

* Add blob extension handling to `BlobStorageWorkflowsProvider`

- Introduce `BlobExtensions` for extracting blob file extensions.
- Add `SupportsExtension` to `IBlobWorkflowFormatHandler` to filter handlers by supported extensions.

* Remove unused workflow files and references in `Elsa.Server.Web`

- Deleted `flowchart-test.elsa` and `multi-workflow-example.elsa`.
- Removed corresponding references from the project file.

---------

Co-authored-by: Joey Barten - Founder Orbyss <joey.barten@unfussiness.io>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-17 23:23:49 +01:00
Jelger Ribbers a2b1cf7766 adjusted with copilor review findings 2025-12-17 08:23:46 +01:00
David Garza c835f9a33d Clarify commit strategy fallback behavior in documentation; update test method signature for consistency 2025-12-16 08:01:49 -05:00
David Garza 05d807a691 Refactor commit strategy resolution for improved clarity and efficiency; remove unused example files and add a new CommitTracker helper for testing. 2025-12-16 08:01:49 -05:00
David Garza 157a7e0145 Add default commit workflow and activity strategy configuration and usage examples
- Introduced methods to set default workflow and activity commit strategies in CommitStrategiesFeature.
- Updated CommitStateOptions to include properties for default strategies.
- Added extension methods for configuring default strategies in WorkflowsFeature.
- Created usage examples demonstrating how to set and utilize default commit strategies.
- Implemented tests to verify default strategy behavior in various scenarios.
2025-12-16 08:01:49 -05:00
Jelger Ribbers 82acecdbd2 add work flow instance 2025-12-15 10:57:10 +01:00
Sipke Schoorstra 4bbdd6f3a7
Configures Flowchart Execution via DI (#7141)
* Introduce `FlowchartExecutionMode` to streamline flowchart execution logic.

- Added `FlowchartExecutionMode` enum to represent execution modes (Default, TokenBased, CounterBased).
- Updated flowchart-related integration and unit tests to use the new execution mode.
- Removed the global `UseTokenFlow` flag in favor of execution-specific configuration via `RunWorkflowOptions`.
- Refactored flowchart-related APIs and test helpers for improved flexibility and modularity.

* Add support for configuring flowchart execution behavior via `FlowchartOptions` and DI.

- Introduced extensions for `FlowchartFeature` to simplify configuration.
- Added DI support for setting default execution modes.
- Refactored flowchart execution logic to prioritize configuration.

* Update default Flowchart execution settings to align with version 3.5.2 behavior

- Changed `DefaultExecutionMode` to `CounterBased`.
- Updated `UseTokenFlow` default to `false`.

* Update src/modules/Elsa.Workflows.Core/Activities/Flowchart/Models/FlowchartExecutionMode.cs

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

* Update src/modules/Elsa.Workflows.Core/Activities/Flowchart/Extensions/FlowchartFeatureExtensions.cs

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

* Update test/integration/Elsa.Workflows.IntegrationTests/Scenarios/FlowchartNextActivity/Tests.cs

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

* Update src/modules/Elsa.Workflows.Core/Activities/Flowchart/Extensions/RunWorkflowOptionsExtensions.cs

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

* Refactor flowchart integration tests for improved formatting and consistency

* Refactor workflow tests and related services to improve reusability and align with updated Flowchart execution behavior

* Update src/modules/Elsa.Workflows.Core/Activities/Flowchart/Options/FlowchartOptions.cs

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

* Refactor flowchart execution logic to use `FlowchartExecutionMode` enum, replacing boolean checks for improved clarity and extensibility.

* Refactor tests and workflow logic to replace boolean `useTokenFlow` with `FlowchartExecutionMode` enum for clarity and consistency.

* Refactor flowchart execution logic to centralize mode-based behavior handling and simplify implementation.

* Remove unnecessary whitespace in Flowchart.cs to improve code formatting

* Remove unnecessary whitespace in FlowJoinTests.cs to improve code formatting

* Update src/common/Elsa.Testing.Shared.Integration/WorkflowTestFixture.cs

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

* Update src/modules/Elsa.Workflows.Core/Activities/Flowchart/Activities/Flowchart.cs

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-15 10:15:39 +01:00
Sipke Schoorstra 8b9070df09
Bump AutoMapper package version to 16.0.0 in Directory.Packages.props. 2025-12-14 20:25:13 +01:00
Sipke Schoorstra ba004b7572
Bump Microsoft.Extensions.Http.Resilience and Microsoft.Extensions.Resilience package versions to 10.1.0 in Directory.Packages.props. 2025-12-14 20:05:42 +01:00
Sipke Schoorstra 8fd38a9949
Mark IActivityFactory and related methods as obsolete; add ActivityFactoryExtensions for backward compatibility 2025-12-14 19:43:24 +01:00
Sipke Schoorstra 33af795704
Refactor runAsynchronously logic and remove TaskActivityAttribute
Replaced `TaskActivityAttribute` with `RunAsynchronously` property in `ActivityDescriptor`, simplifying activity configurations. Updated references across code to adopt this new approach, ensuring consistent behavior for asynchronous task activities. Minor changes to naming conventions and style settings were also included.
2025-12-14 13:44:06 +01:00
Sipke Schoorstra 6f64739d83
Merge remote-tracking branch 'origin/develop/3.6.0' into develop/3.6.0 2025-12-13 21:33:05 +01:00
Sipke Schoorstra 867a1eecbb
Remove unused target frameworks from EF Core persistence project files
Simplified the EF Core project files by eliminating redundant `net9.0` and `net10.0` target frameworks.
2025-12-13 21:32:47 +01:00
Sipke Schoorstra e6899ac32c
Remove legacy API key and service management functionality.
Deleted obsolete API key and service management classes, endpoints,
and associated UI components. These functionalities are no longer
required and their removal simplifies the codebase by eliminating
unused or redundant features.
2025-12-13 20:00:18 +01:00
Sipke Schoorstra dd6bfbb6b0
Comment out SQL Server image configuration in component test infrastructure. 2025-12-11 10:05:39 +01:00
Sipke Schoorstra 14189494b2
Switch component tests database configuration from PostgreSQL to SQL Server. 2025-12-11 09:58:45 +01:00
Sipke Schoorstra 183934c1af
Revert component tests database configuration from SQL Server to PostgreSQL. 2025-12-11 09:54:16 +01:00
Sipke Schoorstra 1107b48200
Switch component tests from PostgreSQL to SQL Server and update related configurations. 2025-12-11 09:45:37 +01:00
Sipke Schoorstra 7add1030c4
Update documentation to reflect .NET 10.0 support and remove deprecated references to external dependencies 2025-12-11 09:17:35 +01:00
Sipke Schoorstra 068b2079cc
Update Dockerfiles to remove "bookworm-slim" tag from .NET SDK and ASP.NET runtime images 2025-12-10 21:44:48 +01:00