Commit graph

4772 commits

Author SHA1 Message Date
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
Sipke Schoorstra b3d8e65c7e Remove unused namespaces in Tests.cs
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.
2024-02-02 21:10:14 +01:00
Sipke Schoorstra 7560bfa756 Improve error handling in JavaScript Evaluator
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.
2024-02-02 21:09:48 +01:00
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 bbd381955b
Merge pull request #4857 from elsa-workflows/test(js-array-net)
Refactor JavaScript list and array test cases
2024-02-01 08:44:49 +01:00
Sipke Schoorstra 31e927be0c
Merge pull request #4853 from Suchiman/dropLinqKit
Drop LinqKit dependency
2024-01-31 22:19:51 +01:00
Sipke Schoorstra 1712e41efc Refactor JavaScript list and array test cases
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.
2024-01-31 22:17:16 +01:00
Sipke Schoorstra a53c792c4b
Merge pull request #4856 from elsa-workflows/issue(4849)
Remove StringObjectDictionaryConverter and update JintJavaScriptEvaluator
2024-01-31 21:11:58 +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 7575b78d8b Add JavaScript list and array tests
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.
2024-01-31 19:48:07 +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 cf7c7c0a40 Update GitHub Actions to target version 3.0.5
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.
2024-01-31 09:28:04 +01:00
Sipke Schoorstra ce5af36d53
Merge pull request #4850 from elsa-workflows/feature(4849)
Add support for list/array conversion in JavaScript evaluator
2024-01-31 09:26:32 +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 d4171f3428
Merge pull request #4842 from elsa-workflows/feature/batch-processing
Bulk Dispatch Workflows Enhancements
2024-01-26 21:27:34 +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 a644d59c73 Update target branches for GitHub Actions
The target branches for GitHub Action on pull requests have been updated. Specifically, the wildcard 'v3*' is removed from the 'OnPullRequestBranches' attribute. Now, actions will only be triggered for pull requests on the 'main' branch.
2024-01-26 14:49:30 +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 03743d6da1 Update version number in GitHub workflow
The version number has been updated in the GitHub actions workflow file. Previously, it was hardcoded to "3.0.3-preview", but now it's switched to "3.0.4-preview". This change keeps our software versioning consistent and up-to-date.
2024-01-24 01:21:52 +01:00
Sipke Schoorstra 792c06ee04 Update GitHub actions workflow to target v3.0.4
The GitHub actions workflow has been updated to target the version branch v3.0.4. The necessary checks and commands have been modified accordingly to ensure proper compatibility with the new branch. This update is necessary for the correct functioning of the automatic deployment activities.
2024-01-24 01:18:00 +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 e45ec3e6b4
Disabled tests that had an unreliable result (#4827) 2024-01-23 12:34:45 +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
Marko Lahma 832fac4db1
Add NUKE build support (#4815) 2024-01-21 10:53:07 +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