From afeda9dba055d7754162abfbc8003c7f60022e86 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Tue, 29 Jun 2021 21:04:28 +0200 Subject: [PATCH] Make Trigger bookmark optional and default to Bookmark --- .../Elsa.Abstractions/Services/Workflows/IWorkflowLaunchpad.cs | 2 +- src/core/Elsa.Core/Services/Workflows/WorkflowLaunchpad.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Elsa.Abstractions/Services/Workflows/IWorkflowLaunchpad.cs b/src/core/Elsa.Abstractions/Services/Workflows/IWorkflowLaunchpad.cs index da15493e9..208809bf1 100644 --- a/src/core/Elsa.Abstractions/Services/Workflows/IWorkflowLaunchpad.cs +++ b/src/core/Elsa.Abstractions/Services/Workflows/IWorkflowLaunchpad.cs @@ -95,7 +95,7 @@ namespace Elsa.Services Task> CollectAndDispatchWorkflowsAsync(CollectWorkflowsContext context, object? input = default, CancellationToken cancellationToken = default); } - public record CollectWorkflowsContext(string ActivityType, IBookmark? Bookmark, IBookmark? Trigger, string? CorrelationId = default, string? WorkflowInstanceId = default, string? ContextId = default, string? TenantId = default); + public record CollectWorkflowsContext(string ActivityType, IBookmark? Bookmark, IBookmark? Trigger = default, string? CorrelationId = default, string? WorkflowInstanceId = default, string? ContextId = default, string? TenantId = default); public record CollectStartableWorkflowsContext(string WorkflowDefinitionId, string? ActivityId = default, string? CorrelationId = default, string? ContextId = default, string? TenantId = default); } \ No newline at end of file diff --git a/src/core/Elsa.Core/Services/Workflows/WorkflowLaunchpad.cs b/src/core/Elsa.Core/Services/Workflows/WorkflowLaunchpad.cs index 88da7dd97..6e8362a26 100644 --- a/src/core/Elsa.Core/Services/Workflows/WorkflowLaunchpad.cs +++ b/src/core/Elsa.Core/Services/Workflows/WorkflowLaunchpad.cs @@ -199,7 +199,7 @@ namespace Elsa.Services.Workflows { _logger.LogDebug("Triggering workflows using {ActivityType}", context.ActivityType); - var filter = context.Trigger; + var filter = context.Trigger ?? context.Bookmark; var triggers = filter != null ? (await _triggerFinder.FindTriggersAsync(context.ActivityType, filter, context.TenantId, cancellationToken)).ToList() : new List(); var startableWorkflows = new List();