StackStorm/st2

core.ask not working with join?

elwood218 opened this issue · 0 comments

SUMMARY

Does core.ask work with join?

STACKSTORM VERSION

Paste the output of st2 --version:
st2 3.8.1, on Python 3.8.10

OS, environment, install method

VM Ubuntu 20.04

Steps to reproduce the problem

version: 1.0

description: Test approval.

vars:
  - count_approve: 0
  - count_reject: 0

tasks:
  start:
    action: core.echo message="Approval started."
    next:
      - when: <% succeeded() %>
        do:
          - ask_1
          - ask_2
          - ask_3

  ask_1:
    action: core.ask
    input:
      users:
        - cab_user1
      ttl: 10
      route: "cab_user1"
      schema:
        type: object
        properties:
          approved:
            type: boolean
            description: "Apply?"
            required: True
    next:
      - when: <% succeeded() %>
        publish:
          - count_approve: "{{ count_approve + 1 }}"
        do:
          - finish
      - when: <% failed() %>
        do: stop

  ask_2:
    action: core.ask
    input:
      users:
        - cab_user1
      ttl: 10
      route: "cab_user1"
      schema:
        type: object
        properties:
          approved:
            type: boolean
            description: "Apply?"
            required: True
    next:
      - when: <% succeeded() %> or <% ctx().count_approve %> = 
        do: finish
      - when: <% failed() %>
        do: stop

  ask_3:
    action: core.ask

    input:
      users:
        - cab_user1
      ttl: 10
      route: "cab_user1"
      schema:
        type: object
        properties:
          approved:
            type: boolean
            description: "Apply?"
            required: True
    next:
      - when: <% succeeded() %>
        do: finish
      - when: <% failed() %>
        do: stop

  finish:
    join: 2
    action: core.echo message="Approved! (<% ctx().count_approve %>)"

  stop:
    join: 2
    action: core.echo message="Rejected!"
    next:
      - do: fail

Expected Results

If 2 core.ask tasks are applied/rejected the others should be ignored.

Actual Results

Only if TTL is reached or all inquiries are answered the workflow will continue.