The JSON data file used in the integration tests for serialization polymorphism has been updated. Specifically, the namespace for CustomDictionary in the type metadata section has been changed to match with its current location.
* issues(4918): fix resolve scoped service for Elsa.MongoDb.Modules
issues(4918): scope service by instance CreateIndices
* issues(4918): fix review, service scope as local var to be cleany disposed
---------
Co-authored-by: BEN AMEUR <Bechir.BEN-AMEUR.ext@sodexo.com>
* Improve InputJsonConverter handling and trimming suppression
A new switch case block has been added for better handling of different types of JsonValueKind in InputJsonConverter. Also, a suppression message for the IL2026 trimming warning has been included to prevent potential runtime issues caused by code trimming, although justifications for this suppression are still pending.
* Add UIHint to While activity's Condition input
The Condition input in the While activity in Elsa.Workflows.Core has been updated to also include a UIHint. This aims to improve user input by specifically defining it as a SingleLine type.
* Rename Elsa.IntegrationTests to Elsa.Workflows.IntegrationTests
* Include missed files
* Update WorkflowExecutionContext to assign Activities
This commit updates the constructor of WorkflowExecutionContext. It adds a loop that iterates through each activityExecutionContext and associates its Activity with a corresponding one in the NodeIdLookup by using its NodeId as the key.
* Add versionOptions parameter to RunWorkflowUntilEndAsync method
This update introduces the versionOptions parameter to the RunWorkflowUntilEndAsync method, giving the user control over the version of the workflow they want to run. If no options are provided, the method defaults to running the published version.
* Add new integration tests and workflow samples
Created new integration test projects, Elsa.Alterations.IntegrationTests and Elsa.Workflows.IntegrationTests, for added functionality verification. Also added new workflow sample files "alteration-test.json" and "alteration-test.-v2.json" to "samples/aspnet/ElsaAlterationMigrateBug/Workflows" for testing purposes.
* Remove ElsaAlterationMigrateBug sample
This commit removes the ElsaAlterationMigrateBug sample from the project. The sample is no longer needed and its related files including workflows and project references have been deleted from the solution. This removal helps streamline the solution and remove unnecessary clutter.
* Update comment in MigrationTests.cs
The comments in the MigrationTests.cs file have been revised to provide a more accurate description of what happens in the code. The migration process described does not involve resetting execution, so any reference to it was removed.
* Refactor MigrationTests class summary description
The summary description of the MigrationTests class has been revised. The verb 'Represents' was removed to make the comment more concise and straightforward, focusing solely on its functional aspect.
* Update MigrationTests class constructor comments
The summary comments for the MigrationTests class constructor were corrected. Previously, it indicated that it represented a class containing tests for migration, which was inaccurate. It now properly describes that it initializes a new instance of the MigrationTests class.
The 'input' parameter in 'PublishAsync', 'DispatchAsync' and related methods across multiple classes has been replaced with 'payload'. The renaming of 'input' to 'payload' provides a more intuitive understanding of the parameter as the actual content or data of the event being published or dispatched. It also includes changes in 'PublishInternalAsync' where the workflow input dictionary is now being populated with the payload.
The script source paths in both "Elsa.Studio.Web" and "Elsa.ServerAndStudio.Web" _Host.cshtml files have been modified to use the defined base path. This change is necessary for correctly loading the "blazor.webassembly.js" script from the appropriate directory.
This update adds a comprehensive guide to the README file detailing the steps for interested individuals to contribute to the Elsa Workflow project. The guide covers everything from forking and cloning the repository, to understanding the structure of the solution, submitting changes via a pull request, and the importance of opening an issue first for discussing intended changes.
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.
This commit introduces a new integration test for the "DependencyWorkflowsPublishing" scenario. It also adds two new JSON files, "child.json" and "parent.json" to simulate the child and parent workflows accordingly. Updates are also made to the 'Elsa.IntegrationTests.csproj' and 'ServiceProviderExtensions.cs' as a part of testing setup.
This update modifies how WorkflowDefinitionManager fetches and handles workflow definitions. It now considers both the latest and published workflow definitions rather than only the published ones. It also removes the dependency id from the list of workflows to consider. A redundant workflow validator from the WorkflowDefinitionPublisher is also removed.
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.