Cannot resume workflow, ResumeWorkflowAsync removed #6381
Unanswered
andymartin
asked this question in
Q&A
Replies: 2 comments
-
You can try it like this :
public record CreateTodoStimulus(long TodoId);
public class CreateTodo : CodeActivity<object>
{
public const string InputKey = "CreateTodoInput";
protected override async ValueTask ExecuteAsync(ActivityExecutionContext context)
{
......
var stimulus = new CreateTodoStimulus(entity.Id);
context.CreateBookmark(stimulus, ResumeAsync, false);
......
}
}
private async Task ResumeTodoBookmarkAsync(long todoId, string resultPayload, CancellationToken c = default)
{
var stimulus = new CreateTodoStimulus(todoId);
var input = new Dictionary<string, object>
{
[CreateTodo.InputKey] = resultPayload,
};
var activityTypeName = ActivityTypeNameHelper.GenerateTypeName<CreateTodo>();
var bookmarkQueueItem = new NewBookmarkQueueItem
{
ActivityTypeName = activityTypeName,
StimulusHash = stimulusHasher.Hash(activityTypeName, stimulus),
Options = new ResumeBookmarkOptions
{
Input = input
}
};
await bookmarkQueue.EnqueueAsync(bookmarkQueueItem, c);
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
@andymartin I should have marked obsolete members in the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
I just updated from 3.0.2 to 3.3.1 and the scope of undocumented breaking changes in a minor release is rather alarming.
I was previously running this code:
Now it does not compile so I have to update it. The 3.3.1 source code suggests that RunWorkflowAsync will resume suspended workflows so I changed the code to the following, I get an error stating there is no workflow instance with the ActivityInstanceId.
Any guidance on the correct way to migrate this code? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions