elsa-core/src/Flowsharp.Core/Handlers/IActivityHandler.cs
2018-10-16 11:52:55 +02:00

31 lines
1.1 KiB
C#

using System;
using System.Threading;
using System.Threading.Tasks;
using Flowsharp.Models;
using Flowsharp.Results;
namespace Flowsharp.Handlers
{
public interface IActivityHandler
{
/// <summary>
/// The type of activity handled by this handler.
/// </summary>
Type ActivityType { get; }
/// <summary>
/// Returns a value of whether the specified activity can execute.
/// </summary>
Task<bool> CanExecuteAsync(IActivity activity, WorkflowExecutionContext workflowContext, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified activity.
/// </summary>
Task<ActivityExecutionResult> ExecuteAsync(IActivity activity, WorkflowExecutionContext workflowContext, CancellationToken cancellationToken);
/// <summary>
/// Resumes the specified activity.
/// </summary>
Task<ActivityExecutionResult> ResumeAsync(IActivity activity, WorkflowExecutionContext workflowContext, CancellationToken cancellationToken);
}
}