Commit graph

4962 commits

Author SHA1 Message Date
Sipke Schoorstra 1a135ecdc8 Merge tag '3.1.1' 2024-04-02 11:58:48 +02:00
Sipke Schoorstra 9b9454403b
Minor improvements and bug fixes following the 3.1 release (#5168)
* Move DynamicActivity.cs to Activities directory

The DynamicActivity.cs file has been moved from the Models directory to the Activities directory. This reorganization aims to ensure that the file's location correctly reflects its namespace.

* Add GetOutput method in ActivityExtensions

A new GetOutput method has been added to the ActivityExtensions.cs file. This method allows the retrieval of output with a specific name from an activity. Useful for handling complex types in workflow activities.

* Add feature check and refactor dependencies in Elsa

The commit introduces a new feature check in the `Module` class and refactors the dependencies in MassTransit features. Specifically, it enables querying for a specific feature before configuring the dispatcher endpoints, increasing flexibility and control. In addition, the responsibility for creating `IEndpointChannelFormatter` has been shifted from `MassTransitWorkflowDispatcherFeature` to `MassTransitFeature`, aligning with responsibility distribution.

Fixes #5165

* Add HasFeature method to IModule interface

The IModule interface has been updated to include two methods, HasFeature<T>() and HasFeature(Type featureType). These methods are designed to check if a specific type of feature has been configured, enhancing the functionality provided by the interface.

* Add WorkflowRuntimeFeature dependency

Removed unused namespaces from WorkflowsApiFeature class and added a new dependency on WorkflowRuntimeFeature. This change enhances the code cleanliness and ensures all required dependencies are correctly linked.

* Add activity completion functionality to multiple contexts

This commit introduces multiple methods to handle activity completion across various contexts, including ActivityExecutionContext and ActivityCompletedContext. It also includes updates to bookmark serialization and the WorkflowRuntime. The resulting changes should improve handling of activity outcomes and status updates in the application flow.

* Handle null options in DefaultWorkflowRuntime

Added null-conditional operators to prevent potential NullReferenceExceptions in DefaultWorkflowRuntime. This change ensures that even if the 'options' object is null, the code will not throw an exception and will instead use default values where applicable.

* Add ElsaDbContextOptions to DbContextOptionsBuilder

A line of code is added to enable applying ElsaDbContextOptions as default in DbContextOptionsBuilder within PersistenceFeatureBase. This change specifies the use of ElsaDbContextOptions when configuring the context options, enhancing the database context setup in the EntityFrameworkCore.Common module.

* Remove whitespace in Elsa.Server.Web.csproj

This commit removes unnecessary whitespaces at the end of the ProjectReference and PackageReference elements, in the Elsa.Server.Web.csproj file. This improves the readability and alignment of the code and follows the best practice for XML file format.

* Add MongoDB to docker-compose.yml

A MongoDB service has been added to the docker-compose file. The configuration includes port mapping and volume mapping for MongoDB data storage. This allows more flexibility in our environment setup with MongoDB now being spun up automatically.

* Add collection check in MongoDbStore before bulk save

Adjusted code structure, and divided longer lines of code into smaller, multi-line chunks for better readability. This refactoring makes the underlying operations and structuring of the code more apparent, aiding in future code maintenance and understanding.

* Change target branch in packages.yml workflow

This commit modifies the Github actions workflow for packaging. The branch from which to fetch changes is now specified explicitly as 'origin/patch/3.1.1' instead of the default 'origin/main'. This adjustment is specific for package creation under certain conditions.
2024-04-02 07:41:46 +02:00
Sipke Schoorstra 965d93028f Change target branch in packages.yml workflow
This commit modifies the Github actions workflow for packaging. The branch from which to fetch changes is now specified explicitly as 'origin/patch/3.1.1' instead of the default 'origin/main'. This adjustment is specific for package creation under certain conditions.
2024-04-01 23:29:23 +02:00
Sipke Schoorstra 728aa8e35b Add collection check in MongoDbStore before bulk save
Adjusted code structure, and divided longer lines of code into smaller, multi-line chunks for better readability. This refactoring makes the underlying operations and structuring of the code more apparent, aiding in future code maintenance and understanding.
2024-04-01 23:18:24 +02:00
Sipke Schoorstra 47bdfc96eb Add MongoDB to docker-compose.yml
A MongoDB service has been added to the docker-compose file. The configuration includes port mapping and volume mapping for MongoDB data storage. This allows more flexibility in our environment setup with MongoDB now being spun up automatically.
2024-04-01 23:18:18 +02:00
Sipke Schoorstra c555aaa802 Remove whitespace in Elsa.Server.Web.csproj
This commit removes unnecessary whitespaces at the end of the ProjectReference and PackageReference elements, in the Elsa.Server.Web.csproj file. This improves the readability and alignment of the code and follows the best practice for XML file format.
2024-04-01 23:18:13 +02:00
Sipke Schoorstra 9199ae991c Add ElsaDbContextOptions to DbContextOptionsBuilder
A line of code is added to enable applying ElsaDbContextOptions as default in DbContextOptionsBuilder within PersistenceFeatureBase. This change specifies the use of ElsaDbContextOptions when configuring the context options, enhancing the database context setup in the EntityFrameworkCore.Common module.
2024-04-01 23:18:07 +02:00
Sipke Schoorstra 8f7e24e1c1 Handle null options in DefaultWorkflowRuntime
Added null-conditional operators to prevent potential NullReferenceExceptions in DefaultWorkflowRuntime. This change ensures that even if the 'options' object is null, the code will not throw an exception and will instead use default values where applicable.
2024-04-01 23:18:01 +02:00
Sipke Schoorstra 37e220050d Add activity completion functionality to multiple contexts
This commit introduces multiple methods to handle activity completion across various contexts, including ActivityExecutionContext and ActivityCompletedContext. It also includes updates to bookmark serialization and the WorkflowRuntime. The resulting changes should improve handling of activity outcomes and status updates in the application flow.
2024-04-01 23:17:54 +02:00
Sipke Schoorstra 59a6fa719a Add WorkflowRuntimeFeature dependency
Removed unused namespaces from WorkflowsApiFeature class and added a new dependency on WorkflowRuntimeFeature. This change enhances the code cleanliness and ensures all required dependencies are correctly linked.
2024-04-01 23:17:48 +02:00
Sipke Schoorstra ce77155baa Add HasFeature method to IModule interface
The IModule interface has been updated to include two methods, HasFeature<T>() and HasFeature(Type featureType). These methods are designed to check if a specific type of feature has been configured, enhancing the functionality provided by the interface.
2024-04-01 23:17:24 +02:00
Sipke Schoorstra 96ba4f4e1c Add feature check and refactor dependencies in Elsa
The commit introduces a new feature check in the `Module` class and refactors the dependencies in MassTransit features. Specifically, it enables querying for a specific feature before configuring the dispatcher endpoints, increasing flexibility and control. In addition, the responsibility for creating `IEndpointChannelFormatter` has been shifted from `MassTransitWorkflowDispatcherFeature` to `MassTransitFeature`, aligning with responsibility distribution.

Fixes #5165
2024-04-01 23:17:17 +02:00
Sipke Schoorstra 298ee70ae2 Add GetOutput method in ActivityExtensions
A new GetOutput method has been added to the ActivityExtensions.cs file. This method allows the retrieval of output with a specific name from an activity. Useful for handling complex types in workflow activities.
2024-04-01 23:17:09 +02:00
Sipke Schoorstra af8c668743 Move DynamicActivity.cs to Activities directory
The DynamicActivity.cs file has been moved from the Models directory to the Activities directory. This reorganization aims to ensure that the file's location correctly reflects its namespace.
2024-04-01 23:17:01 +02:00
Sipke Schoorstra 93b78a1a1e Implement Noop Distributed Synchronization Provider
The code has been updated to include the usage of the Noop Distributed Locks from the Elsa.Common namespace. This was achieved by setting the runtime.DistributedLockProvider to a new instance of NoopDistributedSynchronizationProvider(). Evidently, this leads to an improvement in synchronization mechanism of the application.
2024-03-30 22:01:34 +01:00
Sipke Schoorstra c7481b2e64 Refactor synchronization provider selection in Program.cs
Rearranged the order in which synchronization providers are processed and removed some unnecessary empty lines. Specifically, moved the "File" case above the "Noop" case to optimize the synchronization provider selection process, as "File" is expected to be a more common use case.
2024-03-30 21:59:23 +01:00
Sipke Schoorstra ee2fdbe698 Merge branch 'main' of github.com:elsa-workflows/elsa-core 2024-03-30 21:25:14 +01:00
Sipke Schoorstra bd71b146c6 Update elsa-logo-art.psd 2024-03-30 21:25:07 +01:00
jdevillard 2195e43709
LogRecord storage at differents levels (#4911)
* Adding PersistenceStrategy and filter mapping for ActivityExecutionRecord

* Add default PersistenceStrategy provider/service

update ActivityMapper Implementation

* Fix Forgot to use the  Default Persistence from the Server configuration

* refactor the configuration of persistence in WorkflowManagementFeature

* rename PersistenceStrategy to LogPersistenceMode

* use const to defined LogPersistence Key in json and rename the key to logPersistenceMode

* Refactor PersistenceTab and update project references

Updated various aspects of the PersistenceTab class and its functionality to improve code quality and readability. Simplified the handling of persistence configurations and simplified the use of properties. Transitioned project reference for Elsa.Api.Client from package reference to direct project reference for better development experience in Elsa.Studio.Core.

* - Change how to get the Default Persistence Mode for an Activity.

/**
Because the entire workflow is considered as an activity, the schema must be the same
ie with
"logPersistenceMode": {
               "default": "default",
}
**/

- fix logic to get the default persistence mode working for the whole activity.

* fix default change value

---------

Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2024-03-30 21:22:35 +01:00
Sipke Schoorstra 5ae6d5918a Update default package version in GitHub workflows
The package version in the GitHub workflows configuration (.github/workflows/packages.yml) has been updated from 3.1.0 to 3.2.0. This change reflects version updates in the package management system.
2024-03-30 19:24:54 +01:00
Sipke Schoorstra 1a5a73136d Remove unnecessary whitespace in packages.yml
The whitespace after the if conditional in packages.yml was unused and unnecessary. This commit ensures to remove those to promote cleaner, more efficient code.
2024-03-30 19:24:12 +01:00
Sipke Schoorstra 7c9f9f5d38 Update branch verification in GitHub workflows
This commit modifies the branch verification procedure in the GitHub workflows file. The code now includes a condition that checks if the event is a release that has been published before proceeding with fetching from the main branch. For other cases, the procedure remains the same, with fetching taking place from the referenced branch.
2024-03-29 22:22:33 +01:00
Sipke Schoorstra 69aacd654b
Regenerate V3.1 EF Core migrations with custom runtime schema support (#5155)
* Reset EF Core migrations to 3.0

* Add V3_1 migration altering Status column and SerializableWorkflowInstanceIds

This commit adds a new migration file (V3_1) which alters the 'Status' column in the 'AlterationJobs' and 'AlterationPlans' tables to be of type string instead of int. It also renames the 'SerializedWorkflowInstanceIds' to 'SerializedWorkflowInstanceFilter' in the same tables. This update applies across multiple databases (MySQL, SQL Server, SQLite, PostgreSQL).

* Remove migration command from efcore-3.1.sh script

The Entity Framework Core 3.1 migration command line has been removed from the efcore-3.1.sh script. This modification ensures that migration handling relies solely on the 'ef-migration-runtime-schema' function.
2024-03-29 21:15:23 +01:00
raymonddenhaan 20f0134089
Fixed per instance distributed messaging (#5154)
- Configured MassTransitWorkflowCancellationDispatcher
- Fixed RabbitMQ endpoint configuration
- Fixed consumer configuration when running InMemory
2024-03-29 20:43:39 +01:00
Sipke Schoorstra c3686bf165
Fix flowchart completion after faulted child activity cancellation (#5145)
* Refactor alteration runner logic and simplify CancelActivityHandler

The DefaultAlterationRunner.cs file was refactored to include a workflow middleware pipeline, replacing the previous method of updating workflow state. Comments were added to discuss potential solutions for reusing the same pipeline in the workflow runtime. The CancelActivityHandler was simplified by removing multiple functions and replacing them with a single CancelAsync method.

* Add RunAlterationsMiddleware to handle workflow alterations

The commit introduces a new middleware, RunAlterationsMiddleware, that is designed to process workflow alterations. The middleware is in charge of executing alteration handlers and taking care of any required commit actions. The original code for handling alterations in DefaultAlterationRunner has been significantly reduced as it now delegates most of its responsibility to this new middleware.

* Add comments to IAlterationPlanManager interface methods

In the IAlterationPlanManager interface, explanatory comments were added to each method. These include methods for getting a plan by ID, checking if all jobs in the plan have been completed, and completing an alteration plan. The changes made will greatly aid in understanding the purpose and functionality of each method.

* Refactor pipeline execution methods and replace middleware

The workflow execution pipeline has been refactored to allow for dynamic configuration. The middleware components are now retrievable properties and can be replaced individually. This change provides more extensibility with modifying the pipeline execution and replacing the DefaultActivitySchedulerMiddleware with desired middleware.

* Refactor pipeline alteration and addition methods

Simplified the pipeline alteration process in Elsa.Alterations. Instead of manually handling middleware delegates, added a new extension method, ReplaceTerminal, in WorkflowExecutionMiddlewareExtensions.cs to replace the terminal middleware component. This approach improves code readability and maintenance.

* Refactor RunAlterationsMiddleware class

Removed an unnecessary extension class and updated the RunAlterationsMiddleware class to streamline its structure. The handlers are now initialized directly in the constructor, eliminating the need for an additional field. Renamed local variable for better code clarity.

* Refactor variable name in RunAlterationsMiddleware

The variable name 'handlers1' has been renamed to 'supportedHandlers' in the RunAlterationsMiddleware.cs file. This change improves code readability and makes it clear that the list contains only the handlers that can handle the given alteration.

* Change RunAsync method to return void

The RunAsync function in the RunAlterationsMiddleware class no longer returns a boolean value. The returned 'false' has been replaced with a 'return' statement, and the 'return true' statement has been completely removed. This refactor simplifies the control flow when executing alterations.

* Refactor variable handling and improve flowchart completion

Refactored variable value conversion and update logic in ModifyVariableHandler classes. Removal of some service dependencies simplifies the implementation and reduces coupling. Also streamlined completion process in Flowchart classes, making it more efficient and improving readability.

* Add running status filter to workflow instance finder

A new method was introduced to filter only running workflow instances before applying alterations in the "WorkflowInstanceFinder" service. The change ensures that alterations affect only workflows that are currently running, increasing the effectiveness and accuracy of the system.

* Rename ActivityId to ActivityNodeId in related classes

Modified the name of the 'ActivityId' property to 'ActivityNodeId' across multiple classes including 'ActivityWorkItemState' and 'WorkflowStateExtractor'. This change reflects the usage of NodeId more accurately in the workflow process. The methods 'FindActivityById' across classes were updated accordingly. Also, an attribute '[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]' was added to two methods in 'WorkflowRunner'.

* Refactor code in Flowchart class

Removed unnecessary variable 'flowchartContext' in the 'CompleteIfNoPendingWorkAsync' method of the Flowchart class. The 'context' variable has been used directly for the 'HasPendingWork' check and 'CompleteActivityAsync' call, simplifying the code without altering functionality.

* Update workflow methods with parameterless constructor constraints

This change introduces parameterless constructor constraints on workflow-related methods in Elsa.Workflows.Core. Specifically, both RunAsync and BuildWorkflowAsync methods had their generics constraint updated to require a parameterless constructor. This ensures only workflows with a parameterless constructor can be run or built. Additionally, unused usages of `RequiresUnreferencedCode` attribute were removed from Elsa.Features.
2024-03-29 20:38:09 +01:00
Sipke Schoorstra 0993b38b7a
Fix Alteration Runner (#5142)
* Refactor alteration runner logic and simplify CancelActivityHandler

The DefaultAlterationRunner.cs file was refactored to include a workflow middleware pipeline, replacing the previous method of updating workflow state. Comments were added to discuss potential solutions for reusing the same pipeline in the workflow runtime. The CancelActivityHandler was simplified by removing multiple functions and replacing them with a single CancelAsync method.

* Add RunAlterationsMiddleware to handle workflow alterations

The commit introduces a new middleware, RunAlterationsMiddleware, that is designed to process workflow alterations. The middleware is in charge of executing alteration handlers and taking care of any required commit actions. The original code for handling alterations in DefaultAlterationRunner has been significantly reduced as it now delegates most of its responsibility to this new middleware.

* Add comments to IAlterationPlanManager interface methods

In the IAlterationPlanManager interface, explanatory comments were added to each method. These include methods for getting a plan by ID, checking if all jobs in the plan have been completed, and completing an alteration plan. The changes made will greatly aid in understanding the purpose and functionality of each method.

* Refactor pipeline execution methods and replace middleware

The workflow execution pipeline has been refactored to allow for dynamic configuration. The middleware components are now retrievable properties and can be replaced individually. This change provides more extensibility with modifying the pipeline execution and replacing the DefaultActivitySchedulerMiddleware with desired middleware.

* Refactor pipeline alteration and addition methods

Simplified the pipeline alteration process in Elsa.Alterations. Instead of manually handling middleware delegates, added a new extension method, ReplaceTerminal, in WorkflowExecutionMiddlewareExtensions.cs to replace the terminal middleware component. This approach improves code readability and maintenance.

* Refactor RunAlterationsMiddleware class

Removed an unnecessary extension class and updated the RunAlterationsMiddleware class to streamline its structure. The handlers are now initialized directly in the constructor, eliminating the need for an additional field. Renamed local variable for better code clarity.

* Refactor variable name in RunAlterationsMiddleware

The variable name 'handlers1' has been renamed to 'supportedHandlers' in the RunAlterationsMiddleware.cs file. This change improves code readability and makes it clear that the list contains only the handlers that can handle the given alteration.

* Change RunAsync method to return void

The RunAsync function in the RunAlterationsMiddleware class no longer returns a boolean value. The returned 'false' has been replaced with a 'return' statement, and the 'return true' statement has been completely removed. This refactor simplifies the control flow when executing alterations.
2024-03-29 19:58:35 +01:00
Sipke Schoorstra f0eb19ac22
Make JetBrains.Annotations Private (#5151)
* Format Directory.Packages.props for readability

Indentation was adjusted in the Directory.Packages.props file to enhance readability and maintain a consistent style. No functional changes or impact on package versions were made.

* Update JetBrains.Annotations to private assets

The change in the commit modifies the JetBrains.Annotations package reference in Directory.Build.props to be included as private assets. This adjustment ensures that the JetBrains.Annotations won't be exposed publicly, increasing the security and the overall robustness of the system.

* Added missing references

---------

Co-authored-by: Raymond den Haan <raymond.den.haan@nexxbiz.io>
2024-03-29 19:46:00 +01:00
Sipke Schoorstra a84f33e1b6
Update FlowNode status terminology in BulkDispatchWorkflows (#5150)
* Update FlowNode status terminology in BulkDispatchWorkflows

The terminology for the task completion status has been changed in the BulkDispatchWorkflows class. This includes renaming 'Finished' to 'Complete' in the FlowNode attribute, and when calling CompleteActivityWithOutcomesAsync method. This change makes the status names more consistent across the application.

* Update input description in BulkDispatchWorkflows

The input description for the WaitForCompletion property in the BulkDispatchWorkflows activity has been modified for clarity. The previously mentioned condition about the 'Finished' outcome not triggering has been removed as it was creating confusion.

* Rename 'Finished' instances to 'Completed' instances

The code modifies the keywords related to instance statuses and actions in the Workflow activities, changing the term 'Finished' to 'Completed'. This is a global change, impacting variables, properties, cases, and methods. The update serves to improve the clarity and preciseness of the terms used in the workflow process.

* Add SuppressUnreferencedCode attributes and rename methods

The Elsa.Workflows.Runtime module has been updated to suppress warnings from the new .NET 5.0 UnreferencedCode attribute in two methods. Additionally, the name of the method "CheckIfFinishedAsync" in "BulkDispatchWorkflows.cs" has been renamed to "CheckIfCompletedAsync" for clarity and improved readability.
2024-03-29 09:55:17 +01:00
James Thompson 1b56f5d6a2
#5106 Cleanup packages to leverage framework (#5129) 2024-03-29 09:54:44 +01:00
James Thompson 4f250f4b7b
#5107 Add framework reference & package removal (#5128) 2024-03-28 21:35:47 +01:00
Raymond den Haan 830ed03c13 Converted registry to use concurrent dictionaries 2024-03-28 16:18:47 +01:00
Raymond den Haan b870c1efe6 Added check if workflow exists before cancelling 2024-03-28 16:18:47 +01:00
Sipke Schoorstra b7074e45d2 Refactor BackgroundTaskDispatcher and update lifecycle
Refactored the BackgroundTaskDispatcher class to accept the INotificationSender service directly rather than the IServiceScopeFactory. This change simplifies the dispatch process. Also, adjusted the service lifecycle of RunTaskDispatcher, changing it from singleton to scoped.
2024-03-28 16:05:28 +01:00
raymonddenhaan 673f5dfdbc
Prevented creation of default queues for temporary consumers (#5148) 2024-03-28 15:42:51 +01:00
raymonddenhaan 4b151ff8af
Feature/cancel dispatched workflows (#5136)
* Made cancel API call dispatch the request

* Added ParentWorkflowInstanceId

* Recursively cancel child workflows

* Made single workflow cancellation include child workflows

* Updated migrations

* Processed comments
2024-03-27 12:07:55 +01:00
Sipke Schoorstra b7991fd99d Add ConfigureAwait to FodyWeavers.xml
A ConfigureAwait tag was added to the FodyWeavers.xml file in the Elsa.Server.LoadBalancer bundle. This adjustment will influence how awaitable tasks are resumed in the .NET asynchronous programming model.
2024-03-25 11:00:07 +01:00
Sipke Schoorstra 5214207af6 Update Elsa.Server.LoadBalancer project settings and Elsa.sln
The Elsa.Server.LoadBalancer project settings have been updated to support multiple target frameworks (net7.0 and net8.0), with Linux defined as the default target OS for Docker. Additionally, the build.sh file reference has been added to the Elsa.sln solution.
2024-03-25 10:54:27 +01:00
Sipke Schoorstra 3aa6c7dbe5 Update Elsa.Server.LoadBalancer project settings
Two new properties have been introduced in the Elsa.Server.LoadBalancer project file. These include setting the 'IsPackable' attribute to 'false', preventing the project from being packaged and setting the 'LangVersion' to 'latest', to use the latest available version of C#.
2024-03-25 09:21:31 +01:00
raymonddenhaan 9d3f685bb6
Implemented distributed cache refresh for workflow definitions (#5095)
* Moved handler to correct namespace

* Added version deletion messages to activity registry handler

* Add MassTransit support for workflow management

* Moved logic from Workflow.Management.MassTransit project into Elsa.MassTransit project

* Added notifier to MT project for creating distributed messages

* Rename and update workflow consumer class

Renamed `WorkflowDefinitionConsumer` to `WorkflowDefinitionEventsConsumer` to better reflect its purpose. Updated references accordingly in the `MassTransitWorkflowManagementFeature` class to align with the new name.

* Shortened instance (queue) names

* Remove unnecessary comment in handler definition

An unnecessary comment mark ("/") was removed in the definition of the DistributedWorkflowDefinitionNotificationsHandler class. This change contributes to code cleanup and increases code readability.

* Add additional destinations in LoadBalancer settings

Three new destinations have been added to the LoadBalancer settings in Elsa Server. These are primarily intended to provide broader network coverage and improve overall server performance.

* Add MassTransit support in Elsa.Server

A new using directive for Elsa.MassTransit.Extensions has been included at the start of the script. In addition, under certain conditions, the system now uses the MassTransit Dispatcher in the workflow management system. These changes provide support for using MassTransit in the Elsa.Server component.

* Add MassTransitBroker enum for MassTransit setup

A new enum called MassTransitBroker has been added to represent different types of messaging brokers used in MassTransit. This has also been integrated into the Web project's Program.cs file to allow conditional usage of brokers in the MassTransit setup, enabling more flexible and dynamic configuration.

* Refactor WorkflowManagementFeature class

The WorkflowManagementFeature class has been cleaned up and its formatting has been corrected. A blank line was removed, a line break was added for readability in the AddVariableType method, and several stray spaces were also removed.

* Refactor RefreshActivityRegistryHandler.cs

This commit removes unnecessary whitespace and improves the code readability in RefreshActivityRegistryHandler.cs. The changes include deletion of extra lines and adjustment of indentation.

---------

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2024-03-24 21:09:51 +01:00
Sipke Schoorstra 83dd776233 Add new docker-compose files, new activities and services
Create new docker-compose files for non-data dog and data dog services. New services include Postgres, cockroachdb, rabbitmq, redis, and elsa-server. Along with the services, a new bash script for migration and various new activities and endpoints are also added for the Elsa server. This set of changes broadens the operational environment of Elsa.
2024-03-24 20:28:19 +01:00
Sipke Schoorstra a720688bfd Add LoadBalancer bundle to Elsa.Server
This commit introduces a new bundle for load balancing into the Elsa.Server solution. It includes initial configuration files, launch settings, and reverse proxy setup. The load balancer is configured with a RoundRobin policy and the project references the Yarp.ReverseProxy package.
2024-03-24 20:27:38 +01:00
Sipke Schoorstra baeeedc650
Add logging to ScheduledCronTask constructor and setup (#5122)
The ScheduledCronTask now receives an ILogger instance and handles exceptions during timer setup by logging the error. Additionally, a constructor overload with the logger parameter has been added, and a new TrySetupTimer method encapsulates the timer setup with error handling.
2024-03-21 19:46:52 +01:00
Sipke Schoorstra d11754324e
Add DryRun endpoint and workflow instance finder (#5110)
* Add DryRun endpoint and workflow instance finder

Added a new DryRun endpoint for executing alteration plans and implemented the IWorkflowInstanceFinder interface to search for workflow instances. Refactored existing code to use new workflow instance finder service, resulting in cleaner activity implementation.

* Fix empty check in WorkflowInstanceFinder

Change the conditional logic to use `IsEmpty` method on filters rather than checking if the collection `workflowInstanceIds` is empty. This ensures that matching workflow instances are correctly identified when no specific filters are set.

* Refactor WorkflowInstanceFinder with WorkflowStatus default

The WorkflowInstanceFinder service has been refactored to include a default workflow status of Running and to utilize a new method WorkflowFilterIsEmpty, which checks if the workflow instance filter is empty. This improves code readability and encapsulates the logic for determining an empty filter.
2024-03-21 08:22:11 +01:00
Sipke Schoorstra e67a6fe752
Add log message sanitization for PostgreSQL (#5104)
* Fix callback clearing in workflow execution

The method ClearCompletionCallbacks in the ActivityExecutionContext was modifying the collection during enumeration, which can lead to issues. Converting to a List before removal ensures safe modification without side effects.

* Add log message sanitization for PostgreSQL

The new LogStringExtensions class provides methods to sanitize log messages, ensuring that null characters are replaced with "\0". These changes prevent issues with PostgreSQL's inability to store null characters in strings, improving log data compatibility with the database.

* Rename and update log extension class

Refactor LogStringExtensions to LogExtensions and update summary comment for clarity. This change emphasizes the broader application of the extension methods beyond string manipulation, focusing on sanitizing log messages.
2024-03-20 19:29:12 +01:00
Sipke Schoorstra 8079dd0de1
Add alteration notifications and management (#5097)
* Add alteration notifications and management

Implement notification publishing for completed alteration plans and add related handlers and management logic to coordinate alterations workflow triggering and completion status updates.

* Refactor queue address configuration in MassTransit

The initialization of the queue address and mapping for the `RunAlterationJob` has been moved out of the `Apply` method to the module configuration.

* Refactor CompleteAlterationPlan activity description

The activity summary comment in CompleteAlterationPlan.cs was updated to accurately describe its functionality. The description has been changed from "Submits an alteration plan for execution" to "Marks an alteration plan as completed."
2024-03-20 10:58:59 +01:00
MariusVuscanNx 05fd1440c1
Test workflows housekeeping (#5092)
* Updated WorkflowStorageDriver namespace reference

* Updated UI hint name
2024-03-19 13:51:18 +01:00
Sipke Schoorstra 67cd1f3709
Fix ID assignment logic in Scheduler (#5094)
Refactor the ID generation for Alteration Plans to ensure the `planParams.Id` is always set directly before creating a DispatchWorkflowDefinitionRequest. This avoids the unnecessary extra variable and ensures the ID property is consistently used throughout the method.

Fixes 5093
2024-03-19 13:46:47 +01:00
Sipke Schoorstra 3140b72e15 Add Postgres support to Elsa.Server.Web
Introduced support for PostgreSQL in the Elsa Server configuration and updated the docker-compose to reflect the new database option. Adjusted the dependencies to include the EntityFrameworkCore PostgreSQL project reference.
2024-03-19 11:38:51 +01:00
nuvotex-tk 47d4d20606
Add configuration value accessor in JintJavaScriptEvaluator (#5024)
close #4825
2024-03-18 23:20:12 +01:00
Pietervo e7766ce189
Update VersionOptions.cs (#5053)
When setting the VersionOptions with the TryParse function to LatestAndPublished, it sets IsLatestOrPublished to true instead of IsLatestAndPublished.
2024-03-18 23:18:15 +01:00