* Restore EF Core persistence layer
Originally, we had moved EF Core to the extensions repo, but in practice this turned out to be rather impractical when debugging elsa-core, given that we would lose all of the state (workflow definitions, instances, etc.) across application restarts.
* Integrate PostgreSQL support into EF Core persistence and enhance BlobStorage workflows provider setup.
This commit completely removes the Elsa.Expressions.Dsl module, including all associated features, services, models, and dependencies. The DSL functionality, including its custom activities and integration options, has been fully eliminated from the project.
Eliminated the `Elsa.Labels`, `Elsa.Environments`, and `Elsa.OpenTelemetry` modules along with their handlers, contracts, models, and related functionality. This cleanup improves maintainability and aligns the codebase with recent architectural changes.
Replaced direct implementation of `IPropertyUIHandler` with a new `PropertyUIHandlerBase` abstract class to simplify UI handler management and introduce a priority mechanism. Removed outdated `SampleWorkflow` and `SlowActivity` code to clean up the repository. Introduced a custom checklist options provider and registered it within the application services.
This commit cleans up Program.cs by removing several unused using directives. The removal helps improve code readability and eliminates unnecessary references, ensuring a leaner and more maintainable codebase.
Deleted unused custom activity classes, message types, and related registrations from the codebase. Also cleaned up surplus library references and configurations from Program.cs to streamline and simplify the project.
* Add resilience module with core interfaces and services
Introduced a new `Elsa.Resilience` module and its core components to support resilient services and activities. This includes resilience strategies, providers, and attributes, along with integration into the existing HTTP module for enhanced fault tolerance. Added solution and project references for proper dependency management.
* Add resilience strategy framework with HTTP strategy support
Introduced a resilience strategy architecture, including a configurable `HttpResilienceStrategy` with retry capabilities, strategy serialization, and integration with existing modules. Enhanced ResilienceFeature to support registration of strategy types and updated application configuration to enable resilience strategies. This change ensures more robust and fault-tolerant HTTP request handling.
* Add JSON serialization support for resilience configuration
Introduced `ConfigurationExtensions` to enable JSON serialization of configuration sections. Updated resilience strategies to utilize the new extension methods and adjusted JSON serialization logic to support polymorphism with `$type` discriminator. Minor modifications were made to support deserialization and property mutability.
* Add resilience strategy support to workflows and API clients
Introduced resilience strategy configuration, serialization, and execution support across workflows and API clients. Added new APIs, models, and services to enhance fault tolerance capabilities for activities and HTTP interactions.
* Refactor resilience services for improved modularity.
Replaced `IResilienceService` with new modular interfaces (`IResilienceStrategyCatalog`, `IResilienceStrategyConfigEvaluator`, `IResilientActivityInvoker`) and corresponding implementations. Enhanced maintainability by simplifying components and responsibilities, ensuring better separation of concerns.
* Rename methods in ResilienceStrategyCatalog for clarity
Updated method names in `ResilienceStrategyCatalog` and its interfaces for better readability and alignment with naming conventions. Replaced `GetAllStrategiesAsync` with `ListAsync` and `GetStrategyAsync` with `GetAsync` across the codebase.
* Refactor resilience handling in HTTP activities.
Replaced `ResilienceCategory` property with `ResilienceCategoryAttribute` for a cleaner implementation. Updated `IResilientActivity` to simplify its interface and adjusted related modifications accordingly. Introduced `IResilientActivityInvoker` to enhance resilience strategy execution.
* Add support for additional resilience and scripting features
Extended resilience strategy handling with serialization support, added `HttpResilienceStrategy` type in JavaScript handler, and refined object conversion logic for interfaces. Minor adjustments to `Expression` class properties for consistency.
* Remove `UseResilience` call from Program.cs
This call was redundant and no longer necessary for the application. Its removal simplifies the code and ensures only required middleware is used.
* Remove commented-out JSON converter code in serializer setup
Cleaned up unused and commented-out converter initialization code in `ResilienceStrategySerializer`. This improves readability and removes unnecessary clutter from the file.
* Fix typo in method names from 'Resiliency' to 'Resilience'
Renamed methods to maintain consistency in naming conventions across the codebase. This change ensures clarity and alignment with established terminology.
* Refactor namespace for ConfigurationResilienceStrategySource
Updated the namespace of ConfigurationResilienceStrategySource to "StrategySources" for better alignment with naming conventions and structure. Removed an unused namespace reference in ResilienceFeature for cleanup.
* Mark EnableResiliency as obsolete in SendHttpRequestBase.
The EnableResiliency property is now marked with the [Obsolete] attribute. Developers are encouraged to use the common Resilience Strategy setting instead for managing HTTP request resiliency. This change ensures better consistency and alignment with the broader resilience strategy.
* Restrict ResilienceCategoryAttribute to class targets only
Removed support for using ResilienceCategoryAttribute on properties. This change enforces a stricter and more focused usage of the attribute, ensuring it applies only to class-level declarations.
* Add documentation for IResilientActivityInvoker interface
Include summaries and parameter descriptions for the `InvokeAsync` method. This improves code clarity and helps developers understand the functionality and usage of the resilient activity invocation process.
* Fix logical operator precedence in type comparison check
Parentheses were added to ensure correct evaluation of conditions when checking type compatibility. This prevents potential logical errors when determining the target type in object conversions.
* Add support for resilience source identification
Introduce the `ResilienceSourceNameAttribute` to allow naming of resilience sources. Updated `ResilienceStrategyCatalog` to utilize the attribute for prefixing strategy IDs, improving source identification and traceability. Applied the attribute to `ConfigurationResilienceStrategySource` as an example.
* Revert "Add support for resilience source identification"
This reverts commit 19b4e7121d6330b5de4f692b78da4c1e4a2d1f67.
* Reapply "Add support for resilience source identification"
This reverts commit 8bcba9d040c4eb247077aec6d90dc02817adcbd5.
* Revert "Reapply "Add support for resilience source identification""
This reverts commit ee04d35e7930956c752dda3ed150ca34a535e66c.
* Refactor OpenTelemetry error handling implementation
Introduce WorkflowErrorSpanHandler interface and context for improved error span handling in workflows. Separate activity and workflow error handling using dedicated abstractions and context models. Update error handling logic in tracing middleware and adjust DI configuration accordingly.
* Rename handler class and improve error tagging logic
Renamed `FaultExceptionActivityErrorSpanHandler` to `FaultExceptionErrorSpanHandler` for consistency and clarity. Updated error attribute tagging to align with Datadog's well-known attributes. Adjusted incident selection logic to use the first incident instead of the last.
* Align .gitignore file with consistent formatting
Standardized comments in the .gitignore file by adding missing spaces and capitalizing as needed. Updated the `/docker/data/` entry to `/docker/azurite-data/` for clarity.
* Fix incorrect selection of activity execution context
Replaced `LastOrDefault` with `FirstOrDefault` to ensure the correct activity execution context is retrieved when handling errors. This change resolves potential inaccuracies in identifying the faulted activity node.
* Exclude docker-compose-datadog.yml from solution file.
* Fix MessageReceived not setting Result
Fixes#6540
* Add custom equality comparer for VariableDescriptor
Introduced a `VariableDescriptorComparer` to ensure proper equality checks within `HashSet<VariableDescriptor>`. Updated related code to use the comparer and added a new message type `OrderReceived` for MassTransit integration.
* Refactor TenantId string handling and nullability checks.
Moved `StringExtensions` to a common module for reuse. Updated tenant-related logic to utilize null-safe string extensions, enhancing consistency and simplifying nullability handling across the codebase.
* Set StrictMode to false by default in ObjectConverter
Modified the default value of StrictMode to `false` to enable the original flexible behavior. Developers can opt into strict mode by explicitly setting it to `true`. This change aims to enhance backward compatibility and minimize unexpected strict conversions.
* Add tenant ID retrieval to ElsaDbContextBase constructor
Retrieve the current tenant ID if available using ITenantAccessor and assign it to the TenantId property. This ensures proper handling of multi-tenancy scenarios in the database context initialization.
* Disable DbContext pooling, manual OTEL instrumentation, and strict mode.
DbContext pooling is turned off to prevent potential issues with shared context instances. Manual OpenTelemetry instrumentation is disabled to rely on automatic instrumentation instead. Strict mode is also disabled to allow more flexibility in object conversion.
* Fix infinitely waiting Alterations Workflow
Replaced workflow dispatch logic with BookmarkQueue and StimulusHasher for triggering workflows. This fixes the issue where the Alterations workflow would signal completion while a later step awaits a completion bookmark. The Bookmark Queue now handles this.
* Add strict type checking for variable parsing
Introduced a `StrictMode` flag for variables, enforcing stricter type validation during parsing and conversions. Updated related methods and tests to reflect the stricter parsing behavior, ensuring consistent type compatibility and error handling.
* Refactor StrictMode handling and improve ObjectConverter logic
Moved StrictMode flag from Variable to ObjectConverter for better cohesion and updated related references. Additionally, removed unused parameters and simplified ObjectConverterOptions to streamline configuration and maintain consistency across the codebase.
* Refactor type conversion logic and update logging defaults
Improve type conversion reliability by introducing `TryConvertValue` and refining exception handling. Update JSON scenarios to use "Inherit" as the default for log persistence modes, ensuring consistency across configurations.
* Refactor exception handling in ObjectConverter.
Introduce a helper method `ReturnOrThrow` to streamline and centralize exception handling logic. This change also adds support for non-strict mode, allowing value fallback instead of throwing exceptions when enabled.
* Add numeric type checks and improve type conversion handling
Introduce `IsNumericType` extension method to identify numeric types. Enhance type conversion logic in `ObjectConverter` to handle numeric, boolean, and string types more accurately. Update variable deserialization workflows to handle conversion failures gracefully.
* Set a default comment for ObjectConverter.StrictMode assignment
Added a comment clarifying that StrictMode is set to its default value. This improves code readability and helps maintainers understand the intent.
* Fix formatting inconsistencies and improve code clarity
Removed redundant whitespace and adjusted formatting to align with coding standards. These changes enhance the readability and maintainability of the code without altering functionality.
* Fix typo in Program.cs variable comment
Corrected a minor issue in the comment for `identityTokenSection` to remove the unnecessary "Modify" text. This change improves code readability and removes potential confusion for developers.
* Simplify imports in ModifyVariableHandler.cs
Removed unused `Microsoft.Extensions.Options` and `Elsa.Workflows.Options` imports to clean up dependencies and improve maintainability. This change reduces clutter without affecting the existing functionality.
* Enable DbContext pooling and refactor DI scopes
Added support for using DbContext pooling with a configurable option. Refactored to use scoped service providers for better isolation and lifecycle management. Updated persistence feature base to integrate sensitive data logging and warning configurations.
* Update package management and Elsa Studio version references
Centralized package versioning remains enabled, while unused package references and conditional groups for specific .NET targets are removed for simplification. Elsa Studio version is upgraded from 3.3.0-rc4 to 3.4.0-rc1.
* Simplify DbContextOptions setup logic
Removed conditional compilation and unused code to streamline the DbContextOptions configuration. This improves maintainability and ensures consistent behavior across frameworks. Sensitive data logging is no longer explicitly enabled here.
* Refactor bookmark naming to use "Name" instead of "ActivityTypeName".
Replaces usages of "ActivityTypeName" with "Name" across relevant classes, filters, and database mappings for clarity and consistency. Maintains backward compatibility where necessary and updates corresponding indices, filters, and methods for proper functionality.
* Add migration for V3_5 with schema updates for EF Core
This migration modifies the `Triggers` and `Bookmarks` tables by adding the `Name` column, updating its nullable state, and creating corresponding indexes. Changes apply to both SQLite and MySQL contexts, ensuring compatibility across databases.
* Refactor bookmark filtering and tenant events handling.
Unified the bookmark filtering logic with overloads that accept multiple names, improving flexibility and reusability. Simplified object initializations in tenant events to enhance code readability and reduce verbosity. Added task continuation logic to background task execution for better task sequencing and error handling.
* Refactor bookmark creation to use target-typed `new` expressions.
Replaces explicit `CreateBookmarkArgs` instantiations with concise target-typed `new` expressions for improved readability and reduced redundancy. This does not alter functionality but simplifies the code structure.
* Make callback parameters optional and adjust OTEL settings
Updated methods to allow optional callbacks for improved flexibility. Refactored Delay activity to reuse helper methods. Adjusted OTEL instrumentation settings to enable console exporter and disable manual instrumentation.
* Refactor stimulus handling and streamline event workflows.
Introduces `WaitForEvent` and `GetEventInput` extensions to improve ActivityExecutionContext usability. Replaces generic filter methods with targeted single-name filtering, simplifying scheduling logic. Updates stimulus names for consistency and deprecates obsolete methods to enhance clarity and maintainability.
* Refactor `Event` activity handling and event stimulus logic.
Replaces inline event stimulus creation with a new `GetEventStimulus` helper method for cleaner code. Simplifies event execution handling by removing redundant logic in `ExecuteAsync`. Extends `WaitForEvent` to handle workflow triggers more efficiently.
* Refactor and enhance Timer and Delay execution logic
Introduced `TimerBase` for shared timer functionality and refactored `Timer` to extend it. Improved method names for clarity, replacing `ResumeIn`/`ResumeAt` with `DelayFor`/`DelayUntil`. Enhanced flexibility in bookmark handling and activity execution context extensions.
* Add custom activities and refactor HTTP stimulus handling
Introduce new custom activities (CustomDelay, CustomEvent, CustomHttpEndpoint, CustomTimer) to enhance workflow functionality. Refactor HTTP stimulus handling by replacing activity type names with a new centralized HttpStimulusNames constant, improving consistency and maintainability. Additionally, streamline HTTP endpoint logic with new helper extensions and simplify related services to reduce redundancy.
* Add HttpEndpointBase abstraction to simplify HTTP endpoints
Introduce a new `HttpEndpointBase` class to centralize common logic for HTTP endpoint activities. Refactored `CustomHttpEndpoint` to inherit from this new base class, reducing redundancy and improving maintainability.
* Refactor events framework with base class for event activities
Introduce `EventBase` to streamline implementations of event-driven activities. Updated `CustomEvent` to inherit from `EventBase`, reducing duplicate logic and improving maintainability. Removed unnecessary dependencies in `CustomTimer`.
* Refactor bookmark creation to use target-typed `new` expressions.
Replaces explicit `CreateBookmarkArgs` instantiations with concise target-typed `new` expressions for improved readability and reduced redundancy. This does not alter functionality but simplifies the code structure.
Make callback parameters optional and adjust OTEL settings
Updated methods to allow optional callbacks for improved flexibility. Refactored Delay activity to reuse helper methods. Adjusted OTEL instrumentation settings to enable console exporter and disable manual instrumentation.
Refactor stimulus handling and streamline event workflows.
Introduces `WaitForEvent` and `GetEventInput` extensions to improve ActivityExecutionContext usability. Replaces generic filter methods with targeted single-name filtering, simplifying scheduling logic. Updates stimulus names for consistency and deprecates obsolete methods to enhance clarity and maintainability.
Refactor `Event` activity handling and event stimulus logic.
Replaces inline event stimulus creation with a new `GetEventStimulus` helper method for cleaner code. Simplifies event execution handling by removing redundant logic in `ExecuteAsync`. Extends `WaitForEvent` to handle workflow triggers more efficiently.
Refactor and enhance Timer and Delay execution logic
Introduced `TimerBase` for shared timer functionality and refactored `Timer` to extend it. Improved method names for clarity, replacing `ResumeIn`/`ResumeAt` with `DelayFor`/`DelayUntil`. Enhanced flexibility in bookmark handling and activity execution context extensions.
Add custom activities and refactor HTTP stimulus handling
Introduce new custom activities (CustomDelay, CustomEvent, CustomHttpEndpoint, CustomTimer) to enhance workflow functionality. Refactor HTTP stimulus handling by replacing activity type names with a new centralized HttpStimulusNames constant, improving consistency and maintainability. Additionally, streamline HTTP endpoint logic with new helper extensions and simplify related services to reduce redundancy.
Add HttpEndpointBase abstraction to simplify HTTP endpoints
Introduce a new `HttpEndpointBase` class to centralize common logic for HTTP endpoint activities. Refactored `CustomHttpEndpoint` to inherit from this new base class, reducing redundancy and improving maintainability.
Refactor events framework with base class for event activities
Introduce `EventBase` to streamline implementations of event-driven activities. Updated `CustomEvent` to inherit from `EventBase`, reducing duplicate logic and improving maintainability. Removed unnecessary dependencies in `CustomTimer`.
* Move HttpEndpointOptions model to its own file
The HttpEndpointOptions class was moved from an extension file to its own dedicated file for better organization and modularity. This model defines HTTP endpoint properties such as path, methods, authorization, policies, request timeout, and size limit. The change improves code clarity and structure.
* Fix unnecessary whitespace in Timer.cs
Removed an extra whitespace line in the Timer.cs file to maintain code formatting consistency. No functional changes were made to the code.
* Remove extraneous whitespace in IStimulusSender.cs file
Eliminate unnecessary blank line in the IStimulusSender interface for improved code cleanliness. This change enhances readability and aligns with coding standards.
Introduced new span tags for activities and workflows to enhance trace analysis. Optimized error handling in activity tracing by selecting the first applicable handler. Removed unused manual tracing configuration and commented out console exporters in server setup.
Added and updated multiple package references, including OpenTelemetry, Datadog.Trace.Bundle, and various Microsoft.Extensions libraries. This ensures compatibility with the latest dependencies and introduces enhanced features for resilience and tracing.
Removed unnecessary `With()` method in `UsePostgreSql` for YugabyteDB. This simplifies the configuration and ensures consistency across database providers.
Introduced Docker Compose configurations for Citus and YugabyteDB clusters and updated connection strings in `appsettings.json`. Modified `Program.cs` to enable Entity Framework Core support for both databases and updated the `SqlDatabaseProvider` enum accordingly. Adjusted the Docker Compose setup and bumped `Yarp.ReverseProxy` package version.
Added a feature flag (`useOtel`) to conditionally enable OpenTelemetry tracing. This allows developers to toggle tracing for debugging or testing without affecting the default behavior.
This commit removes the "Agents" configuration section, related API keys, services, and persistence logic across the codebase. Unused agent-related NuGet packages and code references were also eliminated to simplify the project and focus on core functionality.
Configured `IncidentOptions` to set `DefaultIncidentStrategy` to `ContinueWithIncidentsStrategy`. This ensures consistent handling of workflow incidents and improves customization flexibility for incident management.
Deleted the entire Azure Service Bus module, including activities, configurations, tests, and supporting code. This removal eliminates features like message handling workflows, queue/topic providers, and unit testing utilities for Azure Service Bus.
Integrated webhook sinks via appsettings.json for handling "Run Task" events. Enabled webhook functionality in the application pipeline and added the necessary project reference for Elsa.Webhooks. This enhances event-driven capabilities and improves extensibility.
Introduce `IsExecuting` flag to explicitly track activity execution state, improving clarity and control over workflow activity handling. Adjust scheduling intervals and add concurrency handling for database updates to enhance reliability and performance in interrupted workflows.
Renamed 'WorkflowLivenessThreshold' to 'InactivityThreshold' for clarity and updated its usage across affected files. Adjusted timings for workflow restarts and delays to improve consistency, including increasing task delay and updating scheduler intervals. These changes enhance readability and align with revised task execution timelines.
Introduced a mechanism to identify and restart interrupted workflows. This includes a new `IWorkflowRestarter` contract, its default implementation, and a recurring task for handling restarts. Additionally, updated configurations and added extensions to improve workflow instance filtering and liveness tracking.
Introduced OpenTelemetry tracing with AlwaysOnSampler and console exporter, integrated into the Elsa framework. Added error handling capabilities via custom `IErrorSpanHandler` implementations. Updated project dependencies to include OpenTelemetry-related packages.
Multitenancy has been turned off by setting `useMultitenancy` to `false`. This change might simplify the current configuration and reduce complexity for single-tenant use cases.
Replaced direct store interactions in workflow management with mediator-based requests using `IMediator`, improving consistency and modularity. Added new handlers and requests for workflow definition operations, and updated existing services to align with mediator patterns.
Introduced `MultitenancyHttpOptions` to configure the tenant header name used for HTTP routing. Updated `HeaderTenantResolver` to utilize this option and modified the server setup to allow overriding the default header name. This enables more flexible multitenancy configurations.
Revised database initialization scripts to better handle Postgres and Oracle environments, introduced schema-specific configurations for Oracle EFCore, and cleaned up obsolete or redundant entity model setup. Streamlined project structure by relocating and renaming files for SQLite and Oracle EFCore setups, improving maintainability and readability.
This commit introduces Oracle database integration by adding necessary configurations, entity mappings, and Docker Compose setup. Oracle-specific mappings ensure compatibility with NCLOB for large data handling. The changes also include updates to appsettings, enum for SqlDatabaseProvider, and project references to support Oracle.
Extracted commit strategies setup into a reusable AddStandardStrategies method for better code clarity and modularity. Simplified PeriodicWorkflowStrategy by replacing the factory method with a constructor-based interval initialization. These changes improve maintainability and reduce redundancy across the codebase.
Replaced 'RegisterStrategy' with 'Add' in strategy registration methods for both workflows and activities. This simplifies the naming, enhances consistency, and aligns with modern API design principles.
Replaces direct strategy registration with metadata-based registrations, introducing `ObjectRegistration`, `CommitStrategyMetadata`, and associated helpers. Updates existing strategies and APIs to use the new metadata-driven approach, improving extensibility and maintainability.