Commit graph

2020 commits

Author SHA1 Message Date
Sipke Schoorstra fe65476bf2
Add WorkflowExecutionState to manage execution context state
Introduce `WorkflowExecutionState` to encapsulate execution state changes for workflows. This ensures proper handling of execution flags during the lifetime of the state object and resets them upon disposal.
2025-03-15 20:03:22 +01:00
Sipke Schoorstra ba08d97b38
Refactor activity execution state handling with IDisposable
Introduce `EnterExecution` method to manage activity execution state using a `using` block for cleaner and safer resource handling. Removed manual flags for tracking execution state, streamlining workflow logic and improving maintainability.
2025-03-15 20:01:02 +01:00
Sipke Schoorstra 62da3c8618
Merge pull request #6491 from Green7/dapper-fix-delete-without-filter
Correct the issue with DeleteAsync not executing due to a premature p…
2025-03-14 23:07:26 +01:00
Sipke Schoorstra ac7428da0b
Merge pull request #6497 from truthz03/feature/6400
#6400 Add ClearProvider again to ActivityRegistry
2025-03-14 23:06:22 +01:00
Sipke Schoorstra d8208d2fe7
Merge pull request #6495 from elsa-workflows/enh/explicit-deterministic-variable-id
Refactor variable initialization for clarity and consistency
2025-03-14 23:05:35 +01:00
Sipke Schoorstra 146791f72a
Merge pull request #6475 from KnibbsyMan/feat/sql-enhancements
Enhancement - Additional SQL Activity Features
2025-03-14 23:04:50 +01:00
Sipke Schoorstra 094291b673
Merge branch 'main' into enh/workflowinstance-name 2025-03-14 23:03:33 +01:00
Thomas Trummer 90d8949661 #6400 Add ClearProvider again to ActivityRegistry 2025-03-14 10:13:02 +01:00
Thomas Trummer 996b831886 #6400 Add ClearProvider again to ActivityRegistry 2025-03-14 09:49:52 +01:00
Sipke Schoorstra 923e9d335d
Refactor variable initialization for clarity and consistency
Updated variable constructors across the codebase to use explicit names and initial values where applicable. Deprecated old constructor overloads and added new methods and overloads for better flexibility and readability. Minor cleanup includes replacing `default` keywords with `null` and streamlining code syntax.
2025-03-13 21:05:28 +01:00
Matt 2ff6df44c8
Merge branch 'elsa-workflows:main' into feat/sql-enhancements 2025-03-13 19:46:07 +00:00
Matt e43074755e
Merge branch 'elsa-workflows:main' into feat/datetime-picker 2025-03-13 19:21:39 +00:00
Matt 016600b838 Adds Support For New DateTimePicker UI Component And Re-Orders the InputUIHints. 2025-03-13 19:13:16 +00:00
Sipke Schoorstra e3e298984f
Refactor Variable class and add WithId method
Replaced `default` with `null` to improve readability and clarify initialization. Added a `WithId` method to allow assigning an ID to `Variable` instances for enhanced configurability. These changes improve usability and maintain consistency in the codebase.
2025-03-13 11:54:46 +01:00
Sipke Schoorstra 882ea8cf57
Refactor variable merging logic in ActivityExecutionContext
Replaced LINQ-based logic with a dictionary approach to merge variables. This ensures that variables are consistently merged by either name or ID when name is absent. It improves code clarity and handles edge cases more robustly.
2025-03-13 11:54:28 +01:00
Matt 819738d4d4
Merge branch 'elsa-workflows:main' into feat/sql-enhancements 2025-03-12 17:26:08 +00:00
Green7 8f964a682a Correct the issue with DeleteAsync not executing due to a premature parameter check
The DeleteAsync method was terminating prematurely because the presence of query parameters was checked before filters were applied. As a result, the deletion queries never executed since the query parameters were always empty before applying the filters.
2025-03-12 17:20:31 +01:00
Marius Vasile Vușcan 1ea83aff14
Removed optional purge 2025-03-12 13:58:38 +02:00
Marius Vasile Vușcan c2161d057a
Added missing functionalities from main as part of the blueberry merge 2025-03-12 13:34:57 +02:00
Marius Vasile Vușcan 2d26b21774
Fixed from the master merge 2025-03-10 15:52:10 +02:00
Marius Vasile Vușcan c4048fad4d
Merge branch 'refs/heads/main' into blueberry
# Conflicts:
#	.github/workflows/packages.yml
#	Directory.Packages.props
#	samples/aspnet/Elsa.Samples.AspNet.EntityFrameworkCore.PostgresSql/Elsa.Samples.AspNet.EntityFrameworkCore.PostgresSql.csproj
#	src/Directory.Build.props
#	src/apps/Elsa.Server.LoadBalancer/Elsa.Server.LoadBalancer.csproj
#	src/apps/Elsa.ServerAndStudio.Web/Elsa.ServerAndStudio.Web.csproj
#	src/apps/Elsa.Studio.Web/Elsa.Studio.Web.csproj
#	src/apps/ElsaStudioWebAssembly/ElsaStudioWebAssembly.csproj
#	src/bundles/Elsa.Server.Web/Elsa.Server.Web.csproj
#	src/clients/Elsa.Api.Client/Elsa.Api.Client.csproj
#	src/clients/Elsa.Api.Client/Extensions/DependencyInjectionExtensions.cs
#	src/clients/Elsa.Api.Client/Resources/Alterations/Models/AlterationPlan.cs
#	src/clients/Elsa.Api.Client/Resources/Alterations/Models/AlterationPlanParams.cs
#	src/clients/Elsa.Api.Client/Resources/Alterations/Models/AlterationWorkflowInstanceFilter.cs
#	src/clients/Elsa.Api.Client/Resources/Alterations/Responses/RunRequest.cs
#	src/modules/Elsa.Common/Elsa.Common.csproj
#	src/modules/Elsa.Dapper/Elsa.Dapper.csproj
#	src/modules/Elsa.Expressions/Elsa.Expressions.csproj
#	src/modules/Elsa.Http/Activities/SendHttpRequestBase.cs
#	src/modules/Elsa.Http/Elsa.Http.csproj
#	src/modules/Elsa.MassTransit.AzureServiceBus/Handlers/RemoveOrphanedSubscriptions.cs
#	src/modules/Elsa.MassTransit/Services/MassTransitWorkflowDispatcher.cs
#	src/modules/Elsa.ProtoActor/Mappers/WorkflowExecutionResultMapper.cs
#	src/modules/Elsa.ProtoActor/Proto/Shared.proto
#	src/modules/Elsa.ProtoActor/Proto/WorkflowInstance.Messages.proto
#	src/modules/Elsa.Quartz.EntityFrameworkCore.PostgreSql/Elsa.Quartz.EntityFrameworkCore.PostgreSql.csproj
#	src/modules/Elsa.Quartz/Elsa.Quartz.csproj
#	src/modules/Elsa.Workflows.Core/Contexts/StorageDriverContext.cs
#	src/modules/Elsa.Workflows.Runtime.ProtoActor/Extensions/ProtoOutputExtensions.cs
#	src/modules/Elsa.Workflows.Runtime/Activities/ExecuteWorkflow.cs
#	src/modules/Elsa.Workflows.Runtime/Features/WorkflowRuntimeFeature.cs
#	src/modules/Elsa.Workflows.Runtime/Handlers/ResumeExecuteWorkflowActivity.cs
#	src/modules/Elsa.Workflows.Runtime/HostedServices/WorkflowInboxCleanupHostedService.cs
#	src/modules/Elsa.Workflows.Runtime/Services/DefaultWorkflowRuntime.cs
#	test/component/Elsa.Workflows.ComponentTests/Scenarios/ExecuteWorkflows/ExecuteWorkflowsTests.cs
#	test/component/Elsa.Workflows.ComponentTests/Scenarios/ExecuteWorkflows/Workflows/MainWorkflow.cs
#	test/component/Elsa.Workflows.ComponentTests/Scenarios/ExecuteWorkflows/Workflows/SubroutineWorkflow.cs
#	test/integration/Elsa.Workflows.IntegrationTests/Scenarios/WorkflowCancellation/ProtoActorTests.cs
2025-03-10 15:13:26 +02:00
Sipke Schoorstra 82a1ae0126
Merge pull request #6481 from KnibbsyMan/bug/editor-autocomplete-issue
Bug - Update Scripting Activities To Resolve Auto Complete Issues
2025-03-10 08:58:03 +01:00
Sipke Schoorstra 7caaad5a8f
Merge pull request #6480 from bobhauser/6479-fix-flowjoin-waitany-with-backward-connection
Fixes issue with FlowJoin(WaitAny) where activities can be executed multiple times
2025-03-10 08:56:41 +01:00
Sipke Schoorstra 8dca671ae2
Merge pull request #6478 from elsa-workflows/bug/composite-activity-serialization
Fix serialization of composite activities
2025-03-10 08:54:42 +01:00
Matt 13bc8eef8a Update scripting activities to set the DefaultSyntax to allow autocomplete to work correctly with new PR. 2025-03-09 19:47:46 +00:00
Bob Hauser 6a42857f22 Fixes issue with FlowJoin(WaitAny) where activities can be executed multiple times 2025-03-08 19:59:55 -05:00
Sipke Schoorstra 1d7fd81b3e
Fix serialization of composite activities
Fixes that composite activities' Root property (by means of the `JsonIgnoreCompositeRootConverterFactory`) does not get serialized, just like the `WorkflowDefinitionActivity`.

