diff --git a/examples/switch-then-string.yaml b/examples/switch-then-string.yaml new file mode 100644 index 00000000..7db53745 --- /dev/null +++ b/examples/switch-then-string.yaml @@ -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 \ No newline at end of file diff --git a/schema/workflow.yaml b/schema/workflow.yaml index 018fdb2e..bd6b1b9e 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -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: