Skip to main content

CompetitionLabs Academy

Step 6: Achievement rules

Step 6: Achievement rules

Achievement rules is where you define the fulfillment conditions of an Achievement. See an example of the CompetitionLabs rules system below.

RULES

EXAMPLES

The screenshot below shows a rule set. A ruleset contains:

  1. Main rule
  2. Sub rule

Step 6: Achievement rules

Sub-rules are optional and depend on the rule.

Each rule consists of:

  1. fact
  2. operator
  3. constant

Step 6: Achievement rules

Each rule has properties, e.g. conditional match of All or Any, and evaluation criteria of True or False.

Step 6: Achievement rulesStep 6: Achievement rules

All or Any match conditions describe how rules interact. If the conditional match is set to All, then all rules are used to evaluate; if it is set to Any, then only one rule is used to evaluate. The first that matches all conditions will be triggered. This works on the principle of And / Or. By clicking And, you add conditions that extend the rule.

A more detailed rules explanation can be found in Competitions and Contests -> Rules guide or you can navigate directly to our Rules guide here

Example: This Achievement rule example contains sub-rules. A sub-rule has the same properties as a rule – it contains conditional matching, evaluation criteria and rules. The only exception is that sub-rules cannot have other sub-rules.

API Rules Example:

}
"ruleSets": [
    {
        "jsonClass": "RuleSet",
        "priority": 1,
        "scope": "achievement",
        "action": "member.achievement",
        "conditions": [
            {
                "jsonClass": "MainConditionSet",
                "matchCondition": "All",
                "mustEvaluateTo": true,
                "rules": [
                    {
                        "jsonClass": "MainRule",
                        "fact": "event.count",
                        "operator": ">=",
                        "constant": "5",
                        "subConditions": [
                            {
                                "jsonClass": "SubConditionSet",
                                "matchCondition": "All",
                                "mustEvaluateTo": true,
                                "subRules": [
                                    {
                                        "jsonClass": "SubRule",
                                        "fact": "event.action.type",
                                        "operator": "==",
                                        "constant": "bet"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }
}]

The API example provides only a simplified version of the POST Rules body. A full example of POST Achievement can be found in the Achievements Rules APP API documentation here.

Rules section action icon buttons

You can use the icons provided:

  • Step 6: Achievement rulesRemove – removes the rule and any sub-conditions.
  • Step 6: Achievement rules – Add – lets you add a sub-rule or main rule in parallel to the one you are creating.
  • Step 6: Achievement rules – Edit – lets you edit text or numerical values.
  • Step 6: Achievement rules  – Remove rule set – removes all the rules in the ruleset.

PREVIOUS – Click Previous and go back to the previous step.

CONTINUE – Click Next to proceed to the next step.

Cookie Settings

We use cookies to keep the site working, understand usage, and improve relevance. Read our Cookie Policy and Privacy Policy.