You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+72-43Lines changed: 72 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,27 +2,56 @@
2
2
Javascript configurator to match rules on massive number of objects
3
3
4
4
#What is JamRules
5
-
Let's say you have a set of objects with parameters and you'd like to filter them according to a configuration of these parameters and specific rules of choices... then JamRules is for you!
5
+
Let's say you have a set of objects with properties and you'd like to filter them according to a user configuration of these properties and specific rules of choices... then JamRules is for you!
6
6
7
-
JamRules allows you to configure a set of parameters and a set of rules of matching, then test if objects match against the rules and the configuration.
7
+
JamRules allows you to configure a set of parameters and a set of rules of matching, then it will test and select your objects accordingly to your configuration and the defined rules.
8
8
9
9
#Example
10
10
Example:
11
-
* I sell red and white trousers and yellow and blue shirts through different kind of packs of products:
11
+
##my set of objects
12
+
13
+
I sell red and white trousers and yellow and blue shirts through different kind of packs of 2 products:
12
14
* packs of 2 trousers
13
15
* packs with a trouser and shirt
14
16
* packs with two shirts
15
17
* etc...
16
-
* I'll give a promo coupon for packs that
18
+
19
+
For the example, we decide that an object is a "pack" with the following properties:
20
+
* property "object1" that can have the values "trouser" or "shirt"
21
+
* property "object1color" that can have the values "blue" or "yellow" or "white"
22
+
* property "object2" that can have the values "trouser" or "shirt"
23
+
* property "object2color" that can have the values "blue" or "yellow" or "white"
24
+
25
+
##my selection rules of objects
26
+
27
+
I want to give a promo coupon for packs that
17
28
* have two trousers
18
29
* or have a trouser with a shirt
19
30
* nothing if the trousers in the pack are of different colors
20
31
* nothing for the other kind of packs
21
32
33
+
We will translate these rules to have a coupon as following:
34
+
* object1 and object2 have to be a trouser
35
+
* AND
36
+
* object1color has to be different from object2color
37
+
OR
38
+
* object1 has to be a trouser
39
+
* AND
40
+
* object2 has to be a shirt
41
+
OR
42
+
* object1 has to be a shirt
43
+
* AND
44
+
* object2 has to be a trouser
45
+
22
46
Which packs should have a promo code?
23
47
24
48
Jamrules will be able to tell you!
25
-
You configure Jamrules configurator according to one of the pack configurations and run the test.
49
+
* add the objects to test in jamrules
50
+
* configure Jamrules configurator to select some packs, like select the packs that has a white trouser and a blue shirt.
51
+
* run the test:
52
+
* jamrules will tell to the packs that have a white trouser and a blue shirts if they have a coupon.
53
+
* It will tell to the others packs that they don't match the selection or the rules.
54
+
26
55
JamRules will select the packs that match the configuration if it respects the rules in order to give them the promo code.
27
56
28
57
Of course, that's a simple example but you can imagine how rules and kind of packs can become numerous and answers may become quickly hard to give...
@@ -47,9 +76,9 @@ no demo available :-( will come quickly!
0 commit comments