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.
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.
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.
* 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.