Commit graph

4823 commits

Author SHA1 Message Date
Raymond den Haan 4d5f191fbc Added handler for removing orphaned subscriptions 2024-02-13 14:35:39 +01:00
Raymond den Haan 14993d466f Merge branch 'main' into feature/service-bus-pub-sub 2024-02-12 15:59:46 +01:00
Raymond den Haan 0eb274e276 Added handler for deleting orphaned subscriptions 2024-02-12 15:32:48 +01:00
Raymond den Haan 25305a9e37 Added instance services 2024-02-12 15:32:11 +01:00
Raymond den Haan b3a87c7348 Renamed temporary to shortlived 2024-02-12 15:30:19 +01:00
Raymond den Haan d3da83bb5d renamed migration 2024-02-12 15:23:18 +01:00
Sipke Schoorstra fa32e00bce Update JSON in integration test for polymorphism
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.
2024-02-11 19:02:35 +01:00
Béchir BEN AMEUR 3167ae1fc8
issues(4918): fix resolve scoped service for Elsa.MongoDb.Modules (#4924)
* 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>
2024-02-09 22:49:45 +01:00
Sipke Schoorstra 2448d5eabd
Fix serialization of Boolean activity input (#4922)
* 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.
2024-02-09 19:42:03 +01:00
Mohamed Ali 796438c51b
update AppAny package version and fix MySql and SqlServer migration for Quartz (#4921) 2024-02-09 19:38:43 +01:00
Sipke Schoorstra 60a349c8eb
Fix WorkflowExecutionContext bug (#4919)
* 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.
2024-02-09 19:37:37 +01:00
platschlena 4fe04469ec
catching the exception preventing the server from starting successfully when an incorrect cron format is entered (#4917)
Co-authored-by: Lena Pletschacher <lp@nuvotex.de>
2024-02-09 19:37:06 +01:00
Raymond den Haan 202561d5b0 Fixed issue with hardcoded consumerType 2024-02-09 15:05:51 +01:00
Raymond den Haan dd4c33c8cb Added hosted services for monitoring instance lifetimes 2024-02-09 14:07:04 +01:00
Raymond den Haan 9397fa1192 Implemented FindMany 2024-02-09 13:49:15 +01:00
Raymond den Haan 442f8d07e8 Added find functions to KeyValueStore 2024-02-09 13:22:33 +01:00
Sipke Schoorstra d4e1cf0985
Fix consumption of event payload (#4909)
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.
2024-02-09 08:20:54 +01:00
Sipke Schoorstra cfb6fa532b
Update script source path in _Host.cshtml (#4910)
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.
2024-02-08 21:39:09 +01:00
Sipke Schoorstra ae3664a5d8 Add contributing guide to README.md
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.
2024-02-08 18:42:55 +01:00
raymonddenhaan 1f402ab84c
Merge pull request #4900 from elsa-workflows/issue(4884)
Fix memory leak when using EF Core
2024-02-08 08:20:25 +01:00
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
Sipke Schoorstra d878314dbf Add dependency workflows publishing tests
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.
2024-02-07 23:22:54 +01:00
Sipke Schoorstra cfac318d7c Update WorkflowDefinitionManager to handle dependencies
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.
2024-02-07 23:22:54 +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