---
# [샘플] 루프(while) + 멀티케이스(switch)

property:
  workspace: /path/to/project
  retryCount: 0
  maxRetry: 3
  status: pending

pipeline:
  id: main
  workflow:
  # while: 조건이 참인 동안 반복
  - while:
      condition-int: <!property.retryCount> < <!property.maxRetry>
      on-do:
      - exe: check-status
      - exe: mark-retry-complete

  # switch: 값에 따라 분기
  - switch:
      condition-string: <!property.status>
      cases:
      - value: success
        tasks:
        - exe: notify-success
      - value: failed
        tasks:
        - exe: notify-fail
      - value: pending
        tasks:
        - exe: notify-pending

  # wait-until: 비동기 작업 완료 대기
  # - async: long-running-task
  # - wait-until-string: <!state.long-running-task> != complete

  # wait-until-seconds: N초 단순 대기
  # - wait-until-seconds: 30

commands:
- command: Print
  id: check-status
  param:
    message: "상태 확인 중... (시도: <!property.retryCount>)"

- command: SetValue
  id: mark-retry-complete
  param:
    values-int:
      retryCount: 3

- command: Print
  id: notify-success
  param:
    message: "성공"

- command: Print
  id: notify-fail
  param:
    message: "실패"

- command: Print
  id: notify-pending
  param:
    message: "대기중"
