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

Fix #862 - Switch 'then' must accept free strings #863

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions examples/switch-then-string.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
document:
dsl: '1.0.0-alpha1'
namespace: test
name: sample-workflow
version: '0.1.0'
do:
processOrder:
switch:
case1:
when: .orderType == "electronic"
then: processElectronicOrder
case2:
when: .orderType == "physical"
then: processPhysicalOrder
default:
then: handleUnknownOrderType
processElectronicOrder:
execute:
sequentially:
validatePayment:
set:
validate: true
fulfillOrder:
set:
status: fulfilled
then: exit
processPhysicalOrder:
execute:
sequentially:
checkInventory:
set:
inventory: clear
packItems:
set:
items: 1
scheduleShipping:
set:
address: Elmer St
then: exit
handleUnknownOrderType:
execute:
sequentially:
logWarning:
set:
log: warn
notifyAdmin:
set:
message: something's wrong
9 changes: 6 additions & 3 deletions schema/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,12 @@ $defs:
required: [ emit ]
description: Allows workflows to publish events to event brokers or messaging systems, facilitating communication and coordination between different components and services.
flowDirective:
type: string
enum: [ continue, exit, end ]
default: continue
additionalProperties: false
anyOf:
- type: string
enum: [ continue, exit, end ]
default: continue
- type: string
forTask:
properties:
for:
Expand Down
Loading