Hi Can we handle timeout action within the workflow by rerunning timeout action by calling action with
the attribute “do” in st2 v3.1.0.
I am using below code
version: 1.0
vars:
- ActionReTry: 0
- MaxActionReTry: 1
tasks:
task1:
action: core.local
input:
cmd: ping 127.2.14.34
timeout: 10
next:
- when: <% result().return_code=-9 and ctx(ActionReTry)=0%>
publish:
- data2: "Yes"
- ActioncountStr: "{% set count = ctx('ActionReTry')+1 %}{{count}}"
- ActionReTry: "{{ ctx('ActioncountStr') | int }}"
do:
- task1
- when: <% result().return_code=-9 and ctx(ActionReTry) = ctx(MaxActionReTry) %>
publish:
- data2: "Reached Max and timedout"
do:
- task3
task3:
action: core.echo
input:
message: 'stop'
In this case it is not taking task1 to run when the condition satisfied.
the same logic is working if I add a another action before task1 and make the present task1 as task2 it
is working for rerunning the action when action get timeout i.e by using attribute “do” I am able to run
from task2 but can’t able to run as task1 don’t know why that is happening. May I know why is that
behaviour?
Thanks in advance