Replies: 1 comment
-
When you define a workflow using the visual designer and export it as a JSON file, the memory references for activity inputs and outputs are indeed managed internally by Elsa. When you load and execute the workflow from a JSON file programmatically, Elsa should handle these references automatically, as long as the JSON is correctly formatted and the workflow definition is valid. In the example you provided, the If you encounter an error stating that a memory reference doesn't exist, it could be due to several reasons:
To troubleshoot this issue, you can:
If you continue to face issues, please provide the complete JSON workflow definition, including the variable definitions and any other relevant parts, so that I can assist you further. This comment was generated by Glime. |
Beta Was this translation helpful? Give feedback.
-
This is in reference to discussion #5300
Understand that memory reference is an internal mechanism used Elsa to track activity inputs and outputs and defining workflow through designer handles the reference internally .
If the workflow is defined thorough visual designer and saved as JSON file . Application loads the JSON file and executes the workflow through code , how is references handled ? In example below WriteLine uses output of previous activity set in variable as input
using expressions . When JSON is exported , there is no memory reference for input 'text'. It only has expression. This will fail when JSON workflow file is loaded and executed from code with memory reference doesn`t exist error. Manually setting a unique memory reference id is also not working .
What is the right way to use previous activity output when loading workflows from JSON file and running workflow from code.
{
"text": {
"typeName": "String",
"expression": {
"type": "JavaScript",
"value": "Nice to meet you, ${getName()}!"
}
},
"id": "WriteLine2",
"type": "Elsa.WriteLine"
}
Beta Was this translation helpful? Give feedback.
All reactions