Rule which turns records in a sales data series into points allocations, deciding which records count, how many points they are worth and who receives them. Each source belongs to one SalesDataSeries and allocates against one Reward, whose points system determines whether the points go to a profile or to an organisation. Points can be calculated either by a named points rule type with XML configuration, or by an MVEL expression, and records can be filtered by a second MVEL expression. Sources are soft deleted, so anything reading them should ignore rows with a deletedDate.

Group: Database Entities

Implements: Serializable, Auditable


Properties

PropertyReturnsDescription
allocationTypeAllocationTypeWhether each qualifying record is allocated its own points award, INDIVIDUAL, or whether the points for all of a recipient's records in the batch are added up into a single award, SUM. Null is treated as INDIVIDUAL. SUM mode always awards to the record's salesBy entity and does not support the recipient expression.
auditOrgOrganisationThe organisation that audit entries for this source are recorded against, taken from the sales data series the source belongs to.
containsMvelTagInReasonTemplatebooleanWhether the reason template actually contains an MVEL tag, which tells an editor whether the reason text will vary per record or is a fixed string.
createdByProfileThe profile which created the source.
createdDateDateWhen the source was created.
dataSeriesSalesDataSeriesThe sales data series whose records this source allocates points from. This is also what ties the source to an administrative organisation. Never null.
deletedByProfileThe profile which soft deleted the source, or null if it has not been deleted.
deletedDateDateWhen the source was soft deleted, or null if it is still live. The finder methods exclude rows with a deletedDate, so anything reading sources directly should do the same.
idlongUnique database identifier for this points allocation source.
ignoreExpressionStringMVEL expression evaluated against each record to decide whether it is processed at all. Despite the name the sense is positive: a result of true includes the record, and a blank expression includes everything. Ignored when a points rule type id is set, because the rule type then decides inclusion.
modifiedByProfileThe profile which last edited the source.
modifiedDateDateWhen the source was last edited.
mvelExpressionStringMVEL expression evaluated against each record to produce the number of points to allocate. Only used when no points rule type id is set. If both this and the rule type are absent the record value itself is allocated as points.
mvelReasonTemplateStringMVEL template rendered per record to produce the reason text stored against the allocated points, so the recipient can see why they were awarded.
nameStringPortable, path-safe identifier for the source, unique within the administrative organisation and used to look it up by name. Distinct from the title, which is the free-text display label. Never null.
notesStringFree-text notes for administrators explaining what the source is for. Internal only, never shown to points recipients.
pointsDateModeStringWhich date is recorded against the allocated points: N for the time of processing, S for the record's sale date, and E for the date the record was entered. Anything else, including null, falls back to the record's period from date.
pointsDateModeEnteredDatebooleanWhether allocated points are dated with the date the sales record was entered, that is whether the points date mode is E.
pointsDateModeNowbooleanWhether allocated points are dated with the time of processing, that is whether the points date mode is N.
pointsDateNodeSaleDatebooleanIntended to report whether allocated points are dated with the record's sale date, that is whether the points date mode is S. As written the condition requires the points date mode to be both null and equal to S, so it always returns false. Nothing in the platform calls it; the sale date is the fallback used when neither of the other two modes matches.
pointsExpiryRuleConfigStringConfiguration for the selected points expiry rule type, stored as a parameter string. Only meaningful when a points expiry rule type id is set.
pointsExpiryRuleTypeIdStringIdentifier of the registered points expiry rule type which decides when points allocated by this source expire. Null means points allocated here do not get an expiry date from a rule.
pointsRuleConfigStringConfiguration for the selected points rule type, stored as a parameter string which is parsed into a map of name to value before the rule runs. Only meaningful when a points rule type id is set.
pointsRuleTypeIdStringIdentifier of the registered points rule type which calculates the points for each record. When set, the rule type is used in preference to the MVEL expression, and it also decides whether a record is included. Null means points come from the MVEL expression instead.
pointsTagPointsTagTag applied to every points record this source creates, so points can later be grouped and reported on by source. Null leaves the points untagged.
promotionRewardOptional promotion which controls whether this source is currently enabled, so a source can be switched on only for the life of a campaign. Separate from the reward the points are allocated against.
reasonCodeStringReason code copied onto the points records created by this source, used to associate them with matching points debits later.
recipientStringKCode expression which is evaluated per record to work out who the points go to, resolving to an email address or username for an individual reward. When blank the points go to the record's salesBy entity. Not supported with SUM allocation, which always awards to salesBy.
rewardRewardThe reward the points are allocated against. Its points system decides whether points are awarded to a profile or to an organisation. Processing is skipped entirely when this is null, so a source without a reward allocates nothing.
titleStringFree-text display label shown to administrators, and the field that listings are sorted by. Not guaranteed to be unique. Never null.

Methods

getId() · getName() · getTitle() · getPointsRuleTypeId() · getPointsRuleConfig() · getRecipient() · getPointsExpiryRuleTypeId() · getPointsExpiryRuleConfig() · getDataSeries() · getReward() · getPromotion() · getPointsTag() · getPointsDateMode() · getReasonCode() · getModifiedDate() · getModifiedBy() · getCreatedDate() · getCreatedBy() · getDeletedDate() · getDeletedBy() · getMvelExpression() · getMvelReasonTemplate() · getIgnoreExpression() · getNotes() · getAllocationType() · isPointsDateModeNow() · isPointsDateNodeSaleDate() · isPointsDateModeEnteredDate() · getAuditOrg() · isContainsMvelTagInReasonTemplate()

getId()

Returns: long

Unique database identifier for this points allocation source.

getName()

Returns: String

Portable, path-safe identifier for the source, unique within the administrative organisation and used to look it up by name. Distinct from the title, which is the free-text display label. Never null.

getTitle()

Returns: String

Free-text display label shown to administrators, and the field that listings are sorted by. Not guaranteed to be unique. Never null.

getPointsRuleTypeId()

Returns: String

Identifier of the registered points rule type which calculates the points for each record. When set, the rule type is used in preference to the MVEL expression, and it also decides whether a record is included. Null means points come from the MVEL expression instead.

getPointsRuleConfig()

Returns: String

Configuration for the selected points rule type, stored as a parameter string which is parsed into a map of name to value before the rule runs. Only meaningful when a points rule type id is set.

getRecipient()

Returns: String

KCode expression which is evaluated per record to work out who the points go to, resolving to an email address or username for an individual reward. When blank the points go to the record's salesBy entity. Not supported with SUM allocation, which always awards to salesBy.

getPointsExpiryRuleTypeId()

Returns: String

Identifier of the registered points expiry rule type which decides when points allocated by this source expire. Null means points allocated here do not get an expiry date from a rule.

getPointsExpiryRuleConfig()

Returns: String

Configuration for the selected points expiry rule type, stored as a parameter string. Only meaningful when a points expiry rule type id is set.

getDataSeries()

Returns: SalesDataSeries

The sales data series whose records this source allocates points from. This is also what ties the source to an administrative organisation. Never null.

getReward()

Returns: Reward

The reward the points are allocated against. Its points system decides whether points are awarded to a profile or to an organisation. Processing is skipped entirely when this is null, so a source without a reward allocates nothing.

getPromotion()

Returns: Reward

Optional promotion which controls whether this source is currently enabled, so a source can be switched on only for the life of a campaign. Separate from the reward the points are allocated against.

getPointsTag()

Returns: PointsTag

Tag applied to every points record this source creates, so points can later be grouped and reported on by source. Null leaves the points untagged.

getPointsDateMode()

Returns: String

Which date is recorded against the allocated points: N for the time of processing, S for the record's sale date, and E for the date the record was entered. Anything else, including null, falls back to the record's period from date.

getReasonCode()

Returns: String

Reason code copied onto the points records created by this source, used to associate them with matching points debits later.

getModifiedDate()

Returns: Date

When the source was last edited.

getModifiedBy()

Returns: Profile

The profile which last edited the source.

getCreatedDate()

Returns: Date

When the source was created.

getCreatedBy()

Returns: Profile

The profile which created the source.

getDeletedDate()

Returns: Date

When the source was soft deleted, or null if it is still live. The finder methods exclude rows with a deletedDate, so anything reading sources directly should do the same.

getDeletedBy()

Returns: Profile

The profile which soft deleted the source, or null if it has not been deleted.

getMvelExpression()

Returns: String

MVEL expression evaluated against each record to produce the number of points to allocate. Only used when no points rule type id is set. If both this and the rule type are absent the record value itself is allocated as points.

getMvelReasonTemplate()

Returns: String

MVEL template rendered per record to produce the reason text stored against the allocated points, so the recipient can see why they were awarded.

getIgnoreExpression()

Returns: String

MVEL expression evaluated against each record to decide whether it is processed at all. Despite the name the sense is positive: a result of true includes the record, and a blank expression includes everything. Ignored when a points rule type id is set, because the rule type then decides inclusion.

getNotes()

Returns: String

Free-text notes for administrators explaining what the source is for. Internal only, never shown to points recipients.

getAllocationType()

Returns: AllocationType

Whether each qualifying record is allocated its own points award, INDIVIDUAL, or whether the points for all of a recipient's records in the batch are added up into a single award, SUM. Null is treated as INDIVIDUAL. SUM mode always awards to the record's salesBy entity and does not support the recipient expression.

isPointsDateModeNow()

Returns: boolean

Whether allocated points are dated with the time of processing, that is whether the points date mode is N.

isPointsDateNodeSaleDate()

Returns: boolean

Intended to report whether allocated points are dated with the record's sale date, that is whether the points date mode is S. As written the condition requires the points date mode to be both null and equal to S, so it always returns false. Nothing in the platform calls it; the sale date is the fallback used when neither of the other two modes matches.

isPointsDateModeEnteredDate()

Returns: boolean

Whether allocated points are dated with the date the sales record was entered, that is whether the points date mode is E.

getAuditOrg()

Returns: Organisation

The organisation that audit entries for this source are recorded against, taken from the sales data series the source belongs to.

isContainsMvelTagInReasonTemplate()

Returns: boolean

Whether the reason template actually contains an MVEL tag, which tells an editor whether the reason text will vary per record or is a fixed string.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.