Commit graph

4090 commits

Author SHA1 Message Date
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
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 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 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 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
Sipke Schoorstra 011233b17d Update ForEach to ParallelForEach in OrderBatchProcessor
The commit changes the 'ForEach' activity to 'ParallelForEach' in the 'OrderBatchProcessor.cs' file. This adjustment seeks to iterate through orders in parallel rather than sequentially, aiming to improve efficiency and performance. The 'ItemSource' property was also renamed to 'Items' to align with the new activity.
2024-01-26 21:32:48 +01:00
Sipke Schoorstra c223bb156c Downgrade System.ComponentModel.Annotations package version
The version of the System.ComponentModel.Annotations package was downgraded from 6.0.0-preview.4.21253.7 to 5.0.0 in the Elsa.Workflows.Core project. This could be due to compatibility issues or to match the version used in other components of the project.
2024-01-26 21:22:24 +01:00
Sipke Schoorstra b933def16d Simplify iteration logic in ForEachT.cs
Removed the ItemSource property and related logic in ForEachT.cs. Instead of considering two sources (Items and ItemSource) for iterations, the code now only iterates over the Items collection. Additional logic has been added to initialize Items to an empty collection when it is not set.
2024-01-26 21:21:21 +01:00
Sipke Schoorstra 396e84c805 Implement enhanced activity tracking in Elsa workflow runtime
This update adds new keys to the default background activity invoker for task completion and bookmarks. It also modifies handling of dispatched workflow instances in BulkDispatchWorkflows activity. It further updates the BackgroundActivityInvokerMiddleware to capture and remove additional task details from the workflow execution context. Refactors are made to ObjectConverter and a set method for background completion is added to ActivityExecutionContextExtensions and BackgroundActivityExecutionContextExtensions.
2024-01-26 21:09:47 +01:00
Sipke Schoorstra 55737f24ae Refactor formatting and rearrange project reference order
Modified code formatting to enhance readability in several files including integration tests and workflow definitions. Order of project references in both Elsa.sln and Elsa.Server.Web.csproj files were rearranged. Unnecessary namespaces were also removed in BulkSuspendedWorkflow.cs and _build.csproj file saw a minor adjustment.
2024-01-26 19:55:01 +01:00
Sipke Schoorstra 1293b7af29 Merge branch 'main' into feature/batch-processing 2024-01-26 19:30:20 +01:00
Sipke Schoorstra 15e5e58de2 Refactor GetWorkflowDefinitionId in ActivityExtensions
Expanded the GetWorkflowDefinitionId method in ActivityExtensions.cs to check for multiple properties before determining whether an activity is a workflow definition activity or not. This ensures a more rigorous validation process.
2024-01-26 19:20:23 +01:00
Marko Lahma 68beb5c61f replace configureawait.props and frameworks.props with Directory.Build.props 2024-01-26 19:04:39 +02:00
Marko Lahma 2f6ecb0b5d Use Directory.Build.props 2024-01-26 18:43:50 +02:00
Sipke Schoorstra d693cb7f8f Remove unused Elsa.Webhooks.Extensions import
The Elsa.Webhooks.Extensions import was removed from various Program.cs files because it doesn't exist anymore.
2024-01-26 14:52:31 +01:00
Sipke Schoorstra 4a3ae96ed9 Remove hardcoded version from Elsa.Workflows.Api.csproj
The hardcoded version specification has been removed from the Elsa.Workflows.Api project file. This change will allow the versioning system to more effectively manage and track the versioning of the project.
2024-01-26 14:49:42 +01:00
Sipke Schoorstra 64c4d89739 Update namespace in ModuleExtensions.cs
The namespace in the ModuleExtensions.cs file within Elsa.Webhooks has been changed. The change moves the namespace from "Elsa.Webhooks.Extensions" to "Elsa.Extensions". A ReSharper directive has been added to disable warnings related to the namespace check.
2024-01-26 11:25:25 +01:00
Sipke Schoorstra bc9d7b7f8c Merge branch 'v3.0.4' 2024-01-24 20:33:32 +01:00
Sipke Schoorstra e7edb1d3ea Update Elsa.Studio and Elsa.Studio.Login.BlazorWasm package versions
The package versions for Elsa.Studio and Elsa.Studio.Login.BlazorWasm have been updated to 3.0.4 across multiple projects. This update allows projects to utilize the latest features and improvements from these packages.
2024-01-24 20:32:33 +01:00
Sipke Schoorstra d0a72deadf Merge branch 'v3.0.4' 2024-01-24 11:07:56 +01:00
Sipke Schoorstra a1b7afdf4f Reorder methods in WorkflowStateExtractor service
The private methods within the WorkflowStateExtractor service have been reordered for readability and maintainability. The `ApplyInput` and `GetPersistableInput` methods have been moved to a position just before the `ExtractProperties` method. This ensures that similar or related methods are grouped together, improving the logical structure of the code.
2024-01-23 22:03:02 +01:00
Sipke Schoorstra a7851175b8 Add input application to workflow state extractor
A new method ApplyInput has been added to prevent overwriting any existing input in the WorkflowExecutionContext. Now, input items are added to the workflow execution context only if they don't exist there already. The Apply method has been updated as well to add workflow state inputs appropriately.

