Fluent builder for assembling and firing a custom repository app trigger event, obtained by calling EventWrapper.eventBuilder and used from GraalJS via chained setter calls. Accumulates a target profile, website, trigger id, attribute map, conditions and email attachments; fireEvent then builds a RepositoryAppTriggerEvent from the accumulated state and dispatches it through the owning EventWrapper. Each setX method has a matching withX method that performs the same assignment and returns this builder, allowing calls to be chained.

Group: Builders


Methods

setProfile(String userId) · withProfile(String userId) · setProfile(ProfileBean profile) · withProfile(ProfileBean profile) · setProfile(Profile profile) · withProfile(Profile profile) · setWebsite(String websiteName) · withWebsite(String websiteName) · setWebsite(Website website) · withWebsite(Website website) · setTriggerId(String triggerId) · withTriggerId(String triggerId) · setAttributes(Map<String,Object> attributes) · withAttributes(Map<String,Object> attributes) · addAttribute(String key, Object value) · addAttributeUrn(String key, String type, Relational entity) · setConditions(String conditions) · withConditions(String conditions) · setAttachments(List<EmailAttachmentBean> attachments) · withAttachments(List<EmailAttachmentBean> attachments) · addAttachment(String fileName, String hash, String contentType) · addAttachment(String fileName, String hash) · addAttachment(String fileName, String contentType, InputStream inputStream) · addAttachment(Attachment attachment) · addAttachment(String fileName, String hash, String contentType, String disposition) · fireEvent()

setProfile(String userId)

Returns: void

Attempts to locate a profile by user name or email address within the current organisation and sets it as the event's target profile. Does nothing if there is no current root folder, and leaves the target profile null if no match is found.

ParameterDescription
userIdthe user name or email address to look up

withProfile(String userId)

Returns: EventBuilder

Looks up a profile by user name or email address, as per setProfile, and returns this builder for chaining.

ParameterDescription
userIdthe user name or email address to look up

setProfile(ProfileBean profile)

Returns: void

Sets the event's target profile from a profile bean.

ParameterDescription
profilethe profile bean wrapping the profile to use

withProfile(ProfileBean profile)

Returns: EventBuilder

Sets the event's target profile from a profile bean and returns this builder for chaining.

ParameterDescription
profilethe profile bean wrapping the profile to use

setProfile(Profile profile)

Returns: void

Sets the event's target profile.

ParameterDescription
profilethe profile to use as the event's target

withProfile(Profile profile)

Returns: EventBuilder

Sets the event's target profile and returns this builder for chaining.

ParameterDescription
profilethe profile to use as the event's target

setWebsite(String websiteName)

Returns: void

Looks up a website by name within the current organisation and sets it as the event's target website.

ParameterDescription
websiteNamethe name of the website to look up

withWebsite(String websiteName)

Returns: EventBuilder

Looks up a website by name, as per setWebsite, and returns this builder for chaining.

ParameterDescription
websiteNamethe name of the website to look up

setWebsite(Website website)

Returns: void

Sets the event's target website.

ParameterDescription
websitethe website to use as the event's target

withWebsite(Website website)

Returns: EventBuilder

Sets the event's target website and returns this builder for chaining.

ParameterDescription
websitethe website to use as the event's target

setTriggerId(String triggerId)

Returns: void

Sets the id of the trigger that the built event should match against.

ParameterDescription
triggerIdthe trigger id

withTriggerId(String triggerId)

Returns: EventBuilder

Sets the trigger id and returns this builder for chaining.

ParameterDescription
triggerIdthe trigger id

setAttributes(Map<String,Object> attributes)

Returns: void

Sets the map of custom attributes to attach to the event, replacing any attributes set previously.

ParameterDescription
attributesthe attribute names and values to attach to the event

withAttributes(Map<String,Object> attributes)

Returns: EventBuilder

Sets the attribute map, as per setAttributes, and returns this builder for chaining.

ParameterDescription
attributesthe attribute names and values to attach to the event

addAttribute(String key, Object value)

Returns: EventBuilder

Adds a single attribute to the event, creating the attribute map on first use, and returns this builder for chaining.

ParameterDescription
keythe attribute name
valuethe attribute value

addAttributeUrn(String key, String type, Relational entity)

Returns: EventBuilder

Adds an attribute which refers to a persistent entity, recorded as a URN such as urn:profile:123 rather than as the entity itself. This is what to use when an event is about something in the database. The reference survives being stored and read back later, and whatever reads the event expands it again, so the reader sees current data rather than a snapshot taken when the event fired.

ParameterDescription
keythe attribute name
typethe entity type as the reader knows it, eg profile, org, lead
entitythe entity to refer to; ignored if null

setConditions(String conditions)

Returns: void

Sets the condition strings that must be satisfied for the event's trigger to fire.

ParameterDescription
conditionsthe condition strings to require

withConditions(String conditions)

Returns: EventBuilder

Sets the condition strings, as per setConditions, and returns this builder for chaining.

ParameterDescription
conditionsthe condition strings to require

setAttachments(List<EmailAttachmentBean> attachments)

Returns: void

Sets the list of email attachments to include with the event, replacing any attachments set previously.

ParameterDescription
attachmentsthe attachments to include

withAttachments(List<EmailAttachmentBean> attachments)

Returns: EventBuilder

Sets the attachment list, as per setAttachments, and returns this builder for chaining.

ParameterDescription
attachmentsthe attachments to include

addAttachment(String fileName, String hash, String contentType)

Returns: EventBuilder

Adds an attachment referencing existing content by its hash, with disposition "attachment", and returns this builder for chaining.

ParameterDescription
fileNamethe file name to present the attachment as
hashthe content hash of the already-stored attachment data
contentTypethe MIME type of the attachment

addAttachment(String fileName, String hash)

Returns: EventBuilder

Adds an attachment referencing existing content by its hash, with content type "application/octet-stream" and disposition "attachment", and returns this builder for chaining.

ParameterDescription
fileNamethe file name to present the attachment as
hashthe content hash of the already-stored attachment data

addAttachment(String fileName, String contentType, InputStream inputStream)

Returns: EventBuilder

Reads the given stream into content storage and adds it as an attachment with disposition "attachment", returning this builder for chaining. A null content type is replaced with "application/octet-stream".

ParameterDescription
fileNamethe file name to present the attachment as
contentTypethe MIME type of the attachment, or null to default to application/octet-stream
inputStreamthe attachment data to store

addAttachment(Attachment attachment)

Returns: EventBuilder

Reads the data from a mail attachment and adds it as an event attachment, as per addAttachment(String, String, InputStream), returning this builder for chaining.

ParameterDescription
attachmentthe mail attachment to copy into content storage and attach to the event

addAttachment(String fileName, String hash, String contentType, String disposition)

Returns: EventBuilder

Adds an attachment referencing existing content by its hash with an explicit disposition, and returns this builder for chaining.

ParameterDescription
fileNamethe file name to present the attachment as
hashthe content hash of the already-stored attachment data
contentTypethe MIME type of the attachment
dispositionthe MIME part disposition, e.g. "attachment" or "inline"

fireEvent()

Returns: void

Builds a RepositoryAppTriggerEvent from the profile, website, trigger id, attributes, attachments and conditions accumulated on this builder, and fires it through the owning EventWrapper.

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