elsa-core
elsa-core copied to clipboard
Elsa 3 error executing csharp expression - The memory block 'Elsa.Expressions.Models.MemoryBlockReference' does not exist
Description
Getting error - 'The memory block 'Elsa.Expressions.Models.MemoryBlockReference' does not exist' when a accessing workflow input inside "Elsa.FlowDecision" using csharp expression "Input.Get("IsError")"
Steps to Reproduce
1. Workflow uses custom activities and FlowDecision. Workflow expects input of type boolean
2. The flow is designed using designer and WorkFlow JSON is exported and run from .Net 8 application using code below
Attached is the workflow json generated
Please advise.
To address the issue you're encountering with the 'The memory block 'Elsa.Expressions.Models.MemoryBlockReference' does not exist' error, it's important to ensure that the workflow is correctly configured to pass and receive the expected inputs and outputs, especially when dealing with custom activities and decisions.
Here are a few steps you can take to troubleshoot and potentially resolve the issue:
-
Check the Workflow Definition: Ensure that the workflow definition (JSON) is correctly structured and that the input for the
Elsa.FlowDecision
activity is correctly mapped to the expected boolean value. -
Review Custom Activities: If you are using custom activities, make sure that they are correctly returning the expected outputs and that these outputs are accessible to the
Elsa.FlowDecision
activity. -
Examine the Workflow Context: Verify that the workflow context at runtime contains the necessary data and that it is being passed correctly to the
Elsa.FlowDecision
activity. -
Update Elsa Packages: If you are not using the latest version of Elsa, consider updating to the latest stable release, as it may contain bug fixes and improvements that could resolve your issue.
-
Consult Elsa Documentation: Review the official Elsa documentation for guidance on working with inputs and outputs, custom activities, and decision activities.
-
Seek Community Help: If the issue persists, consider reaching out to the Elsa community on GitHub or other forums for assistance. Provide detailed information about your issue, including the workflow definition and any relevant code snippets.
-
Debugging: Use debugging tools to step through the workflow execution and inspect the state of the workflow at the point where the error occurs. This can help identify any discrepancies in the data being passed to the
Elsa.FlowDecision
activity.
If you have already tried these steps without success, please provide additional details about the custom activities you are using and how you are passing inputs into the workflow. This information will be crucial to further diagnose and resolve the issue.
This comment was generated by Glime.
Attached is updated workflow saving activity result to workflow variable and using that in decision . When loading the workflow json the variable count shows zero. But workflow json has variables defined. Could this be the reason for error ? @sfmskywalker Please advise.
decision-with-activity-output.json