Skip to content

Commit

Permalink
Merge pull request #863 from ricardozanini/issue-862
Browse files Browse the repository at this point in the history
Fix #862 - Switch 'then' must accept free strings
  • Loading branch information
cdavernas authored May 29, 2024
2 parents d94c7d6 + d75f692 commit e4cd93f
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 3 deletions.
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

0 comments on commit e4cd93f

Please sign in to comment.