-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRuleBase.xml
More file actions
79 lines (79 loc) · 2.77 KB
/
RuleBase.xml
File metadata and controls
79 lines (79 loc) · 2.77 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RuleBase>
<Rule>
<Action>
<action_type>query</action_type>
<method_path>none</method_path>
<queries>
<query>update train set number_of_compartment = number_of_compartment+1, remaining_seats = remaining_seats+10 where id=?</query>
</queries>
</Action>
<Event>
<conditions>
<condition>
<attribute>remaining_seats</attribute>
<operator><=</operator>
<value>5</value>
</condition>
<conjunction>none</conjunction>
</conditions>
<event_type>select</event_type>
</Event>
<ruleId>0</ruleId>
<rule_description>Adding extra compartments (seats) on demand</rule_description>
<rule_status>Active</rule_status>
<rule_type>deferred</rule_type>
<table>train</table>
</Rule>
<Rule>
<Action>
<action_type>query</action_type>
<queries>
<query>insert into train_history values(?,?,?,?,?,?,?,?,?)</query>
</queries>
<queries>
<query>insert into train values(0,0,50,DATE_ADD(?, INTERVAL 7 DAY),?,5,?,?,?)</query>
</queries>
<queries>
<query>delete from train where id=?</query>
</queries>
</Action>
<Event>
<conditions>
<condition>
<attribute>date(date)</attribute>
<operator><</operator>
<value>CURRENT_DATE</value>
</condition>
</conditions>
<event_type>select</event_type>
</Event>
<ruleId>2</ruleId>
<rule_description>Moving previous trains to train history table</rule_description>
<rule_status>Active</rule_status>
<rule_type>deferred</rule_type>
<table>train</table>
</Rule>
<Rule>
<Action>
<action_type>method</action_type>
<method_path>sendmail pwdchange</method_path>
</Action>
<Event>
<conditions>
<condition>
<attribute>CURRENT_DATE-date(pswd_last_changed)</attribute>
<operator>>=</operator>
<value>30</value>
</condition>
<conjunction>none</conjunction>
</conditions>
<event_type>select</event_type>
</Event>
<ruleId>1</ruleId>
<rule_description>send mail for password change</rule_description>
<rule_status>Active</rule_status>
<rule_type>deferred</rule_type>
<table>user</table>
</Rule>
</RuleBase>