63 lines
2.5 KiB
C#
63 lines
2.5 KiB
C#
using Caspian.WorkflowFramework.Models;
|
|
|
|
namespace Caspian.WorkflowFramework.Contracts
|
|
{
|
|
public interface IWorkflowService
|
|
{
|
|
/// <summary>
|
|
/// Create and executes a new workflow instance.
|
|
/// </summary>
|
|
Task<WorkflowResponse<WorkflowModel>> CreateAndExecuteAsync(CreateAndExecuteWorkflowModel input);
|
|
|
|
/// <summary>
|
|
/// Create a new workflow instance if it does not exist or get the running instance.
|
|
/// </summary>
|
|
Task<WorkflowResponse<WorkflowModel>> CreateOrGetInstanceAsync(CreateAndExecuteWorkflowModel input);
|
|
|
|
/// <summary>
|
|
/// Publishes the specified event to a workflow instance.
|
|
/// </summary>
|
|
Task<WorkflowResponse<WorkflowModel>> PublishEventAsync(PublishEventModel input);
|
|
|
|
/// <summary>
|
|
/// Inquiry last state of workflow instance.
|
|
/// </summary>
|
|
Task<WorkflowResponse<WorkflowModel>> InquiryStateAsync(InquiryStateModel input);
|
|
|
|
/// <summary>
|
|
/// Gets all active workflow instances for a specific user.
|
|
/// </summary>
|
|
Task<WorkflowResponse<List<WorkflowModel>>> GetActiveInstancesAsync(GetActiveInstancesModel input);
|
|
|
|
/// <summary>
|
|
/// Gets all active workflow instance IDs for a specific user.
|
|
/// </summary>
|
|
Task<WorkflowResponse<List<string>>> GetActiveInstanceIdsAsync(GetActiveInstancesModel input);
|
|
|
|
/// <summary>
|
|
/// Gets the latest active workflow instance for a specific user and workflow name.
|
|
/// </summary>
|
|
Task<WorkflowResponse<WorkflowModel>> GetLatestActiveInstanceAsync(GetLatestActiveInstanceModel input);
|
|
|
|
/// <summary>
|
|
/// Gets the ID of the latest active workflow instance for a specific user and workflow name.
|
|
/// </summary>
|
|
Task<WorkflowResponse<dynamic>> GetLatestActiveInstanceIdAsync(GetLatestActiveInstanceModel input);
|
|
|
|
/// <summary>
|
|
/// Cancels the specified workflow instance.
|
|
/// </summary>
|
|
Task<WorkflowResponse<dynamic>> CancelInstanceAsync(CancelWorkflowInstanceModel input);
|
|
|
|
/// <summary>
|
|
/// Cancels the specified workflow instance.
|
|
/// </summary>
|
|
Task<WorkflowResponse<dynamic>> ForceCancelInstanceAsync(CancelWorkflowInstanceModel input);
|
|
|
|
/// <summary>
|
|
/// Evicts a workflow definition from cache (optional, commented out in service).
|
|
/// </summary>
|
|
Task EvictDefFromCacheAsync(string name, CancellationToken cancellationToken = default);
|
|
}
|
|
}
|