Commit graph

17 commits

Author SHA1 Message Date
Sipke Schoorstra 485e6bfeef Skip outdated test for suspended workflow cancellation.
Marked the "SuspendedCancelTest" as outdated to prevent it from running. This test requires updates to align with recent changes and ensure its relevance. Skipping it avoids potential false negatives during testing.
2024-12-18 15:55:31 +01:00
Sipke Schoorstra 8a417ca765
Remove ExpandoObject support from JintJavaScriptEvaluator (#5913)
Removed the `ConverterHelper` and `ExpandoObjectConverter` classes, along with their integration in `JintJavaScriptEvaluator`. Updated unit tests to skip unsupported functionality and added references to related issues for context.
2024-08-19 09:13:45 +02:00
Sipke Schoorstra 5f11026ee7
Add JS functions for encoding/decoding byte arrays from and to strings (#5902)
* Add handlers and improve JavaScript engine configuration

Added several new handlers for configuring the JavaScript engine with common types, functions, variable accessors, and input/output accessors. Refactored the JintJavaScriptEvaluator for better clarity and modularity by breaking down configuration steps into separate methods. Also replaced `IsInsideCompositeActivity` with `IsContainedWithinCompositeActivity` for better semantic consistency.

* Refactor to use primary constructor syntax for TypeDefinitionProviders

Updated CommonTypeDefinitionProvider, VariableTypeDefinitionProvider, and ActivityOutputFunctionsDefinitionProvider to use primary constructors for dependency injection. This change reduces redundancy and simplifies the code structure for better readability and maintainability.

* Add byte conversion functions to JavaScript engine

Introduced functions for converting bytes to/from strings and Base64. Updated CommonFunctionsDefinitionProvider and ConfigureEngineWithCommonFunctions to incorporate these new functions. This enhances the JavaScript engine's ability to handle byte array manipulations.

* Add tests for JavaScript byte and string conversions.

Introduce integration tests to verify byte array to string, string to byte array, byte array to Base64, and Base64 to byte array conversions using JavaScript functions. Ensure accurate transformation of data within different encoding scenarios.

* Add meaningful summaries to Jint engine configuration handlers

Updated comment summaries in four handler classes to provide clear and concise descriptions of their purpose. This helps improve code readability and understanding for future developers.

* Rename and merge variable and input/output handlers

Merged the variable accessor logic into the input/output handler and renamed the class to reflect its broader functionality. This consolidation ensures the accessors are registered in the right order.

* Add string base64 conversion functions

Introduced `stringToBase64` and `stringFromBase64` functions to handle base64 encoding and decoding of strings. Updated corresponding provider, handler, and added tests to ensure functionality.
2024-08-14 17:43:35 +02:00
Sipke Schoorstra 71d56e1665 Add ExpandoObjectConverter for JavaScript object conversion
Introduced `ConverterHelper` and `ExpandoObjectConverter` to handle conversions from .NET dynamic objects to JavaScript objects. Updated integration tests to validate the conversion and sorting functionalities.

Fixes #5895
2024-08-13 19:58:18 +02:00
raymonddenhaan c7b5caafdc
Added aliases for all missing types used in UI (#5743) 2024-07-10 18:38:11 +02:00
raymonddenhaan 6f36cfff0c
Update serialization and conversion functions (#5682)
* Update serialization and conversion functions

Updated JSON conversion to be able to use type aliases when saving serialized data to the DB.

* Simplify and update type alias registration.

Removed redundant XML comments and replaced IDictionary type aliases with Dictionary equivalents for consistency. These changes improve code readability and maintainability.

* Use collection initializer syntax

* Change "_type" values to "ObjectDictionary" in test files

Updated the "_type" field in various JSON test files from multiple different values to a unified "ObjectDictionary". This ensures consistency across the test files and aligns with the expected type format.

---------

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2024-07-03 20:47:46 +02:00
raymonddenhaan a271d8d048
Update packages to latest versions (#5567) 2024-06-10 12:01:42 +02:00
Raymond den Haan ef65580d1f Fix naming 2024-06-07 13:13:47 +02:00
Raymond den Haan fb3b5339f4 Made Updating workflow references part of Publish logic 2024-06-07 13:13:47 +02:00
Sipke Schoorstra a2908960a4
Add Fault Code, Category and Type (#5362)
* Add error handling with fault categories and codes

The code now includes error handling through the introduction of fault categories and codes. New files containing constants for fault categories and codes have been added for different modules. FaultException has also been updated to include these properties. Changes are evident in various files where FaultException is thrown for error handling.

* Add DotSettings file for Elsa.Alterations module

A new DotSettings file is added for the Elsa.Alterations module. This includes configuration for namespace folders to be skipped during CodeInspection.

* Renamed "DefaultFaultKinds" to "DefaultFaultTypes" and updated usages

This commit renames the class "DefaultFaultKinds" to "DefaultFaultTypes" and updates all its references across the project files. The change is made keeping the more accurate naming context i.e., 'Types' suits better in the thrown exception scenarios.
2024-05-10 15:30:32 +02:00
jeanbaptistedalle 09cda8ecc7
feat(liquid): delete json filter and add filters already provided by fluid library (#5188)
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
2024-04-26 15:50:05 +02:00
cristinamudura 9fa1b4685e
Feature/sonar cloud (#5224)
* Update packages.yml

* Added sonar cloud properties

* Update packages.yml

* Update packages.yml

* Update packages.yml

* Update packages.yml

* Updated nuke Build to produce test coverage output

* Updated project key

* Fix organization key

* Versioning fix

* Removed sonar properties

* Added jdk17

* Changed build configuration for nuke

* Added opencover paths

* Added the coverlet collector NuGet package

* Added exclusions

* Updated workflow

* Modified exclusions

* Updated packages.yml to contain sonar cloud integration

* Removed test github action

* Updated for test coverage

* Updated MergeWith property for the tests

* Add verbose to check for code coverage issue

* Updated reportPaths

* Added --collect parameter

* Updates

* Updated packages workflow

* Updated exclusions

* Added sonar exclusions

* Updated exclusions

---------

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2024-04-26 15:46:34 +02:00
MariusVuscanNx 05fd1440c1
Test workflows housekeeping (#5092)
* Updated WorkflowStorageDriver namespace reference

* Updated UI hint name
2024-03-19 13:51:18 +01:00
Sipke Schoorstra 5f47cd0aab
Implement distributed lock for registry population (#4983)
* Implement distributed lock for registry population

Added distributed lock in 'PopulateRegistriesHostedService' to prevent concurrent registry updates. Also implemented a semaphore in 'DefaultWorkflowDefinitionStorePopulator' to control access to shared resources during add or update operations. This change helps to ensure the integrity and consistency of the workflow registries.

* Refactor dependency injection for IDistributedLockProvider

* Refactor option classes to parameter classes in workflow runtime

This refactoring enhances the clarity of the Elsa Workflow runtime by renaming "options" classes to "parameters" classes. The name "options" misrepresented the classes' role and created confusion, as they are used to parameterize method calls rather than to configure services. The change applies to various workflow methods and tests across the project.
2024-02-22 19:37:03 +01:00
Sipke Schoorstra 3bad8a5b1b
Improve Elsa workflow expression serialization (#4930)
* Improve Elsa workflow expression serialization

Added serialization support for expressions in Elsa workflows, enabling serialization and deserialization to maintain consistent types across sessions. Updated relevant test cases for validation.

* Remove PR workflow from GitHub actions

The PR workflow has been removed from GitHub actions.
2024-02-12 18:47:25 +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
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