Skip to content

Commit 117eeb0

Browse files
committed
fix(Examples): Fixed invalid examples
Signed-off-by: Charles d'Avernas <[email protected]>
1 parent 9979afd commit 117eeb0

File tree

3 files changed

+50
-31
lines changed

3 files changed

+50
-31
lines changed

examples/new-patient-onboarding.json

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,21 @@
1717
{
1818
"name": "store-patient",
1919
"functionRef": "store-patient",
20-
"retryRef": "services-not-available-retry-strategy",
21-
"retryableErrors": [
22-
"service-not-available"
23-
]
20+
"onErrors": "fault-tolerance"
2421
},
2522
{
2623
"name": "assign-doctor",
2724
"functionRef": "assign-doctor",
28-
"retryRef": "services-not-available-retry-strategy",
29-
"retryableErrors": [
30-
"service-not-available"
31-
]
25+
"onErrors": "fault-tolerance"
3226
},
3327
{
3428
"name": "schedule-appt",
3529
"functionRef": "schedule-appt",
36-
"retryRef": "services-not-available-retry-strategy",
37-
"retryableErrors": [
38-
"service-not-available"
39-
]
30+
"onErrors": "fault-tolerance"
4031
}
4132
]
4233
}
4334
],
44-
"onErrors": [
45-
{
46-
"errorRef": "service-not-available",
47-
"end": true
48-
}
49-
],
5035
"end": true
5136
}
5237
],
@@ -71,12 +56,29 @@
7156
"operation": "api/services.json#scheduleAppointment"
7257
}
7358
],
74-
"errors": [
75-
{
76-
"name": "service-not-available",
77-
"code": "503"
78-
}
79-
],
59+
"errors": {
60+
"handlers":[
61+
{
62+
"name": "handle-503-errors",
63+
"when":[
64+
{
65+
"status": 503
66+
}
67+
],
68+
"retry": "services-not-available-retry-strategy"
69+
}
70+
],
71+
"policies":[
72+
{
73+
"name": "fault-tolerance",
74+
"handlers":[
75+
{
76+
"refName": "handle-503-errors"
77+
}
78+
]
79+
}
80+
]
81+
},
8082
"retries": [
8183
{
8284
"name": "services-not-available-retry-strategy",

examples/process-transactions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "Customer Banking Transactions Workflow",
55
"version": "1.0.0",
66
"specVersion": "0.8",
7-
"autoRetries": true,
87
"constants": {
98
"largetxamount": 5000
109
},

examples/provision-orders.json

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,34 @@
4444
"transition": "apply-order",
4545
"onErrors": [
4646
{
47-
"errorRef": "missing-order-id",
48-
"transition": "missing-id"
47+
"when": [
48+
{
49+
"type": "/samples/errors/missing-order-id"
50+
}
51+
],
52+
"then": {
53+
"transition": "missing-id"
54+
}
4955
},
5056
{
51-
"errorRef": "missing-order-item",
52-
"transition": "missing-item"
57+
"when": [
58+
{
59+
"type": "/samples/errors/missing-order-item"
60+
}
61+
],
62+
"then": {
63+
"transition": "missing-item"
64+
}
5365
},
5466
{
55-
"errorRef": "missing-order-quantity",
56-
"transition": "missing-quantity"
67+
"when": [
68+
{
69+
"type": "/samples/errors/missing-order-quantity"
70+
}
71+
],
72+
"then": {
73+
"transition": "missing-quantity"
74+
}
5775
}
5876
]
5977
},

0 commit comments

Comments
 (0)