Commit graph

1157 commits

Author SHA1 Message Date
Sipke Schoorstra 32e9cbfaa5 Refactor object initialization in ActivityExecutionContext
Refactoring was performed in the ActivityExecutionContext class to use object initializers for readability and clarity. This modification mainly targets the CreateBookmark and ScheduleActivityAsync methods, making their code more explicit and thus easier to understand.
2023-12-18 20:19:51 +01:00
Sipke Schoorstra 49ba29da8d Add AutoComplete option to workflow bookmarks
The AutoComplete option has been added to the workflow bookmarks, which determines whether the activity should automatically be completed if no callback is specified. This change improves the flexibility of bookmark creation and impacts various workflow elements and procedures. The corresponding adjustments have been made at functions where bookmarks are used or created.
2023-12-18 20:19:37 +01:00
Sipke Schoorstra a9ccd4fac8 Add 'Noop' method to WorkflowExecutionContext
A Noop method has been added to the WorkflowExecutionContext, and is now assigned to the ExecuteDelegate field when no resumption point is specified. The change, will prevent the invocation of the regular "ExecuteAsync" method, closing the activity without additional operations.
2023-12-18 16:12:25 +01:00
Sipke Schoorstra 8ceb76ddbe Add conversion support for long type in ObjectConverter
The ObjectConverter file has been updated to support conversion of 'long' type. This is done by adding an additional conditional statement for checking the underlying source type for 'long', then returning the converted value.
2023-12-18 16:12:01 +01:00
Sipke Schoorstra 3aedf27727 Update workflow handling and simplify codebase
Refactored the workflow handling logic and simplified numerous components in the codebase. Major changes include the enhancement of the Workflow Runtime handler, altering the broadcast and deliver functions in the Default Workflow Inbox, and the removal of unnecessary details in the Workflow Runtime feature. Also, unnecessary services and requests were removed for better code efficiency and readability.
2023-12-18 16:11:48 +01:00
Sipke Schoorstra cc24c5c759 Add bookmarks processing to DefaultBackgroundActivityInvoker
The code addition includes two dependencies, IBookmarksPersister and IWorkflowStateExtractor, in the DefaultBackgroundActivityInvoker service. With these changes, during the workflow execution phase, bookmarks are captured and processed for any state changes. These modifications provide more control and efficiency over handling workflow states during the system's background operations.
2023-12-18 16:05:51 +01:00
Sipke Schoorstra f575d38dcc Add Bookmark Persister and Bookmark Updater
The code introduces BookmarkPersister for processing bookmarks as part of the workflow runtime. This refactoring improves readability and maintainability by separating the bookmark persisting logic from the PersistBookmarkMiddleware class. A new class, BookmarkUpdater, is also added to handle updating of bookmarks. Changes also include adjustments to several other classes for improved functionality and code consistency.
2023-12-18 16:05:12 +01:00
Sipke Schoorstra 6db3cc99b5 Update BulkDispatchWorkflows activity
The BulkDispatchWorkflows.cs activity in Elsa.Workflows.Runtime module has been updated with some key changes: Added detailed description to the input element, introduced the dispatchedInstancesCount to accurately track the number of instances dispatched, and removed some unnecessary white spaces for improved readability.
2023-12-17 21:45:43 +01:00
Sipke Schoorstra 916256e9f6 Change ActivityKind from Job to Task in BulkDispatchWorkflows
The ActivityKind property in BulkDispatchWorkflows class has been changed from Job to Task. This updates the type of activity associated with the BulkDispatchWorkflows process within the Elsa workflow runtime module.
2023-12-17 21:26:58 +01:00
Sipke Schoorstra fc878a4b30 Refactor background activities scheduling
Background activities scheduling was moved to its own middleware where the actual scheduling happens instead of in the invoking middleware. Removed ScheduleBackgroundActivities.cs handler and added ScheduleBackgroundActivitiesMiddleware.cs instead. As a part of this change, restructured BackgroundActivityInvokerMiddleware to BackgroundActivityCollectorMiddleware, and updated all relevant references.

