-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bulk Dispatch Workflows Enhancements #4842
Conversation
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.
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.
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.
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.
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.
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.
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.
/// <summary> | ||
/// Gets the background outcomes. | ||
/// </summary> | ||
public static bool? GetBackgroundCompleted(this ActivityExecutionContext activityExecutionContext) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetBackgroundCompletion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, that sounds more correct 👍🏻
yield break; | ||
|
||
var itemsType = items.GetType(); | ||
if (itemsType.Name == "AsyncEnumerableAdapter`1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way we can move away from the magic string here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that I could discover - this is an internal or even private type. That being said, we may not need this capability of sending async enumerables once we have data sets, which would be the recommended approach when sending big data.
This PR updates the BulkDispatchWorkflows with support for async-enumerables and adds support for background execution of the activity itself. Before this PR, the activity would remain in the Suspended state when executed from the background due to the fact that its bookmarks were not synced with the persisted state.