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.
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>
Eliminated the IWorkflowDefinitionCacheManager dependency from the ReloadWorkflowTests constructor and fields. This cleanup helps streamline the code and maintainability by removing an unnecessary service.
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.
* 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Moved `SetupForSqlite` entity model handler to `CommonPersistenceFeature` to centralize SQLite configuration. Removed it from `Agents.Persistence.EntityFrameworkCore` to avoid redundancy.
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.
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.
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.
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.
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.
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.
SignalR functionality is temporarily disabled until Elsa Studio sends authenticated requests. Additionally, added the [Authorize] attribute to WorkflowInstanceHub to enforce authorization on workflow events.
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.
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.
* 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.
* 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.
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.
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.
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`.
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.
Commented out unused service scopes to streamline the DeleteWorkflow tests in Elsa.Workflows. This change includes disabling associated calls and registry checks for scopes 2 and 3, focusing solely on scope1 operations.
Ensure that signals are removed from the dictionary when the timeout is reached in the `WaitForSignalAsync` method. This prevents memory leaks and maintains the integrity of the signal management system. Also, remove trailing spaces for cleaner code in the `Trigger` method.
* Add support for secret accessor functions in JavaScript
Refactored the rendering and evaluation of JavaScript to include method definitions alongside existing properties. Enhanced secret handling by generating asynchronous accessor functions, improving the clarity and functionality of secret management in scripting.
* Refactor secret retrieval logic in JavaScript engine configuration
Refactored the code to use a dedicated method `ResolveSecretAsync` for secret retrieval, improving clarity and maintainability. Added a check to ensure that only active secrets are decrypted, enhancing robustness and error handling.
* Add SecretExpired notification and mediator to updater
Introduces a new SecretExpired notification class and integrates it within DefaultExpiredSecretsUpdater. The updater now sends a SecretExpired notification via the mediator upon expiring a secret.
Refactored `RemoveScheduledTask` and `RemoveScheduledTasks` in `LocalScheduler.cs` to improve consistency and correctness in task management. Disabled multitenancy in `Program.cs` by setting `useMultitenancy` to false.
Replaced the CleanupHostedService with CleanupRecurringTask for better scheduling and simpler configuration. Converted several classes to use constructor-based dependency injection and streamlined some type assignments. Removed unneeded files and updated existing code to follow more concise conventions. This enhances maintainability and readability.
* Remove initial migrations
Deleted obsolete initial migration files from multiple databases: MySQL, SQL Server, SQLite, and PostgreSQL. This cleanup helps maintain a streamlined and updated migration history.
* Add Document base class and create tenant-specific indices
Introduced a new abstract `Document` base class to unify common properties. Implemented tenant-specific unique indices across multiple collections by including `TenantId` alongside `Id` to ensure uniqueness within tenant scopes.
* Remove outdated migration files
Deleted various migration files under MySql, PostgreSql, Sqlite, and SqlServer directories. This cleanup removes unnecessary schema definitions and helps to streamline the codebase.
* Refactor workflow identity assignment logic
Streamline workflow identity handling to ensure consistent assignment of Id, DefinitionId, and TenantId values. This change integrates tenant prefix and version suffix cleanly, enhancing clarity and maintainability.
* Enable multitenancy support
Added configuration for a new tenant (tenant-1) in appsettings.json and enabled multitenancy feature in Program.cs. This change allows the application to support multiple tenants, with specific configurations for each.
* Refactor route table update to run as startup task
Replaced `UpdateRouteTableHostedService` with `UpdateRouteTableStartupTask` to ensure route table updates are executed during application startup instead of as a hosted service. Updated configuration in `HttpFeature` and adjusted trigger validation logic in `ValidateWorkflowRequestHandler`.
* Add recurring task scheduling and single-node task support.
Introduce `IntervalExpressionType`, recurring task scheduling classes, and `SingleNodeTaskAttribute`. Update `RecurringTasksRunner` to handle schedules and add single-node task logic to `StartupTasksRunner`. Ensure proper namespace changes and configure sample recurring tasks.
* Refactor recurring tasks scheduling system
Replaced existing scheduling classes with a more modular and granular approach. Introduced new classes and interfaces like `ISchedule`, `CronSchedule`, `IntervalSchedule`, and `RecurringTaskScheduleManager`. Updated related methods and code to comply with the new design.
* Refactor background task management
Removed `ExpiredSecretsHostedService` and refactored it into a recurring task. Introduced `TaskExecutor` for shared task execution logic. Updated and renamed feature classes to better represent their purpose, improving task scheduling and execution management.
* Add BackgroundTask abstract class to Elsa.Common module
This new abstract class implements the IBackgroundTask interface with default methods for executing, starting, and stopping tasks asynchronously. It provides a basic framework for background task management in the Elsa.Common module.
* Switch to CreateAsyncScope in DefaultTenantScopeFactory
Updated the CreateScope method to use CreateAsyncScope instead of CreateScope. This change improves asynchronous handling of service scopes within the DefaultTenantScopeFactory class.
* Add tenant handling and move StartWorkers background task
Introduce ITenantAccessor in Worker class for multitenancy support. Rename and relocate StartWorkers service to BackgroundTask, ensuring smoother workflow initialization. Also, update the configuration to support Azure Service Bus connection string.
* Add tenant support and refactor ProtoActor client
Integrated ITenantAccessor in ProtoActorWorkflowClient class to handle multi-tenancy. Refactored methods in the client to support custom headers and added async disposable pattern in various services for proper resource management. Additionally, enabled Azure Service Bus and updated related documentation.
* Add support for custom headers in ProtoActor grain methods
Introduced a T4 template to generate grain methods with custom headers, enabling the use of tenant ID in requests. Updated `ProtoActorWorkflowClient` to employ these methods, removing redundant code and directly utilizing the client for various workflow operations.
* Add tenant middleware to MassTransit configurations
Introduced multitenancy middleware for MassTransit message handling. Added new message type `OrderReceived` and updated RabbitMQ setup in Elsa Server. Applied middleware to configure tenant data on send, publish, and consume operations.
* Add new product workflow and streamline ID handling
Introduced a new `RequestResponseWorkflow` for handling product requests. Simplified ID handling in `WorkflowBuilder` and `ClrWorkflowsProvider` by defaulting to empty strings and adding a version prefix. Enhanced `HttpWorkflowsMiddleware` to correctly parse full request paths.
* Remove redundant files and update configuration
Deleted unused files `Product.cs` and `RequestResponseWorkflow.cs` to clean up the codebase. Updated `Program.cs` configuration: switched MassTransitBroker to Memory and disabled multitenancy.
* Remove MultitenantRecurringTaskService and update AzureServiceBus
Removed `MultitenantRecurringTaskService` and adjusted related code for Azure Service Bus to work without it. This includes removal of tenant accessor dependency from `Worker` and cleanup of service configuration flags in `Program.cs`.
* Increase signal wait timeout to 10000 milliseconds.
Extended the default timeout for signal awaiting methods from 8000 to 10000 milliseconds. This change ensures more flexible and resilient waiting periods, reducing timeout occurrences in scenarios with longer processing times.
* Refactor scheduling service to be a background task
Renamed `CreateSchedulesHostedService` to `CreateSchedulesBackgroundTask` and refactored it to inherit from `BackgroundTask` instead of `BackgroundService`. Simplified the constructor by injecting the required dependencies directly, eliminating the need for a scoped factory.
* Refactor workflow version suffix formatting
Changed the version suffix format from `:v{version}` to `v{version}` and adjusted the ID concatenation accordingly. This improves consistency and readability of workflow IDs.
* Enable multitenancy support in Quartz scheduler
Added `TenantJobListener` to inject tenant context into jobs. Modified `QuartzWorkflowScheduler` to incorporate tenant IDs into job data maps and adjusted the configuration to acknowledge multitenancy settings.
* Remove ConfigureSchedulerHostedService and TenantJobListener
Consolidated tenant resolution logic into JobExecutionExtensions class. Updated ResumeWorkflowJob and RunWorkflowJob to use the new extension method for tenant retrieval. This simplifies the QuartzSchedulerFeature setup by removing the hosted service configuration.
* Refactor HTTP feature and update route table task
Move 'UpdateRouteTableStartupTask' from 'HostedServices' to 'Tasks' and update dependency injection configurations accordingly. Simplify 'DefaultRouteTableUpdater' by removing unnecessary options and tenant-agnostic settings from filters.
* Disable multitenancy in Program.cs
The useMultitenancy flag has been changed from true to false. This update affects the Elsa.Server.Web application configuration.
* Simplify variable usage in HttpWorkflowsMiddleware
Replaced 'fullPath' variable with 'path' to streamline code. This change enhances readability by reducing redundancy and ensures consistency in variable naming throughout the method.
* Enable multitenancy and refactor tenant handling logic
Enable multitenancy in the application and refactor tenant handling logic to use ITenantFinder and ITenantContextInitializer interfaces. Added header constants, updated middleware to use these interfaces, and moved extension methods to the appropriate namespace.
* Add input validation to user registration form
Implemented checks to ensure all required fields are filled and that input data adheres to format requirements. This change reduces errors and enhances form reliability.
* Remove unused import from TenantPrefixHttpEndpointRoutesProvider
This change cleans up the code by removing an unnecessary import statement. It improves code readability and reduces clutter, making future maintenance easier. The functionality remains unchanged.
* Rename filter scope to "tenantPublish" in Probe method
Updated the Probe method in TenantPublishMiddleware.cs to use "tenantPublish" instead of "tenantSend" for better clarity. Ensures consistency with the method's context and aligns with naming conventions.
* Refactor: Remove extraneous whitespace
Eliminate unnecessary whitespace in ProtoActorWorkflowClient.cs for cleaner code. This change helps maintain consistent formatting and improves readability.
* Refactor DefaultRegistriesPopulator for cleaner initialization
Converted constructor to use read-only fields directly, removing unnecessary instance variables. This change simplifies the code by reducing redundancy and making the constructor cleaner.