A tier a profile can reach on the metric its recognition topic measures, such as Bronze, Silver and Gold. It is one of the recognition types held in the shared recognition table and told apart by its discriminator, so the topic, title, image, colour and points settings come from BaseRecognition. What it adds is the threshold to reach the level, which can be a fixed amount, a named lookup table or a sales data series. Levels sort by that fixed amount, which is what makes one level higher or lower than another.

Group: Database Entities

Extends: BaseRecognition

Implements: Serializable, Comparable


Properties

PropertyReturnsDescription
levelAmountBigDecimalThe threshold on the topic's metric a profile must reach to be given this level. It is also what levels are ranked by, so a level with no amount sorts below every level that has one. Used when no lookup rule matches.
levelLookupNameStringNames the lookup table that decides the threshold for this level, for cases where it varies rather than being a single figure. Where no rule in that table matches, the fixed level amount is used instead. At most 200 characters, and null when no lookup is used.
levelsDataSeriesSalesDataSeriesA sales data series to take the threshold from, tried when one is set. Null where the level uses its lookup table or fixed amount instead.

Inherited from BaseRecognition

Properties

PropertyReturnsDescription
adminDomainOrganisationThe administrative organisation this recognition was defined in. Loaded lazily.
assetIdStringIdentifier of an asset library item linked to this recognition, used as an alternative to an uploaded image. Null when no asset is linked.
colourStringDisplay colour for this badge or level, as entered in the admin UI, typically a CSS colour value. Null when no colour has been chosen.
field1StringFirst general purpose custom field, free text, available for account specific data such as an external code. On a level it can also be read by name through fieldValue.
field2StringSecond general purpose custom field, free text, available for account specific data. On a level it can also be read by name through fieldValue.
field3StringThird general purpose custom field, free text, available for account specific data. On a level it can also be read by name through fieldValue.
idlongThe database identifier of this badge or level.
imageHashStringHash of the badge or level image held in the blob store, used to render the artwork. Null when no image has been uploaded.
nameStringPortable, path-safe identifier for this badge or level, used in URLs and as the lookup key. Distinct from the title, which is only a display label. Never null for a persisted record.
numAwardedLongCounts how many RecognitionAward rows currently exist for this badge or level. This is not a mapped column: it runs a count query against the database on every call, so avoid calling it inside a loop.
numPointsDoubleFixed number of points allocated each time this recognition is awarded. Null when no fixed amount applies, for example when a points rule calculates the amount instead.
pointsBucketRewardThe points bucket, held as a Reward, that points earned from this recognition are credited to. Null when this recognition does not allocate points. Loaded lazily.
pointsExpiryRuleConfigStringConfiguration for the points expiry rule named by the points expiry rule type identifier, stored as XML. Up to 2000 characters, and null when the rule needs no configuration.
pointsExpiryRuleTypeIdStringIdentifier of the PointsExpiryRuleType which decides when points allocated by this recognition expire. Null when the allocated points do not expire.
pointsReasonStringCustom reason text recorded against points allocated by this recognition, shown to the member in their points history. Up to 1000 characters, and null to fall back to the default reason.
pointsRuleConfigStringConfiguration for the points rule named by the points rule type identifier, stored as XML. Up to 2000 characters, and null when the rule needs no configuration.
pointsRuleTypeIdStringIdentifier of the RecognitionPointsRuleType which calculates how many points to allocate when this recognition is awarded. Null when a fixed number of points is used instead.
pointsTagPointsTagOptional tag applied to any points allocated by this recognition, so those points can be reported on separately from other allocations. Null when the points are untagged.
titleStringFree-text display label shown to members, such as Gold or Safety Champion. Carries no uniqueness or path-safety guarantee, unlike the name. Never null for a persisted record.
topicRecognitionTopicThe topic this badge or level belongs to. A topic acts as the folder for a set of recognitions, and for levels it defines the metric the levels are measured on. Never null for a persisted record, and loaded lazily.
typeStringDiscriminator code identifying which kind of recognition this row is: B for a badge, L for a level. The column is mapped read-only, so it is set by Hibernate from the concrete class rather than by application code.

Methods

asLevel() · asBadge() · getId() · getType() · setType(String type) · getAdminDomain() · setAdminDomain(Organisation adminDomain) · getTopic() · setTopic(RecognitionTopic topic) · getPointsTag() · setPointsTag(PointsTag pointsTag) · getPointsReason() · setPointsReason(String pointsReason) · getName() · setName(String name) · getTitle() · setTitle(String title) · getImageHash() · setImageHash(String imageHash) · getColour() · setColour(String colour) · getAssetId() · setAssetId(String assetId) · getField1() · setField1(String field1) · getField2() · setField2(String field2) · getField3() · setField3(String field3) · getPointsBucket() · setPointsBucket(Reward pointsBucket) · getNumPoints() · setNumPoints(Double numPoints) · getPointsRuleTypeId() · setPointsRuleTypeId(String pointsRuleTypeId) · getPointsRuleConfig() · setPointsRuleConfig(String pointsRuleConfig) · getPointsExpiryRuleTypeId() · setPointsExpiryRuleTypeId(String pointsExpiryRuleTypeId) · getPointsExpiryRuleConfig() · setPointsExpiryRuleConfig(String pointsExpiryRuleConfig) · getNumAwarded() · rowId()

