Commit graph

5683 commits

Author SHA1 Message Date
Sipke Schoorstra fbd16f2d74 Refactor workflow execution handling to improve performance 2025-01-24 13:54:37 +01:00
Sipke Schoorstra f67d96976d
Merge pull request #6320 from elsa-workflows/perf/js-variables
Add option to disable variable copying in Jint engine
2025-01-22 10:24:58 +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
Sipke Schoorstra 3262e7493f Enable variable copying in Elsa.Server.Web configuration
Updated the `disableVariableCopying` flag to `false` in `Program.cs`. This change allows variables to be copied, potentially addressing scenarios where variable duplication is needed. Ensure to test for any side effects this might introduce.
2025-01-21 19:29:56 +01:00
Sipke Schoorstra a7360ed922 Add option to disable variable copying in Jint engine
Introduce a `DisableVariableCopying` option to improve performance by preventing workflow variables from being copied into the Jint engine or back into the workflow context. Updated related logic to honor this setting and ensure compatibility with existing behavior.
2025-01-21 19:11:31 +01:00
Sipke Schoorstra 7edbdb9bc2
Merge pull request #6318 from elsa-workflows/perf/runtime
Optimize performance
2025-01-20 18:46:24 +01:00
Sipke Schoorstra d31661926d Simplify activity context handling in workflows.
Replaced `GetActiveChildren` with a direct `Children` property in `Flowchart.cs` to streamline logic. Removed redundant `GetDescendents`, `GetActiveChildren`, and `GetChildren` methods from `ActivityExecutionContextExtensions.cs`. Also updated GitHub workflows to allow performance-related branches.
2025-01-20 18:29:13 +01:00
Sipke Schoorstra a49bf0c05f Refactor descendant context check in Flowchart activity.
Replaced usage of `GetDescendents` with `Children` property for better clarity and efficiency when checking running activity instances. This simplifies the logic and aligns with the existing structure of activity context handling.
2025-01-20 18:07:14 +01:00
Sipke Schoorstra 7e058ddf15 Refactor workflow context and execution handling.
Optimized activity execution context management by introducing parent-child relationships and improving immutability. Adjusted several APIs to enhance clarity, performance, and maintainability, including the use of `AsReadOnly` collections and removal of redundant code.
2025-01-20 17:44:31 +01:00
Sipke Schoorstra 9ca11f68aa
Merge pull request #6317 from elsa-workflows/perf/refactor-ancestor-fault-status-handling
Refactor exception handling and activity status logic
2025-01-20 13:58:42 +01:00
Sipke Schoorstra a980022351 Refactor exception handling and activity status logic
Refactored `ExceptionHandlingMiddleware` to improve readability and modularity by splitting responsibilities into smaller methods. Replaced `GetAggregateStatus` with direct use of `source.Status` for significant performance improvement when a large number of activity instances are involved. Updated null-checks for clarity and fixed inconsistent usage of default values.
2025-01-20 13:58:11 +01:00
Sipke Schoorstra ad8eeecdce Refactor workflow management for improved modularization
Reorganized workflow handling to enhance clarity and maintainability, including introducing dedicated request handlers, refactoring middleware, and improving definition publishing. Deprecated `ValidateWorkflowResponse` and updated relevant namespaces for notifications handlers.
2025-01-20 00:24:01 +01:00
Sipke Schoorstra 7e06feffc2
Merge pull request #6309 from elsa-workflows/bug/migrations-runtime
Regenerate 3_3 Runtime module migrations
2025-01-17 12:16:01 +01:00
Sipke Schoorstra 35d21a69ed Remove creation of WorkflowInboxMessages table.
This commit deletes the code responsible for creating the WorkflowInboxMessages table. The change simplifies the migration script by removing unused or unnecessary table definitions and ensures consistency in database schema evolution.
2025-01-17 08:57:22 +01:00
Sipke Schoorstra 93aa3a7835 Remove WorkflowInboxMessages table and associated logic.
This change eliminates the previously defined WorkflowInboxMessages table and its creation logic for all databases. Cleanup simplifies the database schema and maintains focus on essential entities.
2025-01-17 08:56:21 +01:00
Sipke Schoorstra 95a5986b52
Create dependabot.yml 2025-01-16 20:45:00 +01:00
Sipke Schoorstra 9043af1726 Regenerate 3_3 Runtime module migrations 2025-01-16 20:41:12 +01:00
Sipke Schoorstra 190e63788c
Merge pull request #6303 from elsa-workflows/bug/6269
Reorder tenant services initialization for proper execution.
2025-01-15 18:52:12 +01:00
Sipke Schoorstra 0b5f580b0d Reorder tenant services initialization for proper execution.
Ensure `RunStartupTasks` is added before background and recurring tasks as order is critical for correct startup and tenant activation behavior. This prevents potential misalignment in task execution during tenant lifecycle events.

