Add method to resume bookmark with ID and input dictionary
This commit introduces a new method in both `BookmarkResumer` and `IBookmarkResumer` to resume a bookmark using a bookmark ID and an input dictionary. This enhancement allows more flexibility in resuming bookmarks with varying input parameters.
This commit is contained in:
parent
819f27ddf1
commit
54f6d27082
|
|
@ -8,6 +8,9 @@ public interface IBookmarkResumer
|
|||
{
|
||||
/// Resumes the bookmark.
|
||||
Task<ResumeBookmarkResult> ResumeAsync<TActivity>(object stimulus, ResumeBookmarkOptions? options = null, CancellationToken cancellationToken = default) where TActivity : IActivity;
|
||||
|
||||
/// Resumes the bookmark.
|
||||
Task<ResumeBookmarkResult> ResumeAsync(string bookmarkId, IDictionary<string, object> input, CancellationToken cancellationToken = default);
|
||||
|
||||
/// Resumes the bookmark.
|
||||
Task<ResumeBookmarkResult> ResumeAsync<TActivity>(object stimulus, string? workflowInstanceId, ResumeBookmarkOptions? options = null, CancellationToken cancellationToken = default) where TActivity : IActivity;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,21 @@ public class BookmarkResumer(IWorkflowRuntime workflowRuntime, IBookmarkStore bo
|
|||
};
|
||||
return await ResumeAsync(bookmarkFilter, options, cancellationToken);
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<ResumeBookmarkResult> ResumeAsync(string bookmarkId, IDictionary<string, object> input, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var bookmarkFilter = new BookmarkFilter
|
||||
{
|
||||
BookmarkId = bookmarkId
|
||||
};
|
||||
var options = new ResumeBookmarkOptions
|
||||
{
|
||||
Input = input
|
||||
};
|
||||
return await ResumeAsync(bookmarkFilter, options, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<ResumeBookmarkResult> ResumeAsync<TActivity>(string bookmarkId, ResumeBookmarkOptions? options = null, CancellationToken cancellationToken = default) where TActivity : IActivity
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue