Defines a pluggable strategy for calculating how many recognition points a participant earns towards a RecognitionAward. Implementations are registered with RecognitionManager and looked up by their id, which is stored against a BaseRecognition or RecognitionLevel as its pointsRuleTypeId. An admin selects a rule type by its title and configures it through the ExtraField definitions it exposes; the resulting parameter values are stored as an encoded string and passed back to calcPoints on each calculation. Built-in implementations include MultiplierRecognitionPointsRuleType, and apps can add their own logic without Java code via JsRecognitionPointsRuleType.


Properties

PropertyReturnsDescription
fieldsList<ExtraField>The configurable parameters an admin fills in when selecting this rule type, rendered as form fields and stored as the encoded ruleParams string passed back into calcPoints and buildDescription.
idStringUnique identifier for this rule type, stored as the pointsRuleTypeId on a recognition or level and used to look the rule type up again via RecognitionManager.findRecognitionPointsRuleType.
titleStringDisplay title for this rule type, shown to an admin choosing a points rule from the available types.

Methods

getId()

Returns: String

Unique identifier for this rule type, stored as the pointsRuleTypeId on a recognition or level and used to look the rule type up again via RecognitionManager.findRecognitionPointsRuleType.

getTitle()

Returns: String

Display title for this rule type, shown to an admin choosing a points rule from the available types.

buildDescription(Map<String,String> ruleParams)

Returns: String

Builds a short human-readable summary of the given configuration, formatted as "key=value; " pairs for each non-blank parameter, or "No configuration" if there are no parameters set. Used to show an admin what a configured rule does without opening its edit form.

ParameterDescription
ruleParamsthe configured parameter values for this rule type, may be null or empty

getFields()

Returns: List<ExtraField>

The configurable parameters an admin fills in when selecting this rule type, rendered as form fields and stored as the encoded ruleParams string passed back into calcPoints and buildDescription.

parseParamStringToMap(BaseRecognition recog)

Returns: Map<String,String>

Convenience method that decodes the given recognition's stored pointsRuleConfig string into the parameter map expected by calcPoints and buildDescription.

ParameterDescription
recogthe recognition whose points rule configuration is decoded
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.