elsa-core
elsa-core copied to clipboard
[BUG] WorkflowInput does not persist in Bookmark Callback
Description
When assigning values in the WorkflowInput
within ActivityExecutionContext within Execute
methods either directly via activity or via starting workflow the WorkflowInput
dictionary persists between each activity step. When an activity has a callback function via a Bookmark, accessing WorkflowInput
within this callback is empty. The expected behaviour is to maintain the Workflow Inputs throughout the lifetime of the Workflow. I believe this might be because WorkflowInput
can be set in the TriggerOption
class in the ResumeWorkflow
and when it's not set, it will initalise an empty Dictonary instead.
Steps to Reproduce
To help us identify the issue more quickly, please follow these guidelines:
Detailed Steps:
- Create two activities
- In first activity assign something to
WorkflowInput
within context inside of Execute method - In the second activity assign additional element within
WorkflowInput
inside the Execute method - You should have two elements when querying
WorkflowInput
in the second activity containing the elements you had specified - In sceond activity create a bookmark with a callback
- Use
IWorkflowRunTime
and resume the workflow without specify any additional options - Access
WorkflowInput
within the callback method -
WorkflowInput
is empty and the elements assign previous are lost
Reproduction Rate: Everytime
Expected Behavior
The WorkflowInput
within the bookmark callback should persist all values defined previous in the current execution of the workflow
Actual Behavior
WorkflowInput
is empty and has no values, as a result losing all WorkflowInput values previously assigned
Environment
- Elsa Package Version: 3.1
Based on the provided context, it seems that you are experiencing an issue where the WorkflowInput
dictionary is not persisting its values across different steps of the workflow, particularly after resuming from a bookmark. This behavior is unexpected as the WorkflowInput
should maintain its state throughout the execution of the workflow.
This could potentially be a bug in the Elsa Workflow version you are using (3.1). The expected behavior is that the WorkflowInput
should be accessible and should retain all the values that were previously set during the workflow execution, even after resuming from a bookmark.
To address this issue, you should:
- Ensure that you are using the latest version of Elsa Workflow, as this might be a bug that has been fixed in a newer release.
- Review the documentation to confirm that your implementation aligns with the expected usage patterns for
WorkflowInput
. - Check the Elsa GitHub issues and discussions to see if this is a known issue and if there are any suggested workarounds or fixes.
- If the issue persists and is not addressed in the documentation or GitHub issues, consider reporting this behavior as a bug on the Elsa GitHub repository.
In the meantime, as a workaround, you might consider manually persisting the WorkflowInput
values across bookmarks by using a custom persistence mechanism or by storing the values in a database or cache that can be accessed after resuming the workflow.
Please let me know if you need further assistance or if there are any specific details you would like to know regarding this issue.
This comment was generated by Glime.