* 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>
23 lines
1 KiB
C#
23 lines
1 KiB
C#
using Elsa.Mediator;
|
|
using Elsa.Mediator.Contracts;
|
|
using Elsa.Workflows.Runtime.Contracts;
|
|
using Elsa.Workflows.Runtime.Notifications;
|
|
using Elsa.Workflows.Runtime.Requests;
|
|
|
|
namespace Elsa.Workflows.Runtime.Services;
|
|
|
|
/// <inheritdoc />
|
|
public class BookmarksPersister(IBookmarkUpdater bookmarkUpdater, INotificationSender notificationSender) : IBookmarksPersister
|
|
{
|
|
/// <inheritdoc />
|
|
public async Task PersistBookmarksAsync(UpdateBookmarksRequest updateBookmarksRequest)
|
|
{
|
|
await bookmarkUpdater.UpdateBookmarksAsync(updateBookmarksRequest);
|
|
|
|
// Publish domain event.
|
|
await notificationSender.SendAsync(new WorkflowBookmarksIndexed(new IndexedWorkflowBookmarks(updateBookmarksRequest.WorkflowInstanceId, updateBookmarksRequest.Diff.Added, updateBookmarksRequest.Diff.Removed, updateBookmarksRequest.Diff.Unchanged)));
|
|
|
|
// Publish domain event.
|
|
await notificationSender.SendAsync(new WorkflowBookmarksPersisted(updateBookmarksRequest.Diff), NotificationStrategy.Background);
|
|
}
|
|
} |