Class MessageBuilderImpl
java.lang.Object
com.flowable.engage.engine.impl.message.MessageBuilderImpl
- All Implemented Interfaces:
MessageBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected String
protected String
protected Category
protected CommandExecutor
protected ContentItem
protected InputStream
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected boolean
protected String
protected String
protected String
protected String
protected String
protected String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactionDefinitionId
(String actionDefinitionId) Optionally reference an action definition given by its id.actionDefinitionKey
(String actionDefinitionKey) Optionally reference an action definition given by its key.actionInstanceId
(String actionInstanceId) externalId
(String externalId) getTags()
getType()
boolean
boolean
mainContent
(String mainContent) mainContentTemplate
(String templateKey, String messageCode, String language, Map<String, Object> payload) Adds content being rendered from the specified template (uses "standardMessage" as the template key and the provided message code and optional language as the variation).Adds content being rendered from the specified template (uses "standardMessage" as the template key and the provided message code and optional language as the variation).mainContentType
(String mainContentType) media
(ContentItem contentItem) Send a media message with a provisional content itemmedia
(ContentItem contentItem, InputStream contentStream) privateGroupMessage
(String recipientGroupId) The message should be a private message for the group with therecipientGroupId
privateMessage
(String recipientId) The message should be a private message for the user with therecipientId
.replyToMessageId
(String messageId) Set an explicit scope for a referenced action definition to be passed on to the action instance, if created when posting this message.Creates and sends the message to the specified conversation.void
setCategory
(Category category)
-
Field Details
-
commandExecutor
-
category
-
conversationId
-
creatorId
-
senderId
-
updaterId
-
recipientId
-
recipientGroupId
-
externalId
-
actionInstanceId
-
actionDefinitionId
-
actionDefinitionKey
-
mainContent
-
templateMessageKey
-
templateMessageCode
-
templateLanguage
-
templatePayload
-
mainContentType
-
contentItem
-
contentStream
-
type
-
subType
-
stickyMessage
protected boolean stickyMessage -
tags
-
scopeId
-
scopeType
-
replyToMessageId
-
-
Constructor Details
-
MessageBuilderImpl
-
-
Method Details
-
creatorId
- Specified by:
creatorId
in interfaceMessageBuilder
-
senderId
- Specified by:
senderId
in interfaceMessageBuilder
-
updaterId
- Specified by:
updaterId
in interfaceMessageBuilder
-
externalId
- Specified by:
externalId
in interfaceMessageBuilder
-
actionInstanceId
- Specified by:
actionInstanceId
in interfaceMessageBuilder
-
actionDefinitionId
Description copied from interface:MessageBuilder
Optionally reference an action definition given by its id. The message will then reference that action definition by creating an action instance based on it within the send method. You might want to set an explicit scope for the action instance too usingMessageBuilder.scope(String, String)
, if not set, the conversation is automatically used as the scope for the action instance.- Specified by:
actionDefinitionId
in interfaceMessageBuilder
- Parameters:
actionDefinitionId
- the id of the action definition to create an action instance for, which is then referenced by this message- Returns:
- the message builder for method chaining
-
actionDefinitionKey
Description copied from interface:MessageBuilder
Optionally reference an action definition given by its key. The message will then reference that action definition by creating an action instance based on it within the send method. You might want to set an explicit scope for the action instance too usingMessageBuilder.scope(String, String)
, if not set, the conversation is automatically used as the scope for the action instance.- Specified by:
actionDefinitionKey
in interfaceMessageBuilder
- Parameters:
actionDefinitionKey
- the key of the action definition to create an action instance for, which is then referenced by this message- Returns:
- the message builder for method chaining
-
mainContent
- Specified by:
mainContent
in interfaceMessageBuilder
-
mainContentTemplate
public MessageBuilder mainContentTemplate(String messageCode, String language, Map<String, Object> payload) Description copied from interface:MessageBuilder
Adds content being rendered from the specified template (uses "standardMessage" as the template key and the provided message code and optional language as the variation). If the template has placeholders, then the payload needs to be provided as well in order to let the template engine render it.- Specified by:
mainContentTemplate
in interfaceMessageBuilder
- Parameters:
messageCode
- the message code to be used for the variation of the templatelanguage
- the language ornull
to use the default onepayload
- the optional payload containing the values for the placeholder of the template, if needed- Returns:
- the message builder for method chaining
-
mainContentTemplate
public MessageBuilder mainContentTemplate(String templateKey, String messageCode, String language, Map<String, Object> payload) Description copied from interface:MessageBuilder
Adds content being rendered from the specified template (uses "standardMessage" as the template key and the provided message code and optional language as the variation). If the template has placeholders, then the payload needs to be provided as well in order to let the template engine render it.- Specified by:
mainContentTemplate
in interfaceMessageBuilder
- Parameters:
templateKey
- the key of the template to be used (will be "standardMessage", if none provided explicitly)messageCode
- the message code to be used for the variation of the templatelanguage
- the language ornull
to use the default onepayload
- the optional payload containing the values for the placeholder of the template, if needed- Returns:
- the message builder for method chaining
-
mainContentType
- Specified by:
mainContentType
in interfaceMessageBuilder
-
media
- Specified by:
media
in interfaceMessageBuilder
-
media
Description copied from interface:MessageBuilder
Send a media message with a provisional content item- Specified by:
media
in interfaceMessageBuilder
- Parameters:
contentItem
- the provisional content
-
type
- Specified by:
type
in interfaceMessageBuilder
-
subType
- Specified by:
subType
in interfaceMessageBuilder
-
privateMessage
Description copied from interface:MessageBuilder
The message should be a private message for the user with therecipientId
.- Specified by:
privateMessage
in interfaceMessageBuilder
- Parameters:
recipientId
- the id of the recipient user
-
privateGroupMessage
Description copied from interface:MessageBuilder
The message should be a private message for the group with therecipientGroupId
- Specified by:
privateGroupMessage
in interfaceMessageBuilder
- Parameters:
recipientGroupId
- the id of the recipient group
-
stickyMessage
- Specified by:
stickyMessage
in interfaceMessageBuilder
-
tags
- Specified by:
tags
in interfaceMessageBuilder
-
addTag
- Specified by:
addTag
in interfaceMessageBuilder
-
addTags
- Specified by:
addTags
in interfaceMessageBuilder
-
replyToMessageId
- Specified by:
replyToMessageId
in interfaceMessageBuilder
-
scope
Description copied from interface:MessageBuilder
Set an explicit scope for a referenced action definition to be passed on to the action instance, if created when posting this message. If not explicitly set, the conversation is used as the scope this message is sent to.- Specified by:
scope
in interfaceMessageBuilder
- Parameters:
scopeId
- the id of the scope a referenced action definition should be bound toscopeType
- the type of the scope for the referenced action definition- Returns:
- the message builder for method chaining
-
getCategory
-
setCategory
-
getConversationId
-
getCreatorId
-
getSenderId
-
getUpdaterId
-
getRecipientId
-
getRecipientGroupId
-
getExternalId
-
getActionInstanceId
-
getActionDefinitionId
-
getActionDefinitionKey
-
getMainContent
-
hasContentTemplate
public boolean hasContentTemplate() -
getTemplateMessageKey
-
getTemplateMessageCode
-
getTemplateLanguage
-
getTemplatePayload
-
getMainContentType
-
getContentItem
-
getContentStream
-
getType
-
getSubType
-
isStickyMessage
public boolean isStickyMessage() -
getTags
-
getScopeId
-
getScopeType
-
getReplyToMessageId
-
send
Description copied from interface:MessageBuilder
Creates and sends the message to the specified conversation.- Specified by:
send
in interfaceMessageBuilder
- Parameters:
conversationId
- the id of the conversation to send the message to- Returns:
- the created and sent message object
-