asLevel()

Returns: RecognitionLevel

Narrows this recognition to a RecognitionLevel. Returns null when this row is a badge rather than a level, so always check the result before using it.

asBadge()

Returns: RecognitionBadge

Narrows this recognition to a RecognitionBadge. Returns null when this row is a level rather than a badge, so always check the result before using it.

getId()

Returns: long

The database identifier of this badge or level.

getType()

Returns: String

Discriminator code identifying which kind of recognition this row is: B for a badge, L for a level. The column is mapped read-only, so it is set by Hibernate from the concrete class rather than by application code.

setType(String type)

Returns: void

Sets the recognition type code. The underlying column is mapped as neither insertable nor updatable, so the stored value is unaffected.

ParameterDescription
typethe recognition type code to hold in memory

getAdminDomain()

Returns: Organisation

The administrative organisation this recognition was defined in. Loaded lazily.

setAdminDomain(Organisation adminDomain)

Returns: void

Sets the administrative organisation this recognition was defined in.

ParameterDescription
adminDomainthe owning admin organisation

getTopic()

Returns: RecognitionTopic

The topic this badge or level belongs to. A topic acts as the folder for a set of recognitions, and for levels it defines the metric the levels are measured on. Never null for a persisted record, and loaded lazily.

setTopic(RecognitionTopic topic)

Returns: void

Sets the topic this badge or level belongs to.

ParameterDescription
topicthe owning recognition topic

getPointsTag()

Returns: PointsTag

Optional tag applied to any points allocated by this recognition, so those points can be reported on separately from other allocations. Null when the points are untagged.

setPointsTag(PointsTag pointsTag)

Returns: void

Sets the tag applied to points allocated by this recognition.

ParameterDescription
pointsTagthe points tag to apply, or null for none

getPointsReason()

Returns: String

Custom reason text recorded against points allocated by this recognition, shown to the member in their points history. Up to 1000 characters, and null to fall back to the default reason.

setPointsReason(String pointsReason)

Returns: void

Sets the custom reason text recorded against points allocated by this recognition.

ParameterDescription
pointsReasonthe custom points reason, up to 1000 characters

getName()

Returns: String

Portable, path-safe identifier for this badge or level, used in URLs and as the lookup key. Distinct from the title, which is only a display label. Never null for a persisted record.

setName(String name)

Returns: void

Sets the portable, path-safe identifier for this badge or level.

ParameterDescription
namethe recognition's name, which must not be null

getTitle()

Returns: String

Free-text display label shown to members, such as Gold or Safety Champion. Carries no uniqueness or path-safety guarantee, unlike the name. Never null for a persisted record.

setTitle(String title)

Returns: void

Sets the free-text display label shown to members.

ParameterDescription
titlethe recognition's display title, which must not be null

getImageHash()

Returns: String

Hash of the badge or level image held in the blob store, used to render the artwork. Null when no image has been uploaded.

setImageHash(String imageHash)

Returns: void

Sets the blob hash of the badge or level image.

ParameterDescription
imageHashthe blob hash of the image, or null for none

getColour()

Returns: String

Display colour for this badge or level, as entered in the admin UI, typically a CSS colour value. Null when no colour has been chosen.

setColour(String colour)

Returns: void

Sets the display colour for this badge or level.

ParameterDescription
colourthe display colour, or null for none

getAssetId()

Returns: String

Identifier of an asset library item linked to this recognition, used as an alternative to an uploaded image. Null when no asset is linked.

setAssetId(String assetId)

Returns: void

Sets the identifier of the asset library item linked to this recognition.

ParameterDescription
assetIdthe linked asset identifier, or null for none

getField1()

Returns: String

First general purpose custom field, free text, available for account specific data such as an external code. On a level it can also be read by name through fieldValue.

setField1(String field1)

Returns: void

Sets the first general purpose custom field.

ParameterDescription
field1the value to store in custom field 1

getField2()

Returns: String

Second general purpose custom field, free text, available for account specific data. On a level it can also be read by name through fieldValue.

setField2(String field2)

Returns: void

Sets the second general purpose custom field.

ParameterDescription
field2the value to store in custom field 2

getField3()

Returns: String

Third general purpose custom field, free text, available for account specific data. On a level it can also be read by name through fieldValue.

setField3(String field3)

Returns: void

Sets the third general purpose custom field.

ParameterDescription
field3the value to store in custom field 3

getPointsBucket()

Returns: Reward

The points bucket, held as a Reward, that points earned from this recognition are credited to. Null when this recognition does not allocate points. Loaded lazily.

