-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathstatemachine.json
45 lines (45 loc) · 1.29 KB
/
statemachine.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
"Comment": "A state machine showcasing the use of MongoDB Atlas to notify a user by text message or email depending on the number of returned restaurants",
"StartAt": "GetRestaurants",
"States": {
"GetRestaurants": {
"Type": "Task",
"Resource": "",
"ResultPath": "$.restaurants",
"Next": "CountItems"
},
"CountItems": {
"Type": "Task",
"Resource": "",
"InputPath": "$.restaurants",
"ResultPath": "$.count",
"Next": "NotificationMethodChoice"
},
"NotificationMethodChoice": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.count",
"NumericGreaterThan": 1,
"Next": "SendByEmail"
},
{
"Variable": "$.count",
"NumericLessThanEquals": 1,
"Next": "SendBySMS"
}
],
"Default": "SendByEmail"
},
"SendByEmail": {
"Type": "Task",
"Resource": "",
"End": true
},
"SendBySMS": {
"Type": "Task",
"Resource": "",
"End": true
}
}
}