Fired when a visitor successfully submits a group registration form, immediately after the group membership record has been created. It has event id "registration" and is fired by the signup app's registration page for both outcomes of a registration: when the target group is open the event carries the new membership of that group, and when the group is closed it instead carries the membership created in the account's contacts group while the application is pending approval. It fires before the registration transaction commits, so a listener runs in the same session and can still see and modify the new profile, typically to provision content or send a welcome email. It is a trigger event, keyed on the group id as trigger item 1 and the website id as trigger item 2.
Implements: TriggerEvent
Properties
| Property | Returns | Description |
|---|---|---|
| attributes | Map<String,Object> | The mutable attribute map for this event. Starts empty, and is used as a per-event scratch cache by isActive and getGroupInWebsites; listeners may add their own entries to pass values on to later handlers and to email templates. |
| eventId | String | The persistent identifier for this event type, always "registration". Used by the trigger system to select handlers. |
| membership | GroupMembership | The group membership created by the registration. For a registration into a closed group this is the membership of the account's "contacts" group rather than of the group being applied for. Never null. |
| sourceProfile | Profile | The profile that registered, taken from the member of the new group membership. |
| triggerItem1 | String | The id of the group that was registered into, as a string, for trigger matching. |
| triggerItem2 | String | The id of the website the registration was submitted on, as a string, or null if there is no website. |
| 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. |
| website | Website | The website the registration form was submitted on. Null when the registration did not come through a website. |
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
getMembership() · getWebsite() · getSourceProfile() · getEventId() · getTriggerItem1() · getTriggerItem2() · getTriggerItem3() · getTriggerItem4() · getTriggerItem5() · getAttributes() · isActive(ApplicationManager applicationManager, Application app, Branch branch) · getGroupInWebsites(Group group)
getMembership()
Returns: GroupMembership
The group membership created by the registration. For a registration into a closed group this is the membership of the account's "contacts" group rather than of the group being applied for. Never null.
getWebsite()
Returns: Website
The website the registration form was submitted on. Null when the registration did not come through a website.
getSourceProfile()
Returns: Profile
The profile that registered, taken from the member of the new group membership.
getEventId()
Returns: String
The persistent identifier for this event type, always "registration". Used by the trigger system to select handlers.
getTriggerItem1()
Returns: String
The id of the group that was registered into, as a string, for trigger matching.
getTriggerItem2()
Returns: String
The id of the website the registration was submitted on, as a string, or null if there is no website.
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>
The mutable attribute map for this event. Starts empty, and is used as a per-event scratch cache by isActive and getGroupInWebsites; listeners may add their own entries to pass values on to later handlers and to email templates.
isActive(ApplicationManager applicationManager, Application app, Branch branch)
Returns: boolean
Reports whether the given app is active on the given branch, caching the list of active apps in this event's attributes so that repeated calls across several listeners only look it up once.
| Parameter | Description |
|---|---|
applicationManager | the application manager used to look up and test the active apps |
app | the app to test for |
branch | the branch to check the app's activation against |
getGroupInWebsites(Group group)
Returns: List<GroupInWebsite>
Finds the websites the given group is enabled on, caching the result in this event's attributes so that repeated calls across several listeners only run the query once. The first call hits the database. Note the cache is keyed only by this event, not by the group argument, so the result of the first call is returned for every subsequent call regardless of the group passed.
| Parameter | Description |
|---|---|
group | the group to look up the website links for |