2021-04-01 16:53:26 +00:00
|
|
|
|
using System.Threading;
|
|
|
|
|
|
using System.Threading.Tasks;
|
2021-05-16 17:20:59 +00:00
|
|
|
|
using Elsa.Services;
|
2021-04-01 16:53:26 +00:00
|
|
|
|
|
|
|
|
|
|
namespace Elsa.Server.Hangfire.Jobs
|
|
|
|
|
|
{
|
|
|
|
|
|
public class WorkflowDefinitionJob
|
|
|
|
|
|
{
|
2021-05-16 17:20:59 +00:00
|
|
|
|
private readonly IWorkflowLaunchpad _launchpad;
|
|
|
|
|
|
public WorkflowDefinitionJob(IWorkflowLaunchpad launchpad) => _launchpad = launchpad;
|
|
|
|
|
|
|
|
|
|
|
|
public async Task ExecuteAsync(ExecuteWorkflowDefinitionRequest request, CancellationToken cancellationToken = default) =>
|
|
|
|
|
|
await _launchpad.CollectAndExecuteStartableWorkflowAsync(request.WorkflowDefinitionId, request.ActivityId, request.CorrelationId, request.ContextId, request.Input, request.TenantId, cancellationToken);
|
2021-04-01 16:53:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|