Commit graph

4797 commits

Author SHA1 Message Date
Sipke Schoorstra decb5d898c Optimize BuildContainsExpression method performance
Converted the result of the Select() operation to a list, within the BuildContainsExpression method. This prevents multiple enumerations of the 'entities' variable, improving the performance of the method by reducing the number of iterations.
2024-02-08 00:04:45 +01:00
BEN AMEUR e64a2eaa17 issues(4893): try register serializer or skip when already registred 8d23d6
issues(4893): try register serializer or skip when already registred  + clean
2024-02-07 13:45:40 +01:00
Sipke Schoorstra 8d23d695df Remove redundant input addition in workflows
The code change deletes the line where the messageInput is added to the Inputs list of the builder in the `Workflows.cs` file, since this operation is redundant. The input is automatically added during its creation and doesn't need an explicit addition, thus improving code efficiency.
2024-02-06 08:45:54 +01:00
Sipke Schoorstra fa44259cd1 Add serialization tests and refactor serialization classes
Implemented new integration tests for serialization of programmatic workflows. Additionally, major refactoring was performed on the serialization classes. This involved moving the classes to new namespaces and enhancing their functionalities to correctly handle null inputs and to support the serialization of activities and expressions. Also, updated Elsa.sln.DotSettings and JsonActivitySerializer to handle new serializers.
2024-02-06 08:45:54 +01:00
BEN AMEUR f71b8c3b1c issues(4885) 2024-02-05 23:39:37 +01:00
Sipke Schoorstra fb2f0f0271
Update InputJsonConverter to deserialize complex value types into their original type (#4878)
* Remove unused using directives in test classes

The using directives for System, System.Collections.Generic, System.IO, and others were not necessary in many of the test classes. These unused directives have been removed to enhance code readability and maintainability.

* Update source port retrieval in ConnectionJsonConverter

The source port retrieval code in ConnectionJsonConverter.cs has been updated. It now uses TryGetProperty instead of GetProperty, enabling it to handle cases where the "port" property may not exist. This enhances error handling and resilience in the activities module.

* Refactor InputJsonConverter for proper variable expressions handling

The InputJsonConverter in the Elsa.Workflows.Serialization has been expanded for efficient handling of variable expressions during the JSON conversion process. The refactor ensures appropriate extraction and assignment of values to variables. This adds robustness to the serialization process, maintaining variable types after serialization.

* Add tests for variable expressions serialization

A new `Tests.cs` file has been added under the `Elsa.IntegrationTests/Serialization/VariableExpressions` directory. This file contains tests for ensuring the serialization of variable expressions works correctly. A corresponding `SampleWorkflow` file has also been established, providing the workflows to be used in the tests.

* Refactor workflow builder extension class

The WorkflowDefinitionBuilderExtensions class has been deleted and replaced with WorkflowBuilderExtensions in Elsa.Workflows.Core. This new class retains similar functionality but includes more detailed comments and dynamic member access capabilities in its method definition.
2024-02-05 21:39:49 +01:00
Sipke Schoorstra d511b04cee Add fluent methods for input handling in workflow builder
Updated the WorkflowBuilder and its interface, IWorkflowBuilder, to include a series of fluent methods for handling inputs. These methods allow easier set up and addition of input definitions to workflows. An extension method to get input names was also added to the ExpressionExecutionContextExtensions.
2024-02-05 21:38:36 +01:00
Sipke Schoorstra ef1d736184
Merge pull request #4881 from elsa-workflows/cleanup(workflow-runtime-api)
Make workflow runtime methods accept nullable options
2024-02-05 07:48:55 +01:00
Sipke Schoorstra 3a4f690a3e Make workflow runtime methods accept nullable options
The methods in the workflow runtime now accept nullable runtime options. Providing workflow options is now optional - if no options are provided, default values are used. Changes have been applied across all relevant methods in IWorkflowRuntime, ProtoActorWorkflowRuntime and DefaultWorkflowRuntime classes, thus ensuring consistent behavior and null safety across the workflow runtime.
2024-02-04 22:15:02 +01:00
Sipke Schoorstra 06e93c13e2
Merge pull request #4844 from Nokecy/patch-2
update sqlserver Extensions support UseCompatibilityLevel cofnig
2024-02-04 15:36:11 +01:00
Sipke Schoorstra 45a2984baf
Merge pull request #4877 from lahma/cpm
Convert to use Central Package Management
2024-02-04 15:27:28 +01:00
Marko Lahma bc3d6d9bbc Convert to use Central Package Management
* Add GitHubActionsTestLogger
2024-02-04 13:49:54 +02:00
Sipke Schoorstra f1b85a1205
Merge pull request #4876 from elsa-workflows/issue(4875)
Add GZip compression for WorkflowInstance Data field on EF Core
2024-02-04 12:19:56 +01:00
Sipke Schoorstra 611c72fa26 Implement Zstd compression and update related components
Removed ICompressionStrategyResolver interface and file, and added ICompressionCodec and ICompressionCodecResolver interface. Updated relevant classes for the new interface. Specifically, added Zstd class under Compression as a new compression method. Also modified WorkflowInstanceStore.cs, None.cs, EFCoreWorkflowInstanceStore.cs, GZip.cs, and ActivityExecutionLogStore.cs for uniform compression terminology.
2024-02-04 12:18:55 +01:00
Sipke Schoorstra 9c7f65117a Fix typo in Obsolete attribute message
The typo in the Obsolete attribute message of the ActivityState field has been corrected. "USe" has been changed to "Use" in the suggestion to use ActivityInstanceId instead to locate activity state from ActivityExecutionLog.
2024-02-04 10:47:03 +01:00
Sipke Schoorstra 5c86a88d56 Remove usage of StoreBasedApplicationProvider
This commit removes the use of StoreBasedApplicationProvider from the identity setup in Elsa.Server.Web Program.cs.
2024-02-04 10:47:03 +01:00
Sipke Schoorstra 143b1b8364 Refactor logging to exclude activity state
Logging throughout the application, specifically in ActivityExecutionContextExtensions.cs, SendEmail.cs, and more, has been refactored to exclude activity state from log entries. There have also been updates to other files, such as introducing JetBrains.Annotations and modifying certain methods. Additionally, the IHttpMessageHandlerProvider.cs file has been removed.
2024-02-04 10:47:03 +01:00
Sipke Schoorstra 0bc46d3f74 Remove migration files for Management module
Deleted all migration files related to the Management module across MySql, SqlServer, Sqlite and PostgreSql data providers. These files included data compression algorithm and data format column additions in the WorkflowInstances table.
2024-02-04 01:24:03 +01:00
Sipke Schoorstra bc7d52d94c Merge branch 'main' into issue(4875) 2024-02-04 00:17:20 +01:00
Sipke Schoorstra 277ac35bb1
Merge pull request #4868 from lahma/samples-to-root-level
Move samples to repository root
2024-02-04 00:14:47 +01:00
Sipke Schoorstra 383eeab751 Add data compression and format fields to WorkflowInstances
This commit introduces two new fields to the WorkflowInstances table: "DataCompressionAlgorithm" and "DataFormat". These changes allow storing additional contextual information about the payloads of workflow instances and enhance future handling and processing of this data.
2024-02-04 00:06:41 +01:00
Sipke Schoorstra 22f72080f3 Add V3_1 migrations for various Elsa DB contexts
This commit includes the creation of migration files for MySql, SqlServer, Sqlite, and PostgreSql contexts in the Elsa project. The files for version V3_1 were automatically generated and are to be implemented with the necessary changes in the Up and Down methods as per the requirements.
2024-02-03 22:39:47 +01:00
Sipke Schoorstra 0bfebccadb Add compression feature for workflow state data
This update adds a compression feature for workflow state data to reduce storage needs. A compression strategy resolver, None and GZip strategies have been implemented. Migration scripts were also updated, and a superfluous file(s) were removed.
2024-02-03 22:24:46 +01:00
Sipke Schoorstra ff9aa54fcd
Merge pull request #4869 from elsa-workflows/issue(4862)
Remove Persistence of Completed Activity Execution Contexts
2024-02-03 10:31:58 +01:00
Sipke Schoorstra 9c69eebe94 Add 'Unschedule' to UserDictionary
The term 'Unschedule' has been included to the UserDictionary within the Elsa solution settings. This update shows that 'Unschedule' is recognized in the context of the solution, thereby reducing the risk of related typographical errors.
2024-02-02 21:39:08 +01:00
Sipke Schoorstra 6b2eea3502 Optimize activity execution contexts filtering
Removed manual removal of child contexts from the list of active activity execution contexts. Replaced it with more efficient direct filtering of not completed activity execution contexts. This change may affect scripts that access activity output directly, but a variable capturing workaround is provided.
2024-02-02 21:38:51 +01:00
Sipke Schoorstra e5de5934e6 Prevent duplicate job scheduling in Quartz
Updated the QuartzWorkflowScheduler in Elsa to prevent duplicate job scheduling. Before scheduling a job, the existence of the job is now checked first. This change has been applied to all job types - timestamp, simple schedule, and cron jobs.
2024-02-02 21:38:25 +01:00
Sipke Schoorstra 2147683c2e Remove child contexts of completed workflows
The updated code cleans the child contexts of any completed contexts from the list of workflows currently in execution. This change reduces the clutter and potential complications in the context management process. Previously, the unnecessary child contexts were being stored even after the parent context has been completed.
2024-02-02 21:10:36 +01:00
Sipke Schoorstra b3d8e65c7e Remove unused namespaces in Tests.cs
The commit removes unnecessary namespaces in the integration tests for JavaScript Lists and Arrays within the Elsa project. This results in a cleaner codebase, maintaining only the libraries required for the specific tests.
2024-02-02 21:10:14 +01:00
Sipke Schoorstra 7560bfa756 Improve error handling in JavaScript Evaluator
Introduces a safeguard in the JintJavaScriptEvaluator in the Elsa.JavaScript module. This checks whether a workflow execution context can be retrieved before trying to get its input definitions. This prevents potential errors when the context isn't available.
2024-02-02 21:09:48 +01:00
Sipke Schoorstra 838e26eb2b Refactor variable handling in ExpressionExecutionContextExtensions
The code has been restructured to account for cases where there is no activity execution context available. Instead of breaking the loop in such cases, the variables are derived from the memory blocks. Also, there is minor code formatting in output handling and array conversion for async enumerables.
2024-02-02 21:09:28 +01:00
Sipke Schoorstra 69ceaeb12c Update cancellation process in ActivityExecutionContext
The cancellation process in ActivityExecutionContext has been updated to now use DisposeAsync() instead of Dispose(). This implements asynchronous disposal of the cancellation registration. Additionally, a new method supporting cancellation has been added.
2024-02-02 21:08:49 +01:00
Marko Lahma a4502e036b Move samples to repository root 2024-02-02 20:01:14 +02:00
Sipke Schoorstra 109c303b0f
Merge pull request #4864 from elsa-workflows/quartz-postgres
Fix schema for Quartz Postgres Store
2024-02-02 17:30:28 +01:00
Mohamed Ali 6cddfabf6b fix schema for quartz store 2024-02-02 14:49:34 +03:00
Sipke Schoorstra 3ff6e3ea6c
Merge pull request #4828 from lahma/directory-build-props
Use Directory.Build.props
2024-02-02 10:59:17 +01:00
Sipke Schoorstra 5436d954d0 Merge branch 'v3.0.5' 2024-02-01 20:11:01 +01:00
Sipke Schoorstra bbd381955b
Merge pull request #4857 from elsa-workflows/test(js-array-net)
Refactor JavaScript list and array test cases
2024-02-01 08:44:49 +01:00
Sipke Schoorstra 31e927be0c
Merge pull request #4853 from Suchiman/dropLinqKit
Drop LinqKit dependency
2024-01-31 22:19:51 +01:00
Sipke Schoorstra 1712e41efc Refactor JavaScript list and array test cases
The JavaScript list and array test cases code has been restructured and moved into JavaScriptListsAndArrays directory. As a consequence, the previous Tests.cs file has been deleted. Additional test cases have been added to cover more scenarios, such as handling magic numbers in the code.
2024-01-31 22:17:16 +01:00
Sipke Schoorstra a53c792c4b
Merge pull request #4856 from elsa-workflows/issue(4849)
Remove StringObjectDictionaryConverter and update JintJavaScriptEvaluator
2024-01-31 21:11:58 +01:00
Sipke Schoorstra a1c30facba Add ObjectArrayHelper and update array detection method
A new ObjectArrayHelper class has been added into the Elsa.JavaScript module to improve array detection. The previous IsArrayLike method used in JintJavaScriptEvaluator and integration tests has been replaced by the DetermineIfObjectIsArrayLikeClrCollection method from this helper. These changes also provoked an update of the Jint package version from 3.0.0-beta-2057 to 3.0.0.
2024-01-31 21:10:13 +01:00
Sipke Schoorstra 7575b78d8b Add JavaScript list and array tests
A new unit test class is added in the IntegrationTests project. The class, located in the JavaScriptListAndArray directory, focuses on testing the engine's ability to handle JavaScript list and array-like objects.
2024-01-31 19:48:07 +01:00
Sipke Schoorstra cad624c85f Remove StringObjectDictionaryConverter and update JintJavaScriptEvaluator
The StringObjectDictionaryConverter class was removed as it is no longer necessary. Instead, the JintJavaScriptEvaluator now wraps objects in ObjectWrapper instances and sets their prototype to Array.prototype if they are array-like. This allows for more convenient and intuitive use of Lists and arrays in JavaScript code within Elsa. A new integration test was created to validate this functionality.
2024-01-31 19:48:00 +01:00
Robin Sue 1a11911ba6 Drop LinqKit dependency
It is unused and brings in EF6
2024-01-31 11:06:49 +01:00
Sipke Schoorstra cf7c7c0a40 Update GitHub Actions to target version 3.0.5
The GitHub Actions workflow has been updated to focus on version 3.0.5 for both commit verification and version naming. The actions will now fetch, verify, and build with the new target version, ensuring our continuous integration remains aligned with the newest release.
2024-01-31 09:28:04 +01:00
Sipke Schoorstra ce5af36d53
Merge pull request #4850 from elsa-workflows/feature(4849)
Add support for list/array conversion in JavaScript evaluator
2024-01-31 09:26:32 +01:00
Sipke Schoorstra 1e1abfa100 Add support for list/array conversion in JavaScript evaluator
A StringObjectDictionaryConverter has been added, which converts all IList fields of an object to array fields. This enhances the interaction of JS expressions with list types, allowing common Array methods to be applied directly. Furthermore, defaults have been added to the ExpressionEvaluatorOptions parameters to improve usability. Lastly, adjustments were made to ensure variables are correctly set while evaluating expressions.
2024-01-30 21:22:32 +01:00
Sipke Schoorstra 1ca4fe6b36 Add DisplayName property to DispatchWorkflow inputs
Two inputs in DispatchWorkflow.cs, "Workflow Definition" and "Correlation ID", now have additionally defined DisplayName properties. This will enhance understanding and user experience by displaying clearer input field names within the application.
2024-01-28 23:32:46 +01:00
Nokecy 182643c910
update sqlserver Extensions support UseCompatibilityLevel cofnig 2024-01-27 11:12:35 +08:00