Minor modifications to a few other files include changes in their package dependencies and activity kind settings.
2023-12-17 21:19:15 +01:00
Sipke Schoorstra 19522e467f Refactor workflow methods for async execution
Modified methods in the WorkflowInstance.cs to implement re-entrant approach for asynchronous execution. This is achieved by replacing 'await' with task-based calls passed through the Context.ReenterAfter method, providing more efficient non-blocking operations. Minor changes were also made in ClusterExtensions.cs and ProtoActorWorkflowRuntime.cs, including code clean up and slight modifications to maintain consistency.
2023-12-16 21:25:40 +01:00
Sipke Schoorstra 65cb2640e3 Implement batch processing in BulkDispatchWorkflows
The changes introduce a batch processing mechanism in the BulkDispatchWorkflows activity. Previously, each workflow was dispatched individually. Now, the process groups the workflows in batches, processes each batch concurrently, and handles errors. This change improves performance, particularly for large data sources.
2023-12-16 11:45:31 +01:00
Sipke Schoorstra 6a36cbd6a3 Add ExpressionEvaluatorOptions to JavaScriptEvaluator
The JavaScriptEvaluator now accepts an options parameter of type ExpressionEvaluatorOptions. This allows adding custom arguments to the evaluation context. An 'Empty' static instance of ExpressionEvaluatorOptions is added for convenience. Additionally, the usage of MassTransitAzureServiceBus in Program.cs is turned off by setting the flag to 'false'.
2023-12-14 10:45:37 +01:00
Sipke Schoorstra 8b293884ab Add tests for implicit joins and fix duplicate activity scheduling
This commit includes new integration tests for implicit join scenarios. The tests ensure that join and parallel join activities execute correctly and complete as expected. Additionally, a change has been made to the workflow execution context to prevent duplicate activity scheduling. Now, aside from checking if the activity is already scheduled, it also checks if the activity is scheduled for the specified owner.

