add apies

This commit is contained in:
Behzad Alizadeh
2026-01-06 19:55:48 +03:30
parent d31c2ab0c7
commit ccb3a24758
11 changed files with 482 additions and 150 deletions
@@ -7,30 +7,46 @@ namespace Caspian.WorkflowFramework.Contracts
/// <summary>
/// Create and executes a new workflow instance.
/// </summary>
/// <param name="input"></param>
/// <returns>A new <see cref="WorkflowResponse<WorkflowModel>"/> object.</returns>
/// <remarks>Create a new workflow instance and executes it and waits for it to complete or reach a suspend point.</remarks>
Task<WorkflowResponse<WorkflowModel>> CreateAndExecuteAsync(CreateAndExecuteWorkflowModel input);
/// <summary>
/// Create and get a last workflow running instance.
/// Create a new workflow instance if it does not exist or get the running instance.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task<WorkflowResponse<WorkflowModel>> CreateOrGetInstanceAsync(CreateAndExecuteWorkflowModel input);
/// <summary>
/// Publishes the specified event.
/// Publishes the specified event to a workflow instance.
/// </summary>
/// <param name="input"></param>
/// <returns>A new <see cref="WorkflowResponse<WorkflowModel>"/> object.</returns>
Task<WorkflowResponse<WorkflowModel>> PublishEventAsync(PublishEventModel input);
/// <summary>
/// Inquiry last state of workflow instance.
/// </summary>
/// <param name="input"></param>
/// <returns>A new <see cref="WorkflowResponse<WorkflowModel>"/> object.</returns>
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);
}
}