File tree Expand file tree Collapse file tree 3 files changed +50
-31
lines changed Expand file tree Collapse file tree 3 files changed +50
-31
lines changed Original file line number Diff line number Diff line change 17
17
{
18
18
"name" : " store-patient" ,
19
19
"functionRef" : " store-patient" ,
20
- "retryRef" : " services-not-available-retry-strategy" ,
21
- "retryableErrors" : [
22
- " service-not-available"
23
- ]
20
+ "onErrors" : " fault-tolerance"
24
21
},
25
22
{
26
23
"name" : " assign-doctor" ,
27
24
"functionRef" : " assign-doctor" ,
28
- "retryRef" : " services-not-available-retry-strategy" ,
29
- "retryableErrors" : [
30
- " service-not-available"
31
- ]
25
+ "onErrors" : " fault-tolerance"
32
26
},
33
27
{
34
28
"name" : " schedule-appt" ,
35
29
"functionRef" : " schedule-appt" ,
36
- "retryRef" : " services-not-available-retry-strategy" ,
37
- "retryableErrors" : [
38
- " service-not-available"
39
- ]
30
+ "onErrors" : " fault-tolerance"
40
31
}
41
32
]
42
33
}
43
34
],
44
- "onErrors" : [
45
- {
46
- "errorRef" : " service-not-available" ,
47
- "end" : true
48
- }
49
- ],
50
35
"end" : true
51
36
}
52
37
],
71
56
"operation" : " api/services.json#scheduleAppointment"
72
57
}
73
58
],
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
+ },
80
82
"retries" : [
81
83
{
82
84
"name" : " services-not-available-retry-strategy" ,
Original file line number Diff line number Diff line change 4
4
"description" : " Customer Banking Transactions Workflow" ,
5
5
"version" : " 1.0.0" ,
6
6
"specVersion" : " 0.8" ,
7
- "autoRetries" : true ,
8
7
"constants" : {
9
8
"largetxamount" : 5000
10
9
},
Original file line number Diff line number Diff line change 44
44
"transition" : " apply-order" ,
45
45
"onErrors" : [
46
46
{
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
+ }
49
55
},
50
56
{
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
+ }
53
65
},
54
66
{
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
+ }
57
75
}
58
76
]
59
77
},
You can’t perform that action at this time.
0 commit comments