-
Notifications
You must be signed in to change notification settings - Fork 4
Conditions
Express the logic that a rule must fulfill to be considered as done.
operation: (S) points or counter Points will sum the value of the activity while Counter will count the number of activities.
expression: (S) gte or gt or eq or lt or lte The logic to be performed for the operation
value: (I) The total of points or counts needed to complete the condition.
action: (S) The id of the action. Can be blank.
Let's see some examples:
{ operation: :points, expression: :gte, value: 1000 }
This condition will check all activities performed by a user, sum all their values and will return true if the result is 1.000 or more
{ operation: :points, expression: :gte, value: 1000, action: 'xxx' }
Same as before but only for activities with the ID xxx
{ operation: :counter, expression: :gte, value: 63 }
This condition will count the number of activities performed and return true if result is 63 or more.
{ operation: :counter, expression: :gte, value: 63, action: 'xxx' }
Same as before but only for activities with the ID xxx
For a rule to be valid ALL conditions must be true.
You can not query conditions directly but only as part of Rules.