setPointsBucket(Reward pointsBucket)

Returns: void

Sets the points bucket that points earned from this recognition are credited to.

ParameterDescription
pointsBucketthe reward acting as the points bucket, or null for none

getNumPoints()

Returns: Double

Fixed number of points allocated each time this recognition is awarded. Null when no fixed amount applies, for example when a points rule calculates the amount instead.

setNumPoints(Double numPoints)

Returns: void

Sets the fixed number of points allocated each time this recognition is awarded.

ParameterDescription
numPointsthe number of points to allocate, or null for none

getPointsRuleTypeId()

Returns: String

Identifier of the RecognitionPointsRuleType which calculates how many points to allocate when this recognition is awarded. Null when a fixed number of points is used instead.

setPointsRuleTypeId(String pointsRuleTypeId)

Returns: void

Sets the identifier of the points rule type used to calculate the points allocation.

ParameterDescription
pointsRuleTypeIdthe points rule type identifier, or null for none

getPointsRuleConfig()

Returns: String

Configuration for the points rule named by the points rule type identifier, stored as XML. Up to 2000 characters, and null when the rule needs no configuration.

setPointsRuleConfig(String pointsRuleConfig)

Returns: void

Sets the XML configuration for the points rule.

ParameterDescription
pointsRuleConfigthe points rule configuration XML, up to 2000 characters

getPointsExpiryRuleTypeId()

Returns: String

Identifier of the PointsExpiryRuleType which decides when points allocated by this recognition expire. Null when the allocated points do not expire.

setPointsExpiryRuleTypeId(String pointsExpiryRuleTypeId)

Returns: void

Sets the identifier of the points expiry rule type applied to points allocated by this recognition.

ParameterDescription
pointsExpiryRuleTypeIdthe points expiry rule type identifier, or null for none

getPointsExpiryRuleConfig()

Returns: String

Configuration for the points expiry rule named by the points expiry rule type identifier, stored as XML. Up to 2000 characters, and null when the rule needs no configuration.

setPointsExpiryRuleConfig(String pointsExpiryRuleConfig)

Returns: void

Sets the XML configuration for the points expiry rule.

ParameterDescription
pointsExpiryRuleConfigthe points expiry rule configuration XML, up to 2000 characters

getNumAwarded()

Returns: Long

Counts how many RecognitionAward rows currently exist for this badge or level. This is not a mapped column: it runs a count query against the database on every call, so avoid calling it inside a loop.

rowId()

Returns: Long

The database identifier of this badge or level, as required by the Relational interface.


Methods

getLevelAmount() · setLevelAmount(BigDecimal levelAmount) · getLevelLookupName() · setLevelLookupName(String levelLookupName) · getLevelsDataSeries() · setLevelsDataSeries(SalesDataSeries dataSeries) · isHigher(RecognitionLevel other) · isLower(RecognitionLevel other) · fieldValue(String fieldName)

getLevelAmount()

Returns: BigDecimal

The threshold on the topic's metric a profile must reach to be given this level. It is also what levels are ranked by, so a level with no amount sorts below every level that has one. Used when no lookup rule matches.

setLevelAmount(BigDecimal levelAmount)

Returns: void

Sets the threshold on the topic's metric needed to reach this level.

ParameterDescription
levelAmountthe amount needed to reach this level

getLevelLookupName()

Returns: String

Names the lookup table that decides the threshold for this level, for cases where it varies rather than being a single figure. Where no rule in that table matches, the fixed level amount is used instead. At most 200 characters, and null when no lookup is used.

setLevelLookupName(String levelLookupName)

Returns: void

Sets the name of the lookup table that decides the threshold for this level.

ParameterDescription
levelLookupNamethe lookup table name, at most 200 characters, or null for none

getLevelsDataSeries()

Returns: SalesDataSeries

A sales data series to take the threshold from, tried when one is set. Null where the level uses its lookup table or fixed amount instead.

setLevelsDataSeries(SalesDataSeries dataSeries)

Returns: void

Sets the sales data series the threshold is taken from.

ParameterDescription
dataSeriesthe data series supplying the threshold, or null for none

isHigher(RecognitionLevel other)

Returns: boolean

Whether this level ranks above another, comparing the two level amounts. A level with no amount ranks below one that has an amount, and two levels with no amount rank equal.

ParameterDescription
otherthe level to compare against

isLower(RecognitionLevel other)

Returns: boolean

Whether this level ranks below another, comparing the two level amounts. A level with no amount ranks below one that has an amount, and two levels with no amount rank equal.

ParameterDescription
otherthe level to compare against

fieldValue(String fieldName)

Returns: String

Reads one of the three general purpose custom fields by name, which is handy from a template where the field to show is itself configured. Only "field1", "field2" and "field3" are recognised, and anything else gives null.

ParameterDescription
fieldNamethe custom field to read, one of field1, field2 or field3
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.