Composite activities added to a workflow should not include their children when being serialized.
2025-03-08 21:50:43 +01:00
Sipke Schoorstra 66123a7dc8
Add support for passing initial variables
Introduce the ability to pass variables into workflow invocations. Updates include adding variables to workflow execution options, requests, and scheduling logic. This enhancement allows dynamic variable management during workflow execution and instance creation.
2025-03-08 11:47:58 +01:00
Sipke Schoorstra cebf60de35
Add SetDynamicVariable method to support dynamic variable creation
This new method enables adding dynamic variables to the appropriate variable container if no predefined variable exists. It ensures flexibility in handling variables within the activity execution context while maintaining logical consistency. Minor formatting adjustments were also applied to improve code readability.
2025-03-08 11:08:21 +01:00
Matt 963c8a0588
Merge branch 'elsa-workflows:main' into feat/sql-enhancements 2025-03-08 01:08:40 +00:00
Sipke Schoorstra 9b5b6cd947
Patch ObjectConverter
Patched `ObjectConverter` from the main branch, fixing a serialization bug with the workflow instance variable storage driver.
2025-03-07 20:29:29 +01:00
Sipke Schoorstra a9eb326c5e
Update bulk delete endpoints and request model
Refactor the bulk delete endpoint to include a new primary route while deprecating the old one. Expand the request model to support workflow definition filters and adjust response instantiation for clarity. Update obsolete API route prefix guidance for consistency across modules.
2025-03-07 10:04:41 +01:00
Matt bbbb405e74
Merge branch 'elsa-workflows:main' into feat/sql-enhancements 2025-03-06 22:08:35 +00:00
Raymond den Haan 5a3be276e0 Update HTTP resiliency configuration
Removed outer timeout since it was not working in the current set-up
Reduced maximum retry attempts to reduce the maximum amount of time spent on the request
2025-03-06 12:04:02 +01:00
Raymond den Haan eb89f78632 Update retry configuration to retry up to 4 minutes 2025-03-05 14:52:30 +01:00
Sipke Schoorstra 44b61aa24e
Add HttpContextAccessor to service registration
HttpContextAccessor is now included in the service container to enable dependency injection for accessing HTTP context. This improves support for features that require context details during runtime.
2025-03-03 19:13:51 +01:00
Sipke Schoorstra f71fbd23c7
Simplify HttpRequestException handling in retry logic.
Replaced specific transient status code check for HttpRequestException with a more generalized handling approach. This ensures all HTTP exceptions are retried, improving robustness and simplifying the logic.
2025-03-03 16:47:06 +01:00
Sipke Schoorstra 7b4cb375de
Adjust timeout and backoff calculations in HTTP pipeline.
Updated comments to correct total delay and grace period calculations for clarity and accuracy. This ensures consistency in expected retry behavior and improves maintainability.
2025-03-03 11:05:16 +01:00
Sipke Schoorstra 96075cca99
Add reference to Polly retry documentation in comments
Added a link to the Polly retry strategy documentation for clarity and future reference within the resiliency pipeline builder code. This improves code maintainability and helps developers quickly access relevant information.
2025-03-03 10:55:13 +01:00
Sipke Schoorstra ed5649091d
Reduce retry attempts and adjust timeout configuration
Lowered MaxRetryAttempts from 6 to 4 and reduced the outer timeout to 60 seconds to align with the updated exponential backoff total of 32 seconds. These changes aim to improve efficiency and reduce unnecessary waiting time during transient failures.
2025-03-03 10:53:32 +01:00
Sipke Schoorstra 9d19db09cf
Increase retry attempts and adjust delay/backoff configuration.
Updated the retry logic by increasing the max retry attempts from 4 to 6 and reducing the delay per attempt to 1 second. Adjusted the outer timeout to accommodate the new backoff configuration, allowing for a longer retry grace period.
2025-03-03 10:34:55 +01:00
Sipke Schoorstra c777add558
Update retry logic and timeout settings for HTTP requests
Increased max retry attempts to 4, removed jitter, and adjusted delay and backoff settings for clearer and more predictable behavior. Extended outer timeout to align with retry duration and added 409 Conflict to transient errors. Simplified logic for identifying transient network failures.
2025-03-03 10:30:39 +01:00
Sipke Schoorstra 74a1c50f66
Remove Agents projects
Deleted Agents projects. These projects are being migrated to elsa-integrations.
2025-03-02 15:55:29 +01:00
Sipke Schoorstra 42ab1a8944
Merge branch 'main' into feat/4832 2025-03-02 14:50:21 +01:00
KnibbsyMan 08b8a46190 Remove unnecessary code comments and code tidy. 2025-03-02 12:37:36 +00:00
Sipke Schoorstra 0ceeb801e7
Add support for naming workflow instances during execution
This update introduces a `Name` property to workflow execution requests, allowing workflows to be named when started. The changes ensure the `Name` is propagated through the relevant services and endpoints, improving tracking and identification of workflow instances.
2025-03-02 11:28:56 +01:00
Sipke Schoorstra 27fe72d123
Add WorkflowInstanceName property to Globals
Introduces a new property, `WorkflowInstanceName`, to access and modify the name of the current workflow instance. Also simplifies object initialization by using target-typed new expressions. Annotates the `Globals` class with `[UsedImplicitly]` to improve code analysis.
2025-03-02 11:24:21 +01:00
Sipke Schoorstra 549b4709d0
Add functions to get and set workflow instance name
Introduce `getWorkflowInstanceName` and `setWorkflowInstanceName` functions to the scripting engine. This enables retrieving and updating the workflow instance name dynamically during script execution. Additionally, the related function definitions have been added to the provider.
2025-03-02 11:22:03 +01:00
Sipke Schoorstra 046b88f5d2
Improved support for named workflow instances
Introduced the ability to set and persist custom names for workflow instances. Updated relevant classes, services, and tests to ensure proper handling of the `Name` property.
2025-03-02 11:17:18 +01:00
KnibbsyMan 9fce06b957 Adds expression support for SQL activities. 2025-03-01 23:05:27 +00:00