From 81ebab401d257fe327c3b846d79ab3f54e4eec85 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Fri, 2 Sep 2022 19:11:34 +0200 Subject: [PATCH] Delete DefaultWorkflowInvoker.cs --- .../Implementations/DefaultWorkflowInvoker.cs | 90 ------------------- 1 file changed, 90 deletions(-) delete mode 100644 src/modules/Elsa.Workflows.Runtime/Implementations/DefaultWorkflowInvoker.cs diff --git a/src/modules/Elsa.Workflows.Runtime/Implementations/DefaultWorkflowInvoker.cs b/src/modules/Elsa.Workflows.Runtime/Implementations/DefaultWorkflowInvoker.cs deleted file mode 100644 index 10218fae2..000000000 --- a/src/modules/Elsa.Workflows.Runtime/Implementations/DefaultWorkflowInvoker.cs +++ /dev/null @@ -1,90 +0,0 @@ -// using Elsa.Models; -// using Elsa.Workflows.Core.Models; -// using Elsa.Workflows.Core.Services; -// using Elsa.Workflows.Core.State; -// using Elsa.Workflows.Persistence.Entities; -// using Elsa.Workflows.Persistence.Services; -// using Elsa.Workflows.Runtime.Models; -// using Elsa.Workflows.Runtime.Services; -// -// namespace Elsa.Workflows.Runtime.Implementations; -// -// /// -// /// A basic implementation that directly executes the specified workflow in local memory (as opposed elsewhere in some cluster). -// /// -// public class DefaultWorkflowInvoker : IWorkflowInvoker -// { -// private readonly IWorkflowDefinitionStore _workflowDefinitionStore; -// private readonly IWorkflowInstanceStore _workflowInstanceStore; -// private readonly IWorkflowDefinitionService _workflowDefinitionService; -// private readonly IWorkflowRunner _workflowRunner; -// -// public DefaultWorkflowInvoker( -// IWorkflowDefinitionStore workflowDefinitionStore, -// IWorkflowInstanceStore workflowInstanceStore, -// IWorkflowDefinitionService workflowDefinitionService, -// IWorkflowRunner workflowRunner) -// { -// _workflowInstanceStore = workflowInstanceStore; -// _workflowDefinitionService = workflowDefinitionService; -// _workflowRunner = workflowRunner; -// _workflowDefinitionStore = workflowDefinitionStore; -// } -// -// public async Task InvokeAsync(InvokeWorkflowDefinitionRequest request, CancellationToken cancellationToken = default) -// { -// var definition = await GetWorkflowDefinitionAsync(request.DefinitionId, request.VersionOptions, cancellationToken); -// var input = request.Input; -// var workflow = await _workflowDefinitionService.MaterializeWorkflowAsync(definition, cancellationToken); -// var result = await _workflowRunner.RunAsync(workflow, input, cancellationToken); -// return new InvokeWorkflowResult(result.WorkflowState, result.Bookmarks); -// } -// -// public async Task InvokeAsync(InvokeWorkflowInstanceRequest request, CancellationToken cancellationToken = default) -// { -// var workflowInstance = await _workflowInstanceStore.FindByIdAsync(request.InstanceId, cancellationToken); -// -// if (workflowInstance == null) -// throw new Exception($"No workflow instance found with ID {request.InstanceId}"); -// -// return await InvokeAsync(workflowInstance!, request.Bookmark, request.Input, cancellationToken); -// } -// -// public async Task InvokeAsync(WorkflowInstance workflowInstance, Bookmark? bookmark = default, IDictionary? input = default, CancellationToken cancellationToken = default) -// { -// var workflow = (await _workflowDefinitionStore.FindManyByDefinitionIdAsync(workflowInstance.DefinitionId, VersionOptions.SpecificVersion(workflowInstance.Version), cancellationToken)).FirstOrDefault(); -// -// if (workflow == null) -// throw new Exception($"Workflow instance references a workflow that does not exist"); -// -// var workflowState = workflowInstance.WorkflowState; -// return await InvokeAsync(workflow, workflowState, bookmark, input, cancellationToken); -// } -// -// public async Task InvokeAsync(WorkflowDefinition workflowDefinition, WorkflowState workflowState, Bookmark? bookmark = default, IDictionary? input = default, CancellationToken cancellationToken = default) -// { -// var workflow = await _workflowDefinitionService.MaterializeWorkflowAsync(workflowDefinition, cancellationToken); -// return await InvokeAsync(workflow, workflowState, bookmark, input, cancellationToken); -// } -// -// public async Task InvokeAsync(Workflow workflow, WorkflowState workflowState, Bookmark? bookmark = default, IDictionary? input = default, CancellationToken cancellationToken = default) -// { -// var result = await _workflowRunner.RunAsync(workflow, workflowState, bookmark, input, cancellationToken); -// return new InvokeWorkflowResult(result.WorkflowState, result.Bookmarks); -// } -// -// public Task StartAsync(string definitionId, VersionOptions versionOptions, IDictionary? input = default, string? correlationId = default, CancellationToken cancellationToken = default) -// { -// throw new NotImplementedException(); -// } -// -// private async Task GetWorkflowDefinitionAsync(string definitionId, VersionOptions versionOptions, CancellationToken cancellationToken = default) -// { -// var definition = (await _workflowDefinitionStore.FindManyByDefinitionIdAsync(definitionId, versionOptions, cancellationToken)).FirstOrDefault(); -// -// if (definition == null) -// throw new Exception($"Workflow instance references a workflow that does not exist"); -// -// return definition; -// } -// } \ No newline at end of file