Closed buddhika-ranasinghe closed 3 years ago
You cannot publish to JSONPaths like you are attempting to do. In other words, as far as I am aware, this mechanism is not supported:
tasks:
...
task_name:
action: ...
next :
- when: ...
publish:
- todo_details.title : "Hello World Title - Changed Once"
# ^^^^^^ - won't work
do: ...
What that will do is publish to a variable named todo_details.title
, it will not update the dictionary.
To update a single dictionary key, you will need to use YAQL to set the key, and then publish the entire dictionary back to the dictionary variable name that you want to update. Something like this:
tasks:
...
task_name:
action: ...
next :
- when: ...
publish:
- todo_details : <% ctx().todo_details.set("title", "Hello World Title - Changed Once") %>
do: ...
Since you're not the first person to have this question, I have updated the Orquesta Implementation Patterns page in this project's wiki. Hopefully that makes the solution slightly more discoverable for users.
I'm going to close this issue, but if it doesn't work, or if you still need help, feel free to drop a comment and I'll be happy to reopen it.
SUMMARY
I am trying to update a variable in a map which is populated by publishing the result of a core.http action. It remains still the same even though I updated the title value by publishing the value to map again. Please see the workflow I have created to simulate the same problem.
STACKSTORM VERSION
st2 3.3.0, on Python 3.6.9
OS, environment, install method
Post what OS you are running this on, along with any other relevant information/
Docker | Host OS : Windows 10
Steps to reproduce the problem
Please see my workflow.
Expected Results
Actual Results
Thanks!