Add WorkflowInput to CollectAndExecuteWorkflowsAsync() to receive the bus-message. (#1332) (#1333)

This commit is contained in:
Christoph Keller 2021-07-30 09:17:18 +02:00 committed by GitHub
parent b138061661
commit 42bcb03b80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using Elsa.Activities.MassTransit.Bookmarks;
using Elsa.Activities.MassTransit.Consumers.MessageCorrelation;
using Elsa.Models;
using Elsa.Services;
using Elsa.Services.Models;
using MassTransit;
@ -44,11 +45,15 @@ namespace Elsa.Activities.MassTransit.Consumers
MessageType = message.GetType().Name
};
await _workflowLaunchpad.CollectAndExecuteWorkflowsAsync(new WorkflowsQuery(
var workflowQuery = new WorkflowsQuery(
nameof(ReceiveMassTransitMessage),
bookmark,
correlationId.ToString()
));
);
var workflowInput = new WorkflowInput { Input = message };
await _workflowLaunchpad.CollectAndExecuteWorkflowsAsync(workflowQuery, workflowInput, context.CancellationToken);
}
}
}