콘텐츠로 이동
Developer Preview — APIs and language features may change before 1.0

behaves

이 콘텐츠는 아직 번역되지 않았습니다.

Section: the machine’s behavior — the steps it executes

  • en: behaves
  • de: verhält sich / verhaelt sich
  • es: se comporta / comporta
  • fr: se comporte / comporte
  • ja: 振る舞い / 振る舞う
  • ko: 동작
  • zh: 行为

Checks an order total and decides whether it needs a human to look at it.

machine order_check
accepts
total as number, is required
responds with
approved as boolean
reason as text
behaves
decide review
when input.total > 1000
{approved: false, reason: "needs review"}
otherwise
{approved: true, reason: "auto approved"}
verifies
test "large orders need review"
given {total: 5000}
expect {approved: false}