Fixes #6269
2025-01-15 18:40:38 +01:00
Sipke Schoorstra 3966824d29
Merge pull request #6302 from elsa-workflows/bug/6294
Refine message handling in MessageReceived activity
2025-01-15 15:04:10 +01:00
Sipke Schoorstra 1ee8fbdb5a Refactor default parameter values to null for readability
Replaced `default` with `null` for optional parameters to improve code clarity and maintain consistency. This change ensures better readability and aligns with common coding practices, especially when null is the intended default value.
2025-01-15 14:27:53 +01:00
Sipke Schoorstra 96dd00838a Refine message handling in MessageReceived activity.
Ensure type validation for incoming messages and clean up workflow input to prevent unintended data propagation. Added a dedicated ResumeAsync method to handle bookmark resumption logic consistently.

Fixes #6294
2025-01-15 14:27:37 +01:00
Sipke Schoorstra eba7eb289d
Update README.md 2025-01-15 11:25:43 +01:00
Sipke Schoorstra 7b45811ef4
Merge pull request #6301 from elsa-workflows/bug/6299
Fix array type handling
2025-01-15 11:19:12 +01:00
Sipke Schoorstra 18765cc386 Refactor route normalization logic
Simplified route normalization logic by removing unnecessary lowercase conversion and adjusted usages accordingly. These changes improve code readability, maintain consistency and fixes that route values are stored lower-cased instead of original-cased.
2025-01-15 11:17:21 +01:00
Sipke Schoorstra 2c3843d5f5 Refactor variable mapping and improve type alias handling
Updated `VariableMapper` for null assignment consistency and streamlined `VariableModel` instantiation. Improved `TypeJsonConverter` to handle list type aliases more explicitly, replacing ambiguous syntax with clearer format.
2025-01-15 10:50:34 +01:00
Sipke Schoorstra aaab19509e Fix array type handling in ArgumentJsonConverter
Previously, the code incorrectly used `MakeCollectionType` for arrays. This has been corrected to use `MakeArrayType`, ensuring proper deserialization of array arguments.
2025-01-15 10:50:17 +01:00
Sipke Schoorstra 7a08dd70cb Refactor scheduling service registrations.
Removed unused and duplicate service registrations to simplify DI setup. Ensures cleaner and more maintainable code while preventing potential initialization conflicts.
2025-01-15 00:01:26 +01:00
Sipke Schoorstra 0adc3acd59 Remove unused code from CleanupJob
Deleted an unnecessary `using` directive and a debug `Console.WriteLine` call. These changes clean up the code, improve readability, and avoid potential clutter.
2025-01-14 23:38:38 +01:00
Sipke Schoorstra e74d8d7d65
Merge pull request #6296 from elsa-workflows/fix/object-converter
Refactor and enhance JavaScript and object conversions.
2025-01-14 23:27:12 +01:00
Sipke Schoorstra cc694bf15b Use var for local variables in test cases
Updated all instances of explicitly typed `string` and `JsonElement` to `var` in `JsonElementConverterTests.cs` to improve code readability and maintain consistency with modern C# coding practices. This change does not affect functionality but aligns with better style conventions.
2025-01-14 23:19:51 +01:00
Sipke Schoorstra 9842a0dd7b Remove unused SetVariableWorkflow class
The SetVariableWorkflow.cs file was deleted as it was no longer needed. This simplifies the codebase by removing unused workflows and reduces maintenance overhead.
2025-01-14 23:17:32 +01:00
Sipke Schoorstra efd114944c Refactor and enhance JavaScript and object conversions.
Replaced InputProxy with alternative implementations, adding flexibility to handle inputs. Introduced a JsonElementConverter to deepen JavaScript and JSON element integration. Enhanced testing and object conversion logic, improving type handling and support for complex JSON scenarios.
2025-01-14 23:16:29 +01:00
Sipke Schoorstra 03dc67d1ed
Merge pull request #6293 from elsa-workflows/feature/main-delete
Added DeleteVariablesAsync method for the workflow context - main
2025-01-14 13:53:27 +01:00
Marius Vasile Vușcan 190d6c3bda
Improvements 2025-01-14 14:43:58 +02:00
Marius Vasile Vușcan e365d44637
Added DeleteVariablesAsync method for the workflow context 2025-01-14 14:41:49 +02:00
Sipke Schoorstra b2331f73db Handle collection and array serialization in TypeJsonConverter
Refactored TypeJsonConverter to distinguish and properly handle serialization of arrays and generic collections. Updated integration tests to include cases for round-tripping primitive arrays and collections for improved coverage.
2025-01-11 20:23:05 +01:00
Sipke Schoorstra 60db7cb964 Disable multitenancy and streamline NuGet publishing workflow.
Multitenancy is now disabled by default in `Program.cs` to simplify configuration. Additionally, removed the `publish_preview_nuget` step and refined conditions for `publish_nuget` to improve the workflow and align with the release process.
2025-01-11 19:55:06 +01:00
Sipke Schoorstra c8d7882c33
Merge pull request #6284 from elsa-workflows/bug/hangfire
Enable customizable Hangfire job storage and deprecate obsolete APIs.
2025-01-11 19:13:11 +01:00
Sipke Schoorstra 48c453d153 Enable customizable Hangfire job storage and deprecate obsolete APIs.
Added support for configuring Hangfire job storage per database provider, including PostgreSql, SQLite, and SQL Server. Introduced new methods for flexible Hangfire setup, while marking older APIs and storage configuration extensions as obsolete. Refactored related configurations for streamlined and centralized job scheduling logic.
2025-01-11 19:12:38 +01:00
Sipke Schoorstra 279d55c22c
Merge pull request #6276 from LarsNijholt/fix/no-ref/improve-workflow-instance-definition-filtering
Implemented name filter to workflow instance filter and added case insensitivity to searching definitions and instances by name
2025-01-10 18:39:58 +01:00
Sipke Schoorstra e395361bfd
Merge pull request #6283 from elsa-workflows/fix/array-wf-type
Refactor array type handling in variable and JSON converters
2025-01-10 14:38:54 +01:00
Sipke Schoorstra d759624321 Refactor array type handling in variable and JSON converters
Updated the logic to use `MakeArrayType` for array handling instead of generic collection types, ensuring consistency and better alignment with expected type structures. Adjustments were made in both the `VariableDefinitionMapper` and the `TypeJsonConverter`.
2025-01-10 11:40:54 +01:00
Sipke Schoorstra 8e27cf59a8
Merge pull request #6282 from elsa-workflows/perf/local-runtime-perf-degradation
Update workflow creation to use async commit method
2025-01-10 10:36:40 +01:00
Sipke Schoorstra 41d5160c41 Update workflow creation to use async commit method
Replaced synchronous `CreateWorkflowInstance` with `CreateAndCommitWorkflowInstanceAsync` to ensure instance creation is properly committed. Included support for cancellation tokens to improve process control and reliability.
2025-01-10 10:29:03 +01:00
Sipke Schoorstra ca4953d6ae
Merge pull request #6281 from elsa-workflows/perf/local-runtime-perf-degradation
Simplify and optimize workflow instance creation.
2025-01-10 10:11:19 +01:00
Sipke Schoorstra 03344bdc20 Adjust caching options and disable secrets usage
Enabled CachingOptions configuration and set a 1-day cache duration while disabling the use of secrets. These changes improve caching behavior and streamline application setup by avoiding secret dependencies.
2025-01-10 10:09:35 +01:00