Skip to content
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

Include transient variables in merged variables for JavaScriptEngine Access #4769

Conversation

JoostVanVelthoven
Copy link

@JoostVanVelthoven JoostVanVelthoven commented Jan 8, 2024

Summary

This pull request introduces changes to the handling of transient variables in the WorkflowExecutionContext.cs. #4713 The aim is to include transient variables in the merged variables collection, enhancing their accessibility to the JavaScriptEngine. This change is expected to improve the functionality and flexibility of variable handling within workflows.

Changes

  • Modified the GetMergedVariables() method in WorkflowExecutionContext.cs to start the aggregation with the TransientState and then merge the WorkflowInstance.Variables at the end. This ensures that transient variables are included in the merged variables.

Added

  • A new test case in WorkflowExecutionContextTests.cs to verify that transient variables set in the execution context are retrievable in the merged variable collection after the changes.

Impact

These changes allow for transient variables to be more accessible and functional within the JavaScriptEngine, enhancing the overall workflow execution capabilities.

…Access

## Summary
This pull request introduces changes to the handling of transient variables in the `WorkflowExecutionContext.cs`. The aim is to include transient variables in the merged variables collection, enhancing their accessibility to the JavaScriptEngine. This change is expected to improve the functionality and flexibility of variable handling within workflows.

## Changes
- Modified the `GetMergedVariables()` method in `WorkflowExecutionContext.cs` to start the aggregation with the TransientState and then merge the `WorkflowInstance.Variables` at the end. This ensures that transient variables are included in the merged variables.

## Added
- A new test case in `WorkflowExecutionContextTests.cs` to verify that transient variables set in the execution context are retrievable in the merged variable collection after the changes.

## Impact
These changes allow for transient variables to be more accessible and functional within the JavaScriptEngine, enhancing the overall workflow execution capabilities.
@JoostVanVelthoven
Copy link
Author

@dotnet-policy-service agree

@JoostVanVelthoven JoostVanVelthoven marked this pull request as ready for review January 8, 2024 11:25
Copy link
Member

@sfmskywalker sfmskywalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good, thank you! And even with a unit test 👍🏻

@sfmskywalker sfmskywalker merged commit 8f39424 into elsa-workflows:2.x Jan 15, 2024
3 checks passed
@JoostVanVelthoven JoostVanVelthoven deleted the fix/4713-include-transient-variables-in-merged-variables branch January 16, 2024 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants