From 109540b2135ec2cc126ce5be0056bd59d4cdd5b7 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bianchi Date: Wed, 20 Nov 2024 16:04:19 +0100 Subject: [PATCH 1/5] Fixed example file name Signed-off-by: Jean-Baptiste Bianchi --- examples/{raise-inline copy.yaml => raise-inline.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/{raise-inline copy.yaml => raise-inline.yaml} (100%) diff --git a/examples/raise-inline copy.yaml b/examples/raise-inline.yaml similarity index 100% rename from examples/raise-inline copy.yaml rename to examples/raise-inline.yaml From 04ac2386a3a3894248e6035e14cb54b5f69d32d7 Mon Sep 17 00:00:00 2001 From: Matheus Cruz Date: Tue, 26 Nov 2024 11:56:55 -0300 Subject: [PATCH 2/5] Adjust authentication link Signed-off-by: Matheus Cruz --- dsl-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl-reference.md b/dsl-reference.md index 889210a8..2e5445d1 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -1818,7 +1818,7 @@ Describes an enpoint. | Property | Type | Required | Description | |----------|:----:|:--------:|-------------| | uri | `string` | `yes` | The endpoint's URI. | -| authentication | `[authentication](#authentication)` | `no` | The authentication policy to use. | +| authentication | [authentication](#authentication) | `no` | The authentication policy to use. | ### HTTP Response From ad293a217e4be139ec3d01e0c0b1a911d8fce9be Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti Date: Fri, 29 Nov 2024 18:43:43 +0100 Subject: [PATCH 3/5] [Fix_#1036] Add filter error Signed-off-by: Francisco Javier Tirado Sarti --- schema/workflow.yaml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/schema/workflow.yaml b/schema/workflow.yaml index 42456ec6..aecbeacb 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -777,7 +777,10 @@ $defs: errors: type: object title: CatchErrors - description: The configuration of a concept used to catch errors. + properties: + with: + $ref: '#/$defs/errorFilter' + description: static error filter as: type: string title: CatchAs @@ -785,11 +788,11 @@ $defs: when: type: string title: CatchWhen - description: A runtime expression used to determine whether or not to catch the filtered error. + description: A runtime expression used to determine whether to catch the filtered error. exceptWhen: type: string title: CatchExceptWhen - description: A runtime expression used to determine whether or not to catch the filtered error. + description: A runtime expression used to determine whether not to catch the filtered error. retry: oneOf: - $ref: '#/$defs/retryPolicy' @@ -1152,6 +1155,27 @@ $defs: title: ErrorDetails description: A human-readable explanation specific to this occurrence of the error. required: [ type, status ] + errorFilter: + type: object + title: ErrorFilter + description: Error filtering base on static values. For error filtering on dynamic values, use catch.when property + minProperties: 1 + properties: + type: + type: string + description: if present, means this value should be used for filtering + status: + type: integer + description: if present, means this value should be used for filtering + instance: + type: string + description: if present, means this value should be used for filtering + title: + type: string + description: if present, means this value should be used for filtering + details: + type: string + description: if present, means this value should be used for filtering uriTemplate: title: UriTemplate anyOf: From 5a6d8474c3b2bb9aa8bc17dd0da943565d4c9e02 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti Date: Mon, 2 Dec 2024 16:13:23 +0100 Subject: [PATCH 4/5] [Fix #1037] Aligning examples errors with spec Signed-off-by: Francisco Javier Tirado Sarti --- examples/try-catch-retry-inline.yaml | 2 +- examples/try-catch-retry-reusable.yaml | 2 +- examples/try-catch-then.yaml | 2 +- examples/try-catch.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/try-catch-retry-inline.yaml b/examples/try-catch-retry-inline.yaml index 5e65bf70..3712f6f4 100644 --- a/examples/try-catch-retry-inline.yaml +++ b/examples/try-catch-retry-inline.yaml @@ -14,7 +14,7 @@ do: catch: errors: with: - type: https://serverlessworkflow.io.io/dsl/errors/types/communication + type: https://serverlessworkflow.io/spec/1.0.0/errors/communication status: 503 retry: delay: diff --git a/examples/try-catch-retry-reusable.yaml b/examples/try-catch-retry-reusable.yaml index bf7912d4..4f919d24 100644 --- a/examples/try-catch-retry-reusable.yaml +++ b/examples/try-catch-retry-reusable.yaml @@ -24,7 +24,7 @@ do: catch: errors: with: - type: https://serverlessworkflow.io.io/dsl/errors/types/communication + type: https://serverlessworkflow.io/spec/1.0.0/errors/communication status: 503 retry: default \ No newline at end of file diff --git a/examples/try-catch-then.yaml b/examples/try-catch-then.yaml index b157e642..db33f2b6 100644 --- a/examples/try-catch-then.yaml +++ b/examples/try-catch-then.yaml @@ -14,7 +14,7 @@ do: catch: errors: with: - type: https://serverlessworkflow.io.io/dsl/errors/types/communication + type: https://serverlessworkflow.io/spec/1.0.0/errors/communication status: 404 as: error do: diff --git a/examples/try-catch.yaml b/examples/try-catch.yaml index 48b903db..8294433c 100644 --- a/examples/try-catch.yaml +++ b/examples/try-catch.yaml @@ -14,5 +14,5 @@ do: catch: errors: with: - type: https://serverlessworkflow.io.io/dsl/errors/types/communication + type: https://serverlessworkflow.io/spec/1.0.0/errors/communication status: 404 \ No newline at end of file From b5f0663560a635aa1552344d4b4897d45be87454 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti Date: Mon, 16 Dec 2024 17:49:42 +0100 Subject: [PATCH 5/5] [Fix #1040] Set behaviour clarification Signed-off-by: Francisco Javier Tirado Sarti --- dsl-reference.md | 2 +- dsl.md | 2 +- examples/switch-then-string.yaml | 34 ++++++++++---------------------- 3 files changed, 12 insertions(+), 26 deletions(-) diff --git a/dsl-reference.md b/dsl-reference.md index 2e5445d1..92b02d60 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -243,7 +243,7 @@ The Serverless Workflow DSL defines a list of [tasks](#task) that **must be** su - [Raise](#raise), used to raise an [error](#error) and potentially fault the [workflow](#workflow). - [Run](#run), used to run a [container](#container-process), a [script](#script-process) , a [shell](#shell-process) command or even another [workflow](#workflow-process). - [Switch](#switch), used to dynamically select and execute one of multiple alternative paths based on specified conditions -- [Set](#set), used to dynamically set or update the [workflow](#workflow)'s data during the its execution. +- [Set](#set), used to dynamically set the [workflow](#workflow)'s data during the its execution. - [Try](#try), used to attempt executing a specified [task](#task), and to handle any resulting [errors](#error) gracefully, allowing the [workflow](#workflow) to continue without interruption. - [Wait](#wait), used to pause or wait for a specified duration before proceeding to the next task. diff --git a/dsl.md b/dsl.md index f16a283b..81b4ed4c 100644 --- a/dsl.md +++ b/dsl.md @@ -131,7 +131,7 @@ The Serverless Workflow DSL defines several default [task](dsl-reference.md#task - [Listen](dsl-reference.md#listen), used to listen for an [event](dsl-reference.md#event) or more. - [Raise](dsl-reference.md#raise), used to raise an [error](dsl-reference.md#error) and potentially fault the [workflow](dsl-reference.md#workflow). - [Run](dsl-reference.md#run), used to run a [container](dsl-reference.md#container-process), a [script](dsl-reference.md#script-process), a [shell](dsl-reference.md#shell-process) command or even another [workflow](dsl-reference.md#workflow-process). -- [Set](dsl-reference.md#set), used to dynamically set or update the [workflow](dsl-reference.md#workflow)'s data during the its execution. +- [Set](dsl-reference.md#set), used to dynamically set the [workflow](dsl-reference.md#workflow)'s data during the its execution. - [Switch](dsl-reference.md#switch), used to dynamically select and execute one of multiple alternative paths based on specified conditions - [Try](dsl-reference.md#try), used to attempt executing a specified [task](dsl-reference.md#task), and to handle any resulting [errors](dsl-reference.md#error) gracefully, allowing the [workflow](dsl-reference.md#workflow) to continue without interruption. - [Wait](dsl-reference.md#wait), used to pause or wait for a specified duration before proceeding to the next task. diff --git a/examples/switch-then-string.yaml b/examples/switch-then-string.yaml index d9891a4d..d46882c4 100644 --- a/examples/switch-then-string.yaml +++ b/examples/switch-then-string.yaml @@ -15,31 +15,17 @@ do: - default: then: handleUnknownOrderType - processElectronicOrder: - do: - - validatePayment: - set: - validate: true - - fulfillOrder: - set: - status: fulfilled + set: + validate: true + status: fulfilled then: exit - processPhysicalOrder: - do: - - checkInventory: - set: - inventory: clear - - packItems: - set: - items: 1 - - scheduleShipping: - set: - address: Elmer St + set: + inventory: clear + items: 1 + address: Elmer St then: exit - handleUnknownOrderType: - do: - - logWarning: - set: - log: warn - - notifyAdmin: - set: - message: something's wrong + set: + log: warn + message: something's wrong \ No newline at end of file