Fixes #4703
2023-12-13 23:38:41 +01:00
Sipke Schoorstra 5d9e886e7f Enhance configuration options for MassTransit
This commit enhances the configuration options for the MassTransit integration, providing additional settings for both Azure Service Bus and RabbitMq. It also refines the MassTransit workflow dispatcher configuration by allowing for custom dispatcher options. A default RabbitMq connection string has been added to the appsettings.json.
2023-12-11 20:49:59 +01:00
Sipke Schoorstra 065765307b Refactor MassTransit & AzureServiceBus configuration and delete unnecessary options
AzureServiceBusOption.cs and RabbitMqOptions.cs files were removed as they're no longer needed. The system now defers the configuration of MassTransit and AzureServiceBus to the application layer (Program.cs). The configuration for PrefetchCount is also allowed at the transport-level. A new abstraction, ConsumerTypeDefinition, collects all the consumer types with their respective definitions if provided. Adjustments have been made in related extension methods and classes to reflect these changes.
2023-12-11 19:59:13 +01:00
Sipke Schoorstra c8db745658 Remove unnecessary project reference in Elsa.Scheduling
Removed the project reference to Elsa.Elasticsearch in Elsa.Scheduling.csproj. This reference is no longer in use and removing it simplifies the project dependencies.
2023-12-10 22:11:01 +01:00
Sipke Schoorstra 6ff6cc6826 Refactor expression descriptors and remove unnecessary async calls
This commit refactors how expression descriptors are created and retrieved across Elsa project. The asynchronous methods have been simplified to synchronous ones removing unnecessary `ValueTask` returns. Additionally, `IExpressionDescriptorRegistryPopulator` has been removed resulting in less complexity and better performance.
2023-12-10 21:43:24 +01:00
Sipke Schoorstra cc18e99d24 Refactor HTTP headers in Elsa
Removed HttpResponseHeaders class and refactored HttpRequestHeaders class into HttpHeaders. This commit merges the separate classes to represent HTTP headers into a single class, HttpHeaders. It also includes updates to the related files like HttpJavaScriptHandler and SendHttpRequestBase to reflect these changes.
2023-12-08 21:53:43 +01:00
Sipke Schoorstra faf8fd1df6
Enhanced ObjectConverter to Return JsonObject Instead of JsonElement (#4686)
* Incremental work

* Refactor code for JSON object handling and workflow context

This commit includes a significant rework of JSON object handling by ensuring produced JsonObject remains as JsonObject. Previously unimplemented customer and order workflow context providers have been removed. The test cases have been renamed and updated to confirm the new behavior is working as expected.
2023-12-08 20:57:07 +01:00
MariusVuscanNx 2dc584fac7
Implemeted FlowFork activity (#4684) 2023-12-07 22:29:05 +01:00
Sipke Schoorstra 683f0ee6d8
Add Bulk Dispatch Workflow activity (#4683)
* Initial version of BulkDispatchWorkflow

* Update comments

* Refactor options models for running workflows and add Properties

* Fix resumption

* Add ability to provide arguments when evaluating expressions

* Update args syntax for JS

* Fix ProtoActor Runtime Properties mapping

* Use default constructor

* Provide completed workflow instance ID as input to BulkDispatchWorkflows

* Implement ChildFaulted port

* Switch to Publish to make Memory service bus work

* Update input evaluation and activity output retrieval

Refined the input evaluation process to only consider inputs with AutoEvaluate set to true. Added a comment to clarify the purpose of the GetActivitiesWithOutputs method. Removed the unnecessary check for AutoEvaluate from the EvaluateInputPropertyAsync method.
2023-12-06 22:32:08 +01:00
Sipke Schoorstra 50ac0e9371 Exclude Start field from being serialized 2023-11-30 12:14:01 +01:00
Sipke Schoorstra 811ab7702d Fix conversion of dynamic values to T 2023-11-29 20:30:38 +01:00
Sipke Schoorstra 213f114cfc Add support for JsonObject to target type conversion 2023-11-29 15:09:00 +01:00
Sipke Schoorstra bca5a8c545 Change C# Variable to Variables 2023-11-27 20:50:47 +01:00
Sipke Schoorstra fa1e9ba70f Add check to InputJsonConverterFactory
As of .NET 8, base type Input is also seen.
2023-11-27 20:37:44 +01:00
Sipke Schoorstra 40fce04a14 Fix BulkUpsert for EF Core 8 2023-11-27 19:25:44 +01:00
Sipke Schoorstra bec8cbc322
Target .NET 8 (#4660) 2023-11-27 11:26:16 +01:00
Sipke Schoorstra 48e9963d6e Split import endpoints
This fixes an issue where the import of JSON content returns 415.
2023-11-24 21:54:08 +01:00
Sipke Schoorstra c08388ec07 Update JsonContentFactory to use StringContent
This fixes an issue that Content-Length header is not included when using JsonContent, which is problematic for certain backend APIs.
2023-11-24 20:11:28 +01:00
Sipke Schoorstra 14d7ec18d6 Handle user-usage of $id key in JSON objects 2023-11-23 20:30:58 +01:00
Sipke Schoorstra c10e1b4232 Update TriggerIndexer to return modifiable lists 2023-11-22 20:47:15 +01:00
Sipke Schoorstra c841b3511f Handle attempts to serialize unserializable values 2023-11-22 20:46:40 +01:00
Sipke Schoorstra f033631b30 Fix FlowSendHttpRequest Done outcome
This fixes an issue where Done is not always triggered
2023-11-22 20:46:12 +01:00
Sipke Schoorstra 225a99f39d
Bulk Import + Export of Workflow Definitions and Instances (#4643)
* Implement bulk export of workflow definitions

* Update Import endpoint with support for file uploads

* Update Import endpoint to return imported workflow count

* Implement workflow instance (bulk) export

* Implement workflow state, bookmark, workflow + activity execution export

* Remove globally imported usings
2023-11-22 14:31:48 +01:00
Sipke Schoorstra 95bdcc64b6 Fix output mapping
Fixes #4566
2023-11-19 22:04:41 +01:00
Sipke Schoorstra fbcb6ae493 Merge branch 'v3' of https://github.com/elsa-workflows/elsa-core into v3 2023-11-19 21:13:26 +01:00
Sipke Schoorstra 0c8fa75a47 Replace IronPython implementation with Python.NET
#4164
2023-11-19 21:13:19 +01:00
jdevillard e518ec60c1
Features : Allow Customization of DbContext Schema (#4638)
* Implement Changing DB Migration Schema At Runtime

* Add Schema Customization for SQL Server Provider

* Add Schema Customization for PostreSql  Provider

* Add Schema Customization for MySql  Provider

---------

Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2023-11-19 10:22:13 +01:00
GitHub Action dae7591726 Updated designer version to 3.0.3-preview.209 2023-11-18 12:41:37 +00:00
Sipke Schoorstra bf205c72b9 Fix SetOutput handling 2023-11-17 20:59:09 +01:00
Borja Fernández 7fe05f491d
Complete activity if items count is 0 (#4623) 2023-11-15 21:00:34 +01:00
jdevillard 17f5218285
Change endpoint to Post (#4619)
* Change endpoinit to Post

* change Post for Api Client

---------

Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2023-11-15 20:50:56 +01:00
Sipke Schoorstra 21e438bdd1
Add Azure Service Bus for MassTransit (#4624)
* Split RabbitMQ from MassTransit and add Azure Service Bus package

* Use Send topology for commands
2023-11-15 20:47:11 +01:00
Sipke Schoorstra 3a4b15be13 Fix output mapping naming collision 2023-11-15 15:13:19 +01:00
Sipke Schoorstra e4d6ad22c4
Decouple Expression Types (#4622)
* Refactor Expressions model

* Enable expression type filtering

* Implement dynamic enablement of satelite dependencies
2023-11-14 20:44:42 +01:00
kirill 13e9e4fc65
Add Input Validation for Elsa.Identity Login Endpoint (#4601)
* add validator for login request

* login request: only require parameters to be not null (allow empty/whitespace)
2023-11-13 20:40:01 +01:00
Sipke Schoorstra 883ca85753 Handle workflows marked as activities with duplicate names 2023-11-10 22:08:59 +01:00
Sipke Schoorstra f0f39bec77 Fix flowchart completion miss
Added a check to take into account scheduled work who's owner is tje flowchart
2023-11-10 22:08:35 +01:00