-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Restore variables values after resume from a bookmark. #5547
Milestone
Comments
Thanks @edward-yuen-tfs for the level of detail + working repro - I can indeed reproduce the issue. |
Confirmed on all points 👍🏻 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
For a variable defined in the parent workflow, create an activity to decrement the variable and creates a bookmark afterwards. After the bookmark is resumed, the variable value is not restored properly in the parent workflow and the variable value continues to stay as default.
Steps to Reproduce
To help us identify the issue more quickly, please follow these guidelines:
Create a sample workflow like below.
public class CountDownWorkflow : WorkflowBase
{
protected override void Build(IWorkflowBuilder builder)
{
var numberOfItems = builder.WithVariable("NumberOfItems", 5).WithWorkflowStorage();
}
}
The CustomActivity code is like below.
public class CustomActivity : CodeActivity
{
public CustomActivity()
{
}
protected override void Execute(ActivityExecutionContext context)
{
var numberOfItems = context.GetVariable("NumberOfItems");
context.SetVariable("NumberOfItems", numberOfItems - 1);
context?.CreateBookmark();
}
}
Trigger the workflow. Jot down the instance Id.
Call resume multiple times. Observed that the value does not decrement further in the While loop.
You can call the following 2 apis to try to test it with the attached sample program,
https://localhost:5001/testapi/submit - jot down the instance id.
https://localhost:5001/testapi/resume - put the instance id in the body.
Expected Behavior
Variable is decremented and the parent workflow can print it until the variable reaches zero and exit the While loop
Actual Behavior
The variable value stays as 4 all the time. Do not decrement to zero.
Screenshots
Environment
Log Output
Troubleshooting Attempts
Additional Context
Related Issues
#4148
ResumeWorkflowApp.Web.zip
The text was updated successfully, but these errors were encountered: