-
Notifications
You must be signed in to change notification settings - Fork 0
/
processing_logic.txt
60 lines (47 loc) · 1.58 KB
/
processing_logic.txt
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Logic
1. Check that tweeter is not me (nuotl) => (tweeter_name != NUOTL)
Pass: CONTINUE
Fail: END
2. Check that tweeter is approved => (approved == Y)
Pass: (add tweeter) CONTINUE
Fail: (add tweeter) (add message "Unapproved") END
3. Parse tweet => (event != nil)
Pass: (add event) CONTINUE
Fail: (add message messageFromTweetProcessor) END
4. Check that tweeter has a url => (url != nil)
Pass: CONTINUE
Fail: (add message "Need a URL")
END:
- Persist tweeter if exists
- Persist tweet if exists
- Reply with message if exists
actions just pump through output
checkers return output along with boolean to indicate whether or not to continue in process
(logic
[
{ :validate is-me? }
{:action parse-tweeter :validate is-approved? }
{:action parse-tweet :validate parsed-successfully? }
{ :validate url-present? }
{:action clean-up-urls }
]
)
(validate [input output]
{:input input :output output :success true :message "Meh meh meh"})
(action [input output]
{:input input :output output :message "blah blah blah"})
3.1 Check that tweet has enough tokens
Pass: CONTINUE
Fail: (add message "Too short") END
3.2 Parse date
Pass: (add date to event) CONTINUE
Fail: (clear event) (add message "Date error") END
3.3 Parse time
Pass: (add time to event) CONTINUE
Fail: (clear event) (add message "Time error") END
3.4 Parse duration
Pass: (add duration to event) CONTINUE
Fail: (clear event) (add message "Duration error") END
3.5 Parse area
Pass: (add area to event) CONTINUE
Fail: (clear event) (add message "Area error") END