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

Elsa.WriteLine expression and memory reference #5302

Open
mremadevi opened this issue Apr 29, 2024 Discussed in #5301 · 1 comment
Open

Elsa.WriteLine expression and memory reference #5302

mremadevi opened this issue Apr 29, 2024 Discussed in #5301 · 1 comment

Comments

@mremadevi
Copy link

Discussed in #5301

This seems to be a bug , I am using Elsa 3.1.3 libraries and Elsa Studio 3.2 . Attached JSON file when loaded through code and run memory reference is not handled correctly.
issue-test.json

Originally posted by mremadevi April 29, 2024
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"
}

Copy link

glime-ai bot commented Apr 29, 2024

Based on the context provided, it seems that you are encountering an issue with memory references when loading workflows from a JSON file and executing them through code. The memory reference is indeed an internal mechanism used by Elsa to track activity inputs and outputs. When you define a workflow through the visual designer and export it to a JSON file, the memory references should be handled automatically by Elsa.

However, if you are experiencing issues with memory references not being recognized when loading the JSON workflow file and executing it from code, it could be due to a mismatch between the version of Elsa Studio used to create the workflow and the version of the Elsa libraries used to execute the workflow. It's important to ensure that the versions are compatible.

To address the issue, you should:

  1. Ensure that the versions of Elsa Studio and the Elsa libraries you are using are compatible.
  2. Verify that the JSON file is correctly formatted and contains all necessary information, including memory references.
  3. If you are manually editing the JSON file, ensure that the memory references are unique and correctly mapped to the corresponding activities.

If the problem persists, it may be a bug, and you should consider reporting it to the Elsa GitHub repository or seeking further assistance from the Elsa community.

For more detailed guidance on how to use previous activity outputs when loading workflows from JSON files, you can refer to the Elsa documentation or seek help from the community forums or GitHub discussions.

This comment was generated by Glime.

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

No branches or pull requests

1 participant