Fixes #4705
2024-01-23 22:03:02 +01:00
raymonddenhaan c409414152
Workflow cancellation (#4813)
* Removed duplicate entries

* Prevented workflows and activities from starting when the parent workflow is being cancelled

* Added cancellation to execution contexts

* Added store for workflow execution contexts

* Added cancellation to workflowRuntime

* Removed calling BookmarkPersistedHandler when persisting bookmarks.

* Added endpoint for bulk cancelling tasks

* Added tests for cancelling workflows

* Prevented cancelling the cancellation process since it could have unwanted effects

---------

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2024-01-23 12:05:03 +01:00
Mohamed Ali 00331f7497
Allow multiple value processing for Form and QueryString values. (#4736)
* Allow multiple value processing for Form and QueryString values.

* refactor HTTPEndpoint

* add multi-part form handling

* cleanup

* reoder form handling code
2024-01-21 10:52:46 +01:00
dependabot[bot] 5edda57c5b
Bump System.Data.SqlClient in /src/modules/Elsa.Dapper (#4805)
Bumps [System.Data.SqlClient](https://github.com/dotnet/corefx) from 4.8.5 to 4.8.6.
- [Release notes](https://github.com/dotnet/corefx/releases)
- [Commits](https://github.com/dotnet/corefx/commits)

---
updated-dependencies:
- dependency-name: System.Data.SqlClient
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-21 10:45:34 +01:00
Night Wu 4912726ea0
Fix InvalidOperation Exception for SaveVariablesAsync function (#4808)
Co-authored-by: admin <admin@admin.com>
2024-01-19 20:50:30 +01:00
Sipke Schoorstra 6c649540bb Update Elsa.Studio and Elsa.Studio.Login.BlazorWasm versions
The version of Elsa.Studio and Elsa.Studio.Login.BlazorWasm in the Elsa.ServerAndStudio.Web project has been upgraded from 3.0.2 to 3.0.3. This update aims to incorporate the latest features and bug fixes from these packages.
2024-01-19 10:50:45 +01:00
Sipke Schoorstra 72b1b2bb40 Add input parameter to ScheduleChildActivity signal
This update includes adding an optional input parameter to the ScheduleChildActivity signal's constructor in order to pass options to the child activity. The input parameter is used while scheduling activities in FlowFork.cs and Flowchart.cs activities. This enables clearer data transfer and scheduling in the system.
2024-01-17 22:32:06 +01:00
Sipke Schoorstra 18fd4ff796 Add BatchProcessing sample and update ForEach activities
A new BatchProcessing sample project has been added demonstrating how to process items in batches. ForEach and ParallelForEach activities were updated to allow using an IAsyncEnumerable as source. BulkDispatchWorkflows was also refactored to improve its efficiency and handling.
2024-01-17 22:11:03 +01:00
Sipke Schoorstra 39788fb8eb Add Elsa.CSharp project reference and enhance JavaScript usage
The Elsa.Samples.AspNet.MassTransitActivities.csproj file now includes a reference to Elsa.CSharp.csproj. Moreover, the use of JavaScript in the MassTransitActivities sample project has been improved. Clr access granting has been enabled and specific types have been registered to the engine options. Additionally, C# usage is now set, adding required assembly and namespaces.
2024-01-16 21:50:20 +01:00
Sipke Schoorstra ac9428a6e0
Allow creation of variables dynamically via setVariable (#4800)
* Disable MassTransitRabbitMq in Elsa.Server.Web.

* Create variable if not exists in Workflow.Core

The update introduced checks if a variable exists before attempting to set its value in the ExpressionExecutionContextExtensions. If the variable doesn't exist, it now creates one automatically.

Fixes #4789

* Remove unnecessary comment

The comment indicating to create a variable if it doesn't exist was deemed superfluous and removed from the ExpressionExecutionContextExtensions.cs file. This improves code cleanliness as the functionality is self-explanatory through the existing code structure.
2024-01-15 21:15:05 +01:00
Night Wu 310b6fbcd4
Use correct dialect for SqlServerDbConnectionProvider (#4766)
Co-authored-by: admin <admin@admin.com>
2024-01-15 19:45:03 +01:00
leeveney 3d0bfb2bfd
fix EvaluatingCSharp class file name typo (#4783) 2024-01-15 19:39:28 +01:00
Sipke Schoorstra 66d8e4b20f Updated MassTransit sample project
This commit updates the Elsa.Samples.AspNet.MassTransitActivities.csproj
2024-01-12 08:47:41 +01:00
Sipke Schoorstra 642e700c3d
Refactor MassTransitActivityTypeProvider (#4792)
Fixed the Message input descriptor for dynamically provided MassTransit PublishMessage activities.
2024-01-11 21:00:35 +01:00
Sipke Schoorstra 3e2a8f6295 Update Elsa.Studio packages to version 3.0.2
The package references for Elsa.Studio, Elsa.Studio.Core.BlazorWasm, and Elsa.Studio.Login.BlazorWasm have been updated in the specified project files. This ensures that the projects are using the latest version of these packages.
2024-01-08 12:05:31 +01:00
Sipke Schoorstra c601076437 Add workflow serialization and new export endpoint
Implemented a functionality to serialize workflow definitions. This involved modifying the WorkflowSerializer service and the WorkflowDefinitionMapper. Furthermore, a new endpoint (`/export-dynamic-workflow`) for exporting serialized dynamic workflows was created. The changes aim to provide better workflow management and improve application capabilities.
2024-01-07 21:07:14 +01:00
Sipke Schoorstra 704d2207e2 Merge branch 'v3.0.2' into main 2024-01-07 17:16:59 +01:00
Sipke Schoorstra 42db09c689 Update Elsa.Studio packages to version 3.0.1
The Elsa.Studio, Elsa.Studio.Login.BlazorWasm, and Elsa.Studio.Core.BlazorWasm packages have been updated from version 3.0.1-preview.196 to version 3.0.1 in all projects. These updates move the projects from the preview versions to the stable 3.0.1 release.
2024-01-07 17:06:35 +01:00
Sipke Schoorstra a8878e28a7 Merge branch 'v3.0.2' of https://github.com/elsa-workflows/elsa-core into v3.0.2 2024-01-07 16:20:10 +01:00
Sipke Schoorstra c2ec2bda5a Update handling of null outcomes in activity execution
The code was adjusted to correctly handle cases when the method `GetBackgroundOutcomes` returns null. This would cause the activity to complete prematurely.

Fixes #4763
2024-01-07 16:20:02 +01:00
Night Wu ab69e739da
Update FastEndpoints* nuget packages to 5.21.2 version (#4764)
Co-authored-by: admin <admin@admin.com>
2024-01-07 15:56:39 +01:00
Sipke Schoorstra 900aac6d56 Revert "Update FastEndpoints packages to version 5.21.2"
This reverts commit 3b48636ced.
2024-01-07 15:20:56 +01:00
Sipke Schoorstra 6c6263622e Update Elsa.Api.Client version and branch reference
Updated the Elsa.Api.Client package version from a preview version to a stable one in the Elsa.Studio.Core project. In addition, adjusted the branch reference in GitHub actions workflow from v3.0.1 to main ensuring the project references the stable Elsa.Api.Client version and that the workflow tracks changes on the main branch, respectively.
2024-01-06 18:21:34 +01:00