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

core.ask not working with join? #6213

Open
elwood218 opened this issue Jun 16, 2024 · 0 comments
Open

core.ask not working with join? #6213

elwood218 opened this issue Jun 16, 2024 · 0 comments

Comments

@elwood218
Copy link

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.

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