Class MessageBuilderImpl
java.lang.Object
com.flowable.engage.engine.impl.message.MessageBuilderImpl
- All Implemented Interfaces:
MessageBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected Stringprotected Categoryprotected CommandExecutorprotected ContentItemprotected InputStreamprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected booleanprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected 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()booleanbooleanmainContent(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 therecipientGroupIdprivateMessage(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.voidsetCategory(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:
creatorIdin interfaceMessageBuilder
-
senderId
- Specified by:
senderIdin interfaceMessageBuilder
-
updaterId
- Specified by:
updaterIdin interfaceMessageBuilder
-
externalId
- Specified by:
externalIdin interfaceMessageBuilder
-
actionInstanceId
- Specified by:
actionInstanceIdin interfaceMessageBuilder
-
actionDefinitionId
Description copied from interface:MessageBuilderOptionally 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:
actionDefinitionIdin 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:MessageBuilderOptionally 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:
actionDefinitionKeyin 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:
mainContentin interfaceMessageBuilder
-
mainContentTemplate
public MessageBuilder mainContentTemplate(String messageCode, String language, Map<String, Object> payload) Description copied from interface:MessageBuilderAdds 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:
mainContentTemplatein interfaceMessageBuilder- Parameters:
messageCode- the message code to be used for the variation of the templatelanguage- the language ornullto 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:MessageBuilderAdds 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:
mainContentTemplatein 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 ornullto 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:
mainContentTypein interfaceMessageBuilder
-
media
- Specified by:
mediain interfaceMessageBuilder
-
media
Description copied from interface:MessageBuilderSend a media message with a provisional content item- Specified by:
mediain interfaceMessageBuilder- Parameters:
contentItem- the provisional content
-
type
- Specified by:
typein interfaceMessageBuilder
-
subType
- Specified by:
subTypein interfaceMessageBuilder
-
privateMessage
Description copied from interface:MessageBuilderThe message should be a private message for the user with therecipientId.- Specified by:
privateMessagein interfaceMessageBuilder- Parameters:
recipientId- the id of the recipient user
-
privateGroupMessage
Description copied from interface:MessageBuilderThe message should be a private message for the group with therecipientGroupId- Specified by:
privateGroupMessagein interfaceMessageBuilder- Parameters:
recipientGroupId- the id of the recipient group
-
stickyMessage
- Specified by:
stickyMessagein interfaceMessageBuilder
-
tags
- Specified by:
tagsin interfaceMessageBuilder
-
addTag
- Specified by:
addTagin interfaceMessageBuilder
-
addTags
- Specified by:
addTagsin interfaceMessageBuilder
-
replyToMessageId
- Specified by:
replyToMessageIdin interfaceMessageBuilder
-
scope
Description copied from interface:MessageBuilderSet 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:
scopein 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:MessageBuilderCreates and sends the message to the specified conversation.- Specified by:
sendin interfaceMessageBuilder- Parameters:
conversationId- the id of the conversation to send the message to- Returns:
- the created and sent message object
-