Fired when points are granted to a profile or organisation against a reward, for example completing a module, a manual award, or a promotion entry. Raised by RewardService whenever a Points issue or a RewardEntry status change increases a participant's points balance for a reward. FunnelManager fans this out into a RewardGrantedFunnelEvent per profile associated with the awarded entity, and this event also implements IndexedItemUpdatedEvent so the points or reward entry is re-indexed for search.
Implements: TriggerEvent, IndexedItemUpdatedEvent
Properties
| Property | Returns | Description |
|---|---|---|
| attributes | Map<String,Object> | Extra properties associated with this event. This event does not populate any. |
| availableBalance | Double | The awarded entity's current available balance for the reward, ie points not yet committed to other debits, looked up from RewardService at the time this is called. |
| awardedToEntity | BaseEntity | The entity the points were granted to: the points issue's recipient if this grant relates to a specific Points issue, otherwise the profile if one was given, or else the organisation. |
| awardedToOrg | Organisation | The organisation the points were granted to, if the grant was made against an organisation rather than a specific profile. |
| branch | Branch | The branch this update occurred within. This event is not scoped to a branch. |
| deleted | boolean | Whether the updated object should be removed from the search index. A grant never deletes the underlying record, so this is always false. |
| eventId | String | The persistence-friendly identifier for this event type. |
| numGranted | double | The number of points that were granted. |
| pointsBalance | Double | The awarded entity's current points balance for the reward, looked up from RewardService at the time this is called. |
| reward | Reward | The reward the points were granted against. |
| rewardDate | Date | The date the grant occurred. |
| rewardEndDate | Date | The end date of the reward the points were granted against. |
| rewardEntryStatus | RewardEntryStatus | The status of the reward entry associated with this grant, if this grant was raised from a reward entry status change rather than a Points issue. |
| rewardName | String | The name of the reward the points were granted against. |
| rewardStartDate | Date | The start date of the reward the points were granted against. |
| rewardTemplate | String | The template code of the reward the points were granted against. |
| sourceProfile | Profile | The profile the points were granted to. |
| transaction | Transaction | The database transaction associated with this grant, so indexing can be deferred until it commits. |
| triggerItem1 | String | The ID of the website the grant occurred within, used as a trigger key. |
| triggerItem2 | String | The ID of the reward the points were granted against, used as a trigger key. |
| triggerItem3 | String | Not used by this event; always null. |
| triggerItem4 | String | Not used by this event; always null. |
| triggerItem5 | String | Not used by this event; always null. |
| updatedObject | Object | The object that should be re-indexed as a result of this grant: the Points issue if one was provided, otherwise the RewardEntry. |
| website | Website | The website the grant occurred within. |
Inherited from TriggerEvent
Properties
| Property | Returns | Description |
|---|---|---|
| serialisable | boolean | Whether this event's attributes were built to survive being persisted, ie every value is a plain serialisable value rather than a persistent entity or some other object that only makes sense inside the firing transaction. Only the firing app can know this, so it declares it - see EventBuilder. An agent that subscribes to an event does not run when it fires. The event is written to storage as JSON, buffered with others, and read back minutes later in a different session, so a value that cannot be written and read back is not merely awkward, it breaks the whole delivery. The agent framework therefore ignores any event which does not say yes here. |
Methods
isSerialisable()
Returns: boolean
Whether this event's attributes were built to survive being persisted, ie every value is a plain serialisable value rather than a persistent entity or some other object that only makes sense inside the firing transaction. Only the firing app can know this, so it declares it - see EventBuilder. An agent that subscribes to an event does not run when it fires. The event is written to storage as JSON, buffered with others, and read back minutes later in a different session, so a value that cannot be written and read back is not merely awkward, it breaks the whole delivery. The agent framework therefore ignores any event which does not say yes here.
Methods
getAwardedToEntity() · getSourceProfile() · getEventId() · getWebsite() · getTriggerItem1() · getTriggerItem2() · getTriggerItem3() · getTriggerItem4() · getTriggerItem5() · getAttributes() · getNumGranted() · getAwardedToOrg() · getRewardDate() · getRewardName() · getRewardEntryStatus() · getRewardTemplate() · getRewardStartDate() · getRewardEndDate() · getPointsBalance() · getAvailableBalance() · getBranch() · getUpdatedObject() · isDeleted() · getTransaction() · getReward()
getAwardedToEntity()
Returns: BaseEntity
The entity the points were granted to: the points issue's recipient if this grant relates to a specific Points issue, otherwise the profile if one was given, or else the organisation.
getSourceProfile()
Returns: Profile
The profile the points were granted to.
getEventId()
Returns: String
The persistence-friendly identifier for this event type.
getWebsite()
Returns: Website
The website the grant occurred within.
getTriggerItem1()
Returns: String
The ID of the website the grant occurred within, used as a trigger key.
getTriggerItem2()
Returns: String
The ID of the reward the points were granted against, used as a trigger key.
getTriggerItem3()
Returns: String
Not used by this event; always null.
getTriggerItem4()
Returns: String
Not used by this event; always null.
getTriggerItem5()
Returns: String
Not used by this event; always null.
getAttributes()
Returns: Map<String,Object>
Extra properties associated with this event. This event does not populate any.
getNumGranted()
Returns: double
The number of points that were granted.
getAwardedToOrg()
Returns: Organisation
The organisation the points were granted to, if the grant was made against an organisation rather than a specific profile.
getRewardDate()
Returns: Date
The date the grant occurred.
getRewardName()
Returns: String
The name of the reward the points were granted against.
getRewardEntryStatus()
Returns: RewardEntryStatus
The status of the reward entry associated with this grant, if this grant was raised from a reward entry status change rather than a Points issue.
getRewardTemplate()
Returns: String
The template code of the reward the points were granted against.
getRewardStartDate()
Returns: Date
The start date of the reward the points were granted against.
getRewardEndDate()
Returns: Date
The end date of the reward the points were granted against.
getPointsBalance()
Returns: Double
The awarded entity's current points balance for the reward, looked up from RewardService at the time this is called.
getAvailableBalance()
Returns: Double
The awarded entity's current available balance for the reward, ie points not yet committed to other debits, looked up from RewardService at the time this is called.
getBranch()
Returns: Branch
The branch this update occurred within. This event is not scoped to a branch.
getUpdatedObject()
Returns: Object
The object that should be re-indexed as a result of this grant: the Points issue if one was provided, otherwise the RewardEntry.
isDeleted()
Returns: boolean
Whether the updated object should be removed from the search index. A grant never deletes the underlying record, so this is always false.
getTransaction()
Returns: Transaction
The database transaction associated with this grant, so indexing can be deferred until it commits.
getReward()
Returns: Reward
The reward the points were granted against.