1
+ {
2
+ "StartAt": "ReadCSV",
3
+ "States": {
4
+ "ReadCSV": {
5
+ "Type": "Task",
6
+ "Resource": "arn:aws:lambda:XXXXXXXXXXXXXXXX:function:lambda-read-CSV",
7
+ "Next": "ProductOrServiceChoice"
8
+ },
9
+ "ProductOrServiceChoice": {
10
+ "Type": "Choice",
11
+ "Choices": [
12
+ {
13
+ "Variable": "$.reviewType",
14
+ "StringEquals": "Product",
15
+ "Next": "ProductSentimentAnalysis"
16
+ },
17
+ {
18
+ "Variable": "$.reviewType",
19
+ "StringEquals": "Service",
20
+ "Next": "ServiceSentimentAnalysis"
21
+ }
22
+ ],
23
+ "Default": "CategorisationFail"
24
+ },
25
+ "CategorisationFail": {
26
+ "Type": "Fail",
27
+ "Cause": "Input CSV could not be categorised into 'Product' or 'Service'."
28
+ },
29
+ "ProductSentimentAnalysis": {
30
+ "Type" : "Task",
31
+ "Resource": "arn:aws:lambda:XXXXXXXXXXXXXXXX:function:lambda-sentiment",
32
+ "Next": "ProductResultChoice"
33
+ },
34
+
35
+ "ServiceSentimentAnalysis": {
36
+ "Type" : "Task",
37
+ "Resource": "arn:aws:lambda:XXXXXXXXXXXXXXXX:function:lambda-sentiment",
38
+ "Next": "ServiceResultChoice"
39
+ },
40
+ "ProductResultChoice": {
41
+ "Type": "Choice",
42
+ "Choices": [
43
+ {
44
+ "Or": [
45
+ {
46
+ "Variable": "$.sentiment",
47
+ "StringEquals": "POSITIVE"
48
+ },
49
+ {
50
+ "Variable": "$.sentiment",
51
+ "StringEquals": "NEUTRAL"
52
+ }
53
+ ],
54
+ "Next": "WriteToDB"
55
+ },
56
+ {
57
+ "Variable": "$.sentiment",
58
+ "StringEquals": "NEGATIVE",
59
+ "Next": "PublishToSNS"
60
+ }
61
+ ],
62
+ "Default": "SentimentFail"
63
+ },
64
+ "SentimentFail": {
65
+ "Type": "Fail",
66
+ "Cause": "Sentiment Analysis Failed!"
67
+ },
68
+ "ServiceResultChoice": {
69
+ "Type": "Choice",
70
+ "Choices": [
71
+ {
72
+ "Or": [
73
+ {
74
+ "Variable": "$.sentiment",
75
+ "StringEquals": "POSITIVE"
76
+ },
77
+ {
78
+ "Variable": "$.sentiment",
79
+ "StringEquals": "NEUTRAL"
80
+ }
81
+ ],
82
+ "Next": "WriteToDB"
83
+ },
84
+ {
85
+ "Variable": "$.sentiment",
86
+ "StringEquals": "NEGATIVE",
87
+ "Next": "PublishToSNS"
88
+ }
89
+ ],
90
+ "Default": "SentimentFail"
91
+ },
92
+ "PublishToSNS":
93
+ {
94
+ "Type": "Task",
95
+ "Resource": "arn:aws:lambda:XXXXXXXXXXXXXXXX:function:lambda-SNS",
96
+ "Next": "WriteToDB"
97
+ },
98
+ "WriteToDB":
99
+ {
100
+ "Type": "Task",
101
+ "Resource": "arn:aws:lambda:XXXXXXXXXXXXXXXX:function:lambda-write-db",
102
+ "Next": "Success"
103
+ },
104
+ "Success":
105
+ {
106
+ "Type": "Succeed"
107
+ }
108
+ }
109
+ }
0 commit comments