Commit graph

5465 commits

Author SHA1 Message Date
Sipke Schoorstra f626bff2d5 Handle prereleased action in GitHub workflow
Update the workflow to handle prereleases by modifying the conditions to include "prereleased" in addition to "published" for the "release" event. This ensures that the workflow functions correctly for both prereleases and official releases.
2024-11-12 10:58:50 +01:00
Sipke Schoorstra 50e2151846 Add order properties to HTTP request inputs
Assign order properties to input attributes in `SendHttpRequestBase` and `FlowSendHttpRequest` classes. This change ensures a consistent input display order in the generated UI.
2024-11-12 10:25:22 +01:00
Sipke Schoorstra 103034667c
Add configuration actions for DbContext options builders (#6110)
* Add configuration actions for DbContext options builders

Introduce a configuration delegate parameter for each database provider's `Use*` methods, enhancing customization. This change affects MySql, SqlServer, Sqlite, PostgreSql, and Oracle providers, allowing more flexible DbContext configuration.

* Add support for connection strings as functions

This update introduces new overloads to allow passing connection strings as functions that take IServiceProvider. This enhances flexibility by enabling dynamic connection string resolution at runtime. All major database providers (MySQL, SQL Server, SQLite, PostgreSQL, and Oracle) have been updated accordingly.
2024-11-11 19:01:41 +01:00
Sipke Schoorstra 51793d08a6 Refactor variable management methods to use async naming
Updated method names in `IWorkflowInstanceVariableManager` and `WorkflowInstanceVariableManager` to use the `Async` suffix for consistency. This change improves code readability and aligns with async programming conventions.
2024-11-09 17:49:45 +01:00
Sipke Schoorstra 55b9361253
Add services and API endpoints to read and write workflow instance variables (#6107)
* Regenerate 3.3 EF Core migrations

* Refactor variable handling in API responses.

Updated `ApiResponseExtensions` to handle potential null issue flagged by ReSharper. Refactored `Endpoint.cs` in WorkflowInstances to use `ResolvedVariableModel` for better type safety and clarity.

* Add API endpoint to retrieve workflow variables

Introduce a new endpoint to get workflow instance variables in `IWorkflowInstancesApi`. Added `ResolvedVariable` model and adjusted `WorkflowInstances` endpoint to return a list of these variables.

* Add endpoint for updating workflow instance variables

Introduce a new API endpoint to update workflow instance variables using the DefaultWorkflowInstanceVariableWriter. Also creating the necessary interfaces and classes, and renaming existing ones for consistency.

* Add IWorkflowInstanceVariableManager interface and implementation

Introduce the IWorkflowInstanceVariableManager interface and its implementation, enabling variable management for workflow instances. Refactor existing endpoints to utilize this new manager, streamlining the variable retrieval and update processes.
2024-11-09 17:42:08 +01:00
Sipke Schoorstra e0875683b9 Merge branch 'feat/variables-api' 2024-11-08 22:24:00 +01:00
Sipke Schoorstra 560ce08c45 Refactor namespaces and add Scrutor package
Streamlined the used namespaces across multiple files by removing unnecessary imports. Added the Scrutor package to the project dependencies for dependency injection uses.
2024-11-08 22:23:38 +01:00
Sipke Schoorstra 648fbf74cf Merge remote-tracking branch 'origin/blueberry' 2024-11-08 21:58:32 +01:00
Sipke Schoorstra b6e653e151 Add cleanup step to workflow definition reload test
Added a cleanup step in the ReloadWorkflowTests to delete the workflow definition and its versions after the test runs. This ensures that the tests do not leave residual data, maintaining a clean state for subsequent tests.
2024-11-08 21:58:11 +01:00
Sipke Schoorstra e79b8c87d7 Merge remote-tracking branch 'origin/blueberry' 2024-11-08 21:50:55 +01:00
Ray 3aafcddb02
Fix hangfire resume workflow (#6097)
There was a bug in the hangfire implementation where it would always generate a random workflowinstanceid because it was not passed into the createclient. Because of this hangfire was unable to resume instances.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2024-11-08 21:43:52 +01:00
Robin Sue 19a79ba412
Remove unused classes (#6104)
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2024-11-08 21:42:58 +01:00
Robin Sue aeedf9d24c
Undo Migrations reset, fixes #6103 (#6105)
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2024-11-08 21:42:02 +01:00
Sipke Schoorstra 729370a203 Merge branch 'enh/update-consuming-workflows' into blueberry 2024-11-08 21:40:17 +01:00
Sipke Schoorstra 111fa10aab Remove unused dependency from ReloadWorkflowTests
Eliminated the IWorkflowDefinitionCacheManager dependency from the ReloadWorkflowTests constructor and fields. This cleanup helps streamline the code and maintainability by removing an unnecessary service.
2024-11-08 21:39:27 +01:00
Sipke Schoorstra e5e7211504 Add workflow definition cache manager to test setup
The IWorkflowDefinitionCacheManager has been added to the test class. This ensures proper cache management during workflow definition reload tests. Additionally, a cleanup step to delete the workflow definition and its versions has been included.
2024-11-08 21:39:01 +01:00
Sipke Schoorstra a0aa420a12
Keep Published Workflows Immutable by Updating Drafts Instead (#6106)
* Add workflow graph network builder and child workflow finder

Introduce IWorkflowGraphNetworkBuilder and IChildWorkflowFinder interfaces with their implementations to build and manage workflow graph networks. Additionally, register new services and handlers to support these functionalities in the Workflow Management feature.

* Remove unused workflow graph network builder

Deleted the unused `IWorkflowGraphNetworkBuilder` interface, its implementation, and related files. Updated affected classes to replace dependency on the removed builder with direct methods. Enhanced affected workflows tracking during publication.

* Optimize workflow update logic to skip redundant checks

Added condition to ensure only relevant activities are processed by verifying their version IDs. This reduces unnecessary computations and ensures the system skips already up-to-date workflow activities.

* Add workflow reference updater implementation

Introduced IWorkflowReferenceUpdater interface to manage workflow references updates. Implemented the corresponding service and integrated it into existing event handling logic. This improves maintainability and reduces code duplication by isolating the reference update logic.

* Set workflow activity version during update

Added a missing assignment of the workflow activity version in the `UpdateWorkflowDefinition` method. This ensures that the `Version` field is properly set when workflow definitions are updated.

* Remove UpdateReferencesInConsumingWorkflows method

Eliminated the UpdateReferencesInConsumingWorkflows method from IWorkflowDefinitionPublisher and its implementation from WorkflowDefinitionPublisher. The responsibility of updating workflow references is now transitioned to IWorkflowReferenceUpdater used in the `UpdateReferences` endpoint.

* Remove WorkflowGraphNetwork and WorkflowGraphNode models

These models were deleted as they are no longer needed in the system. The removal helps in reducing code clutter and improves maintainability by eliminating unused components.

* Refactor parameter naming in IWorkflowReferenceUpdater

Renamed 'definition' to 'referencedDefinition' for clarity in the IWorkflowReferenceUpdater contract and its implementation. This change makes it explicit that the parameter refers to the workflow definition being referenced, ensuring the code is more understandable and maintainable.

* Update WorkflowReferenceUpdater for clarity and accuracy

Renamed variables and updated comments for better clarity. The term "matchingWorkflowGraphs" was changed to "consumingWorkflowGraphs" to more accurately describe its purpose. Adjusted comment to clarify the materialization process of the draft version.

* Add IsReadonly filter to WorkflowDefinitionFilter

This ensures that only non-readonly workflow definitions are fetched. It enhances the accuracy of workflow updates by filtering out readonly versions.
2024-11-08 18:19:42 +01:00
Sipke Schoorstra e46fa84647 Add IsReadonly filter to WorkflowDefinitionFilter
This ensures that only non-readonly workflow definitions are fetched. It enhances the accuracy of workflow updates by filtering out readonly versions.
2024-11-08 18:18:47 +01:00
Sipke Schoorstra 6aa40143f3 Update WorkflowReferenceUpdater for clarity and accuracy
Renamed variables and updated comments for better clarity. The term "matchingWorkflowGraphs" was changed to "consumingWorkflowGraphs" to more accurately describe its purpose. Adjusted comment to clarify the materialization process of the draft version.
2024-11-08 18:13:59 +01:00
Sipke Schoorstra 6503612f7f Refactor parameter naming in IWorkflowReferenceUpdater
Renamed 'definition' to 'referencedDefinition' for clarity in the IWorkflowReferenceUpdater contract and its implementation. This change makes it explicit that the parameter refers to the workflow definition being referenced, ensuring the code is more understandable and maintainable.
2024-11-08 18:10:30 +01:00
Sipke Schoorstra 57cafd69a5 Remove WorkflowGraphNetwork and WorkflowGraphNode models
These models were deleted as they are no longer needed in the system. The removal helps in reducing code clutter and improves maintainability by eliminating unused components.
2024-11-08 18:07:59 +01:00
Sipke Schoorstra 8fe0147abd Remove UpdateReferencesInConsumingWorkflows method
Eliminated the UpdateReferencesInConsumingWorkflows method from IWorkflowDefinitionPublisher and its implementation from WorkflowDefinitionPublisher. The responsibility of updating workflow references is now transitioned to IWorkflowReferenceUpdater used in the `UpdateReferences` endpoint.
2024-11-08 18:00:21 +01:00
Sipke Schoorstra a7b0d5630d Set workflow activity version during update
Added a missing assignment of the workflow activity version in the `UpdateWorkflowDefinition` method. This ensures that the `Version` field is properly set when workflow definitions are updated.
2024-11-08 17:20:40 +01:00
Sipke Schoorstra cc86ee9f58 Add workflow reference updater implementation
Introduced IWorkflowReferenceUpdater interface to manage workflow references updates. Implemented the corresponding service and integrated it into existing event handling logic. This improves maintainability and reduces code duplication by isolating the reference update logic.
2024-11-08 17:16:21 +01:00
Sipke Schoorstra c7fa4468be Optimize workflow update logic to skip redundant checks
Added condition to ensure only relevant activities are processed by verifying their version IDs. This reduces unnecessary computations and ensures the system skips already up-to-date workflow activities.
2024-11-08 11:57:15 +01:00
Sipke Schoorstra 8c7a823374 Remove unused workflow graph network builder
Deleted the unused `IWorkflowGraphNetworkBuilder` interface, its implementation, and related files. Updated affected classes to replace dependency on the removed builder with direct methods. Enhanced affected workflows tracking during publication.
2024-11-08 11:45:25 +01:00
Carmine Giugliano 7ddb26a472
fix: fix ITaskApi refit contract in Elsa.Api.Client (#6102) 2024-11-07 22:03:48 +01:00
MariusVuscanNx 9c7ee16e96
Updated refit (#6098) 2024-11-06 15:04:28 +01:00
Sipke Schoorstra 311f59894e Add workflow graph network builder and child workflow finder
Introduce IWorkflowGraphNetworkBuilder and IChildWorkflowFinder interfaces with their implementations to build and manage workflow graph networks. Additionally, register new services and handlers to support these functionalities in the Workflow Management feature.
2024-11-06 11:58:13 +01:00
Sipke Schoorstra 3dec206548 Update Quartz services to Singleton
Changed QuartzWorkflowScheduler and QuartzCronParser to singleton services to ensure a single instance is used throughout the application. This modification aims to improve resource management and consistency in scheduling operations.
2024-11-05 22:39:59 +01:00
Sipke Schoorstra 6ed6c8a30e Merge remote-tracking branch 'origin/patch/3.2.x' into blueberry 2024-11-05 15:46:02 +01:00
Sipke Schoorstra 98d914f29d Remove Hangfire integration sample project
Removed the entire Hangfire integration sample project, including all associated files and configurations. This cleanup ensures the solution is leaner and easier to maintain, focusing on core components.
2024-11-04 22:55:19 +01:00
Sipke Schoorstra a397b6799e Add new sample project for ASP.NET Hangfire Integration
Introduced a new sample project to demonstrate ASP.NET integration with Hangfire, including setup configurations in `appsettings.json`, program initialization, and a background job activity. This will serve as a reference implementation for integrating Elsa with Hangfire in ASP.NET applications.
2024-11-04 11:59:47 +01:00
Sipke Schoorstra d46d0b53bc Add SQLite setup in CommonPersistenceFeature and remove from Agents
Moved `SetupForSqlite` entity model handler to `CommonPersistenceFeature` to centralize SQLite configuration. Removed it from `Agents.Persistence.EntityFrameworkCore` to avoid redundancy.
2024-11-04 11:51:37 +01:00
Sipke Schoorstra 7129f86e1e Add SQLite support to entity model creation
This commit introduces a new scoped service for `IEntityModelCreatingHandler` to handle SQLite database setups. The inclusion of `SetupForSqlite` allows the application to support SQLite alongside Oracle for entity models.
2024-11-04 11:47:53 +01:00
Sipke Schoorstra 54f6d27082 Add method to resume bookmark with ID and input dictionary
This commit introduces a new method in both `BookmarkResumer` and `IBookmarkResumer` to resume a bookmark using a bookmark ID and an input dictionary. This enhancement allows more flexibility in resuming bookmarks with varying input parameters.
2024-11-04 11:05:18 +01:00
Sipke Schoorstra 819f27ddf1 Add overload for resuming bookmarks by bookmark ID
Introduce a new overload in IBookmarkResumer to resume bookmarks using a bookmark ID. This addition provides an alternative method for resuming bookmarks, enhancing flexibility and usability in workflow scenarios. Adjusted existing method parameters to have default values for better consistency.
2024-11-04 10:55:53 +01:00
Sipke Schoorstra e0135c9403 Switch to MassTransit for distributed caching
Updated the distributed caching transport to use MassTransit instead of ProtoActor, aligning with our existing MassTransit broker. Additionally, disabled agent usage for consistency with the current configuration. These changes streamline our configuration and ensure uniformity in our transport mechanisms.
2024-11-01 20:23:38 +01:00
Sipke Schoorstra 9ecbb3f360 Comment out scope disposal and update server configurations
Commented out Scope disposal to prevent test runner hangs in component tests. Adjusted Cluster class to use property initializers instead of constructor. Updated workflow server connection strings and added detailed SQL Server configuration in Program.cs.
2024-11-01 18:02:47 +01:00
Sipke Schoorstra ab7fcbc334 Update branch check condition in GitHub Actions workflow
Replaced the branch check from "patch/3.2.x" to "main" to ensure the correct branch is targeted during the release process. This change improves the accuracy of the conditional checks within the workflow.
2024-10-31 20:17:25 +01:00
Sipke Schoorstra fa2e615eb2 Disable SignalR and add authorization to WorkflowInstanceHub
SignalR functionality is temporarily disabled until Elsa Studio sends authenticated requests. Additionally, added the [Authorize] attribute to WorkflowInstanceHub to enforce authorization on workflow events.
2024-10-31 20:10:06 +01:00
Sipke Schoorstra b3c73e99ea Disable SignalR in Elsa Server
Updated `useSignalR` flag to false in `Program.cs` due to Elsa Studio's current inability to send authenticated requests to the SignalR hub. This change ensures better security and stability until the necessary update is implemented.
2024-10-31 19:59:42 +01:00
Sipke Schoorstra 91b7e0c800 Add authorization to WorkflowInstanceHub
This commit decorates the WorkflowInstanceHub class with the [Authorize] attribute to ensure that only authorized users can connect to the SignalR hub. This change improves the security of the workflow event notification system.
2024-10-31 19:53:26 +01:00
Marko Lahma 575892c44f
Enable CPM transitive pinning and resolve version conflicts (#6069)
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2024-10-31 09:12:21 +01:00
Sipke Schoorstra 4acde73dad
Add bookmark queue purger functionality (#6080)
* Add bookmark queue purger functionality

Introduce a new class `DefaultBookmarkQueuePurger` to purge old bookmark queue items. This includes an interface `IBookmarkQueuePurger` and a recurring task `PurgeBookmarkQueueRecurringTask`, with necessary updates to `IBookmarkQueueStore` implementations and application configuration.

* Update purging logic in DefaultBookmarkQueuePurger

Refactor the purging operation to use a threshold date for clarity. This includes updating log messages and filter creation to enhance readability and maintainability.
2024-10-31 09:09:05 +01:00
Sipke Schoorstra 14b772704d
Add workflow activation and startup services. (#6076)
* Add workflow activation and startup services.

Introduced `IWorkflowActivationStrategyEvaluator` and `DefaultWorkflowStarter` to evaluate and initiate workflows based on defined strategies. Updated existing classes and methods to utilize these services, ensuring workflows comply with activation strategies.

* Refactor CreateClientAsync method usage

Modify the call to CreateClientAsync to include instanceId. This ensures that the workflow client is correctly initialized with the instance ID, improving the accuracy of handling workflow instances.
2024-10-30 22:51:14 +01:00
Sipke Schoorstra 6093eea01b
Add workflow cancellation notifications (#6075)
Introduced WorkflowCancelled and WorkflowCancelling notification records. Changed cancellation service to return a boolean instead of an integer. Integrated mediator notifications in the workflow canceler service.
2024-10-30 19:46:36 +01:00
Sipke Schoorstra 83860db22c
Refactor FormUrlEncodedHttpContentFactory for better flexibility (#6074)
Updated the GetContentAsDictionary method to handle different types of content more gracefully. Changed the type from Dictionary to IDictionary to increase compatibility. Adjusted content serialization to accommodate varying input formats reliably.
2024-10-30 19:35:16 +01:00
Sipke Schoorstra c49a92b5b7 Refactor signals and activity cancellation logic
Changed static signals to instance variables in test classes for better encapsulation. Increased default timeout in `SignalManager` to 60 seconds. Removed unused cancellation token logic in `ActivityExecutionContext`.
2024-10-30 19:04:48 +01:00
Sipke Schoorstra 6be9e53de1 Add new project reference to solution file
This commit updates Elsa.sln to include a new project reference with GUID {2CDF3E1C-267D-4198-B1C7-7E1F548FC120}. This ensures that the project dependencies are correctly tracked within the solution.
2024-10-30 11:53:57 +01:00