Condition and ConsRepo
Last updated
Last updated
Condition Object is a data structure specially used for comparison and boolean operation. It can store up to 3 comparison parameters and compare 3 sets of data simultaneously, and then perform boolean operation on the comparison results in accordance with the predefined logic, so as to realize and check the complex triggering conditions.
The main members of the conditions repo are the comparison objects and the Comparison mapping which with the structure of "Number -> Comparison Objects".
seqOfCond
Condition object number.
logicOpr
Logical operator (see below).
compOpr1
Comparison operator-1 (see below).
para1
Comparison parameter-1.
compOpr2
Comparison operator-2.
para2
Comparison parameter-2.
compOpr3
Comparison operator-3.
para3
Comparison parameter-3.
Value Meaning of Logical Operator Attribute
1
And๏ผa && b๏ผ
2
Or๏ผa || b๏ผ
3
Equal to๏ผa == b๏ผ
4
Unequal to๏ผa != b๏ผ
5
And twice๏ผ a && b && c ๏ผ
6
Or twice๏ผa || b || c๏ผ
7
And & Or๏ผa && b || c๏ผ
8
Or & And๏ผa || b && c๏ผ
9
Equal to twice๏ผa == b == c๏ผ
10
Unequal to twice๏ผa != b != c๏ผ
11
Equal to & Unequal to๏ผa == b != c๏ผ
12
Unequal toใEqual to๏ผa != b == c๏ผ
13
And & Equal to๏ผa && b == c๏ผ
14
Equal to & And๏ผa == b && c๏ผ
15
Or & Equal to๏ผa || b == c๏ผ
16
Equal to & Or๏ผa == b || c๏ผ
17
Or& Unequal to๏ผa && b != c๏ผ
18
Unequal to & Or๏ผa != b && c๏ผ
19
Or & Unequal to๏ผa || b != c๏ผ
20
Unequal to & Or๏ผa != b || c๏ผ
Value Meaning of Comparison Operator Attribute
1
Equal to ๏ผa == b๏ผ
2
Unequal to (a != b)
3
More (a > b)
4
Less๏ผa < b๏ผ
5
More & Equal to๏ผa >= b๏ผ
6
Less& Equal to๏ผa <= b๏ผ
The query API well describes the function and usage of the Conditions repo in the whole system, as shown in the table below.
counterOfConds
Get the current value of the condition object counter.
getConds
Get a list of all condition objects.
checkCond
Query whether the input data satisfies a comparison condition consisting of a specific comparison operator (compOpr) and a comparison threshold (para).
checkSoleCond
Query whether the input data (data) satisfies the single comparison operation condition specified in the Condition object (Cond).
checkCondsOfTwo
Query whether the input two data (data1 and data2) satisfy the triggering conditions defined jointly by two comparison operations and Boolean operators specified by the Condition object (Cond).
checkCondsOfThree
Query whether the input three data (data1, data2 and data3) satisfy the triggering condition defined by the condition object (Cond) with the three comparison operations and boolean operators.