Commit graph

1864 commits

Author SHA1 Message Date
Sipke Schoorstra 01a41f6d62 Refactor commit strategies to use AddStandardStrategies method
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.
2025-01-30 18:10:38 +01:00
Sipke Schoorstra ef97ef415f Update strategy registration methods to use 'Add'
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.
2025-01-30 15:20:51 +01:00
Sipke Schoorstra 166c1bc117 Add endpoints for listing workflow commit strategies
Introduced two API endpoints to list activity and workflow commit strategy registrations. Updated the project file to include the new directory structure for the endpoints. These endpoints provide unified responses from the respective registry implementations.
2025-01-30 15:19:51 +01:00
Sipke Schoorstra e151810600 Refactor commit strategy architecture for flexibility.
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.
2025-01-30 15:14:58 +01:00
Sipke Schoorstra 4b308cc94a Refactor commit strategy naming and implementation
Renamed `CommitStateStrategy` to `CommitStrategy` for consistency and clarity. Updated method names, property names, and logic to reflect the new naming convention. Improved null handling when setting commit strategy properties.
2025-01-30 14:29:04 +01:00
Sipke Schoorstra ce859efc4a Refactor commit state handling with a strategy-based approach
Replaced the legacy commit state behavior enums and options with a flexible, strategy-based system for activities and workflows. Introduced new interfaces, models, and strategies to enable fine-grained control of commit state logic. Updated related code to integrate the new commit strategies, ensuring modular and extensible commit handling.
2025-01-30 11:59:47 +01:00
Sipke Schoorstra d93d67cada
Merge branch 'main' into feature/4835 2025-01-30 09:17:38 +01:00
Sipke Schoorstra d500817468 Simplify DbContext creation with ActivatorUtilities.
Replaced Activator.CreateInstance with ActivatorUtilities.CreateInstance to streamline the DbContext instantiation. This improves dependency injection support and ensures better compatibility with service provider configurations.
2025-01-29 19:03:59 +01:00
Sipke Schoorstra f4a31079b7 Refactor activity execution context removal logic.
Updated methods to ensure proper cleanup when removing activity execution contexts, including handling parent-child relationships. Improved robustness and clarity by introducing step-by-step removal for multiple contexts.
2025-01-29 16:18:59 +01:00
Sipke Schoorstra 7f86799393
Merge branch 'main' into feature/4835 2025-01-29 13:39:31 +01:00
Sipke Schoorstra 4d7b551d79 Add support for ExpandoObject attachments in email sending
This update enables handling ExpandoObject as email attachments by extracting relevant properties like FileName, ContentType, and Content. It ensures proper parsing of the content and supports both byte arrays and streams for attachment data.
2025-01-29 11:24:13 +01:00
Sipke Schoorstra 0560d11432 Improve JSON array conversion in ObjectConverter
Refactored ObjectConverter to handle JSON array conversions more robustly, including support for arrays of complex types. Added a `Person` class for unit testing and updated tests to validate the new functionality. Included necessary project reference updates to ensure proper functionality.
2025-01-29 10:50:42 +01:00
Sipke Schoorstra 0eec9693f7 Refactor and optimize workflow execution context handling.
Replaced inline filtering logic with reusable methods to simplify and unify activity execution context management. Introduced `ClearCompletedActivityExecutionContexts` to remove redundant contexts and migrated filtering logic to `WorkflowExecutionContext`. Improved code clarity and maintainability by removing duplicate methods and streamlining exception throwing.
2025-01-28 20:59:27 +01:00
Sipke Schoorstra 8bc6fa6a57 Refactor activity context management and state handling.
Replaced `ActivityExecutionRecordExtractor` with a `ChangeTrackingDictionary` for better state mutation tracking in activity execution contexts. Introduced tainting mechanisms to track dirty states and ensure precise logging and persistence of activity execution logs. Updated several components like `ActivityExecutionLogSink` and `ExpressionExecutionContext` to utilize these changes effectively.
2025-01-28 20:24:53 +01:00
Sipke Schoorstra 7dc6220175
Merge branch 'main' into feature/4835 2025-01-28 13:53:58 +01:00
Sipke Schoorstra 9437ab3a3d Refactor initialization of ObsoleteWorkflowRuntime.
Replaced direct instantiation of `ObsoleteWorkflowRuntime` with `Lazy<ObsoleteWorkflowRuntime>` across multiple runtime services to avoid circular dependency resolution.
2025-01-28 13:53:22 +01:00
Sipke Schoorstra dbd89905c8 Remove redundant PreviousSubStatus assignment in workflow context
The PreviousSubStatus assignment was removed as it was unused and unnecessary. This cleanup simplifies the code and ensures focus only on relevant functionality.
2025-01-28 11:40:14 +01:00
Sipke Schoorstra 633464eb04
Merge branch 'main' into feature/4835 2025-01-28 11:17:14 +01:00
Sipke Schoorstra 9a5181a3d7
WIP on feature/4835 2025-01-28 11:17:02 +01:00
Sipke Schoorstra 4a4657b4a4
Merge branch 'main' into feature/4835 2025-01-28 10:57:52 +01:00
Sipke Schoorstra e2a57aca35
Merge pull request #6344 from elsa-workflows/task/restore-previous-workflow-runtime-api
Restore old workflow runtime API
2025-01-28 10:37:46 +01:00
Sipke Schoorstra 9f01e148a9 Deprecate and clean up legacy workflow runtime components.
Marked various types as obsolete, advising migration to `CreateClientAsync` methods or `IBookmarkQueue` services. Removed unused `Deprecated` namespace imports, aligning code with updated runtime standards.
2025-01-28 09:26:46 +01:00
Sipke Schoorstra ee883dbd07 Refactor workflow runtime to use ObsoleteWorkflowRuntime delegation
Replaced direct method implementations in workflow runtimes with delegations to the new `ObsoleteWorkflowRuntime` class, simplifying the codebase. This consolidates logic and aligns the runtimes under a unified deprecated API layer.
2025-01-28 09:18:24 +01:00
Sipke Schoorstra e27101032b Incremental work on central obsolete workflow runtime for reuse 2025-01-28 00:32:43 +01:00
Sipke Schoorstra 60323d0522 Refactor CanStartWorkflowResult to use compact constructor.
Simplified the object creation in `CanStartWorkflowResult` by using a concise constructor format. This improves code readability and reduces verbosity without altering functionality.
2025-01-28 00:22:20 +01:00
Sipke Schoorstra db1556fd0b Update ProtoActorWorkflowRuntime to implement backwards-compatible workflow runtime API 2025-01-28 00:21:49 +01:00
Sipke Schoorstra 8e88de546d Incremental work on restoring previous workflow runtime API surface for backward compatibility 2025-01-28 00:11:25 +01:00
Sipke Schoorstra 85282f9149
Update WorkflowExecutionContext.cs
Remove unused property
2025-01-27 21:48:14 +01:00
Sipke Schoorstra 6b288e1990
Update SetCommitStateBehavior method for fluent convenience 2025-01-27 21:13:49 +01:00
Sipke Schoorstra 8cb43db070 Refactor workflow state persistence for improved consistency.
Removed obsolete middleware for persisting bookmarks, execution logs, and variables, integrating their functionality into the commit state handler. Added early exit checks for empty collections in persistence methods. Updated activity invoker logic for better state commit handling during execution.
2025-01-27 20:07:23 +01:00
Sipke Schoorstra 879e546942
Merge branch 'main' into feature/4835 2025-01-27 19:29:43 +01:00
Sipke Schoorstra ea8c3da169 Refactor object initialization and remove unused import.
Updated the object initialization syntax for cleaner code and removed an unused import in WorkflowValidator.cs to improve code readability and maintainability.
2025-01-27 18:55:28 +01:00
Sipke Schoorstra be94a51b8c Add validation for unique input/output names in workflows
Introduces a `ValidateWorkflow` notification handler to enforce validation of unique input and output names in workflows. Adds validation errors when duplicate names are detected, improving the integrity of workflow definitions. Integrates the handler into the workflow management feature.
2025-01-27 18:44:47 +01:00
Sipke Schoorstra 7a21f09ae9 Restore methods for traversing activity execution context hierarchy
Reintroduced `GetAncestors` method and added new methods: `GetDescendants`, `GetActiveChildren`, and `GetChildren`. These methods enhance navigation through activity execution contexts by providing easy access to hierarchical relationships like ancestors, descendants, and children.
2025-01-27 15:49:25 +01:00
Sipke Schoorstra c93b063106 Fix variable mapping and aliasing 2025-01-27 11:29:02 +01:00
Sipke Schoorstra 9365328f0b Add commit state behavior support in workflows
Introduced `ActivityCommitStateBehavior` and `WorkflowCommitStateOptions` to enable flexible state commit handling in workflows. Integrated commit logic into activity and workflow execution contexts and middleware. This improves control over when state is committed during workflow execution.
2025-01-25 23:26:37 +01:00
Sipke Schoorstra 658630078b Add SMTP server configuration and refactor email activity for improved error handling and attachment processing 2025-01-24 23:06:29 +01:00
Sipke Schoorstra cd2d0efef5 Refactor MongoDbStore to use EmptyToNull for TenantId assignments and add StringExtensions for null handling 2025-01-24 19:50:02 +01:00
Sipke Schoorstra 327a49d8c0 Refactor VariableDefinitionMapper to improve type handling for collections and arrays 2025-01-24 19:16:15 +01:00
Sipke Schoorstra 3920d420a9 Update log message for variable conversion failure
Improved the log message to include specific details about the failed conversion, such as the default value, variable name, and type. This enhances debugging by providing more context about the error.
2025-01-24 18:57:40 +01:00
Sipke Schoorstra 868370d222 Refactor VariableDefinitionMapper to include logging
Refactored the `VariableDefinitionMapper` to utilize dependency injection for `IWellKnownTypeRegistry` and added `ILogger` for improved error handling. Updated value conversion logic to log warnings when conversion fails, ensuring better traceability. Simplified return statements and replaced redundant collections with modern syntax.
2025-01-24 18:54:25 +01:00
Sipke Schoorstra fa4a7ce031 Refactor to use target-typed new expressions.
Simplified object instantiations by replacing explicit type declarations with target-typed `new` expressions. This improves code readability and reduces redundancy in object initialization.
2025-01-24 18:40:59 +01:00
Sipke Schoorstra 3e9181bb9e Add 'constants' to NamespaceFoldersToSkip settings
This update modifies the .DotSettings file to include 'constants' as a NamespaceFoldersToSkip entry. This ensures that folders named 'constants' are excluded from namespace inspections, improving clarity and compliance with project preferences.
2025-01-24 18:40:45 +01:00
Sipke Schoorstra 95e04eac17 Refactor to remove redundant debug logs and clean up code.
Eliminated unnecessary debug log statements from `ResumeDispatchWorkflowActivity` and removed redundant whitespace across the affected files. These changes streamline the code for better readability and maintainability
2025-01-24 14:01:19 +01:00
Sipke Schoorstra 74a5c3cd87 Refactor workflow dispatching for clarity and efficiency
Refactored the handling of child workflow execution, ensuring better readability and streamlining logic for dispatch operations. Added explicit tracking of dispatched instances and improved comments to support maintainability.
2025-01-24 13:58:50 +01:00
Sipke Schoorstra fbd16f2d74 Refactor workflow execution handling to improve performance 2025-01-24 13:54:37 +01:00
Sipke Schoorstra 0bb183f1aa Fix spacing inconsistencies in ActivityOutputRegister.cs
Resolved unnecessary whitespace issues and adjusted spacing around conditional statements to improve code readability and maintain consistency. These changes do not alter functionality but enhance the code's clarity and professional formatting.
2025-01-21 22:57:19 +01:00
Sipke Schoorstra 1ca8f2a423 Fix null reference issue in ActivityOutputRegister.
Updated the method to safely access the `Value` property when retrieving the first record, preventing potential null reference exceptions. This ensures more robust and error-free behavior when querying output records.
2025-01-21 22:53:08 +01:00
Sipke Schoorstra dd39ca8d84 Refactor variable handling and activity output registration.
Replaced default value assignments with null for clarity and simplicity. Refactored ActivityOutputRegister to optimize record storage and retrieval using grouped dictionary entries instead of flat lists. Adjusted related methods to improve performance and maintain consistency.
2025-01-21 20:10:54 +01:00
Sipke Schoorstra 33a2fb7afe Optimize ActivityOutputRegister.
Enhanced `ActivityOutputRegister` with dictionary-based lookups for improved performance and added unique key generation methods to efficiently retrieve outputs.
2025-01-21 19:52:30 +01:00