LetsFlow
  • Introduction
  • Tutorial
    • The basics
    • A handshake
    • A conversation
    • A proper introduction
    • Group meeting
    • Quote
  • Cookbook
  • ENGINE
    • Installation
    • Authentication
    • API
    • Services
      • Configuration
      • Messaging
        • ZeroMQ
        • AMQP 0-9-1
        • Webhook
      • Engine service
  • Integration
    • Frontend
      • React
      • Angular
      • Vue
      • Svelte
    • Backend
  • Reference
    • Scenario
      • Actor
      • Action
        • Update instruction
      • State
        • Transition
          • Log
        • Notify
      • Data function
    • Schema
    • Process
      • Current state
      • Previous log
      • Prediction
      • Events
        • Instantiate event
        • Action event
        • Timeout event
  • Libraries
    • Core library
    • JMESPath
    • Test suite
      • Given
      • When
      • Then
        • Assert state
        • Assert actor
        • Assert variable
        • Assert service
        • Assert event
      • Customize
  • Advanced topics
    • Deep integration
    • Decentralized workflows
    • Custom JMESPath functions
    • Custom YAML tags
Powered by GitBook
On this page
  • Step
  • Service step
  • Response
  • Timeout

Was this helpful?

  1. Libraries
  2. Test suite

When

When steps are used to describe an action. This can be a actor interacting with the system, or it can be an event triggered by another system.

Step

When "Alice" does "accept"
When "Alice" does "accept" in the "main" process

An actor performs an action in a process. Use the actor's name as defined by the Given statement and the key of the action that is performed. By default, the "main" process is selected.

Service step

When the "verify" service does "approve"
When the "verify" service does "approve" in the "main" process

A service can perform an action rather than an actor. The syntax is similar.

Response

You can use with to specify the response

When "Alice" does "deny" with "Too expensive"

When "Alice" does "deny" with:
   | reason | Too expensive    |
   | email  | alice@example.com |
  
When "Alice" does "deny" with:
   """yaml
     reason: Too expensive
     email: alice@example.com
   """
   
When the "verify" service does "reject" with "Insufficient balance"

If the response expects a string, date, number, or boolean, it can be given inline. You can use a data table, if the response is a simple object with a shallow structure. For arrays and more complex objects, use YAML or JSON.

Timeout

When 10 minutes pass
When 1 hour passes
When 30 minutes pass for the "main" process

Trigger a timeout state change. Specify the period in English. By default, the timeout is applied to all running processes. You can specify which process, if needed.

Note: If there are multiple timeouts, only the first will trigger.

PreviousGivenNextThen

Last updated 23 days ago

Was this helpful?