Class MessageBuilderImpl
java.lang.Object
com.flowable.engage.engine.impl.message.MessageBuilderImpl
- All Implemented Interfaces:
MessageBuilder
public class MessageBuilderImpl extends java.lang.Object implements MessageBuilder
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
actionDefinitionId
protected java.lang.String
actionDefinitionKey
protected java.lang.String
actionInstanceId
protected Category
category
protected org.flowable.common.engine.impl.interceptor.CommandExecutor
commandExecutor
protected org.flowable.content.api.ContentItem
contentItem
protected java.io.InputStream
contentStream
protected java.lang.String
conversationId
protected java.lang.String
creatorId
protected java.lang.String
externalId
protected java.lang.String
mainContent
protected java.lang.String
mainContentType
protected java.lang.String
recipientGroupId
protected java.lang.String
recipientId
protected java.lang.String
replyToMessageId
protected java.lang.String
scopeId
protected java.lang.String
scopeType
protected java.lang.String
senderId
protected boolean
stickyMessage
protected java.lang.String
subType
protected java.util.List<java.lang.String>
tags
protected java.lang.String
templateLanguage
protected java.lang.String
templateMessageCode
protected java.lang.String
templateMessageKey
protected java.util.Map<java.lang.String,java.lang.Object>
templatePayload
protected java.lang.String
type
protected java.lang.String
updaterId
-
Constructor Summary
Constructors Constructor Description MessageBuilderImpl(org.flowable.common.engine.impl.interceptor.CommandExecutor commandExecutor)
-
Method Summary
Modifier and Type Method Description MessageBuilder
actionDefinitionId(java.lang.String actionDefinitionId)
Optionally reference an action definition given by its id.MessageBuilder
actionDefinitionKey(java.lang.String actionDefinitionKey)
Optionally reference an action definition given by its key.MessageBuilder
actionInstanceId(java.lang.String actionInstanceId)
MessageBuilder
addTag(java.lang.String tag)
MessageBuilder
addTags(java.util.List<java.lang.String> tags)
MessageBuilder
creatorId(java.lang.String creatorId)
MessageBuilder
externalId(java.lang.String externalId)
java.lang.String
getActionDefinitionId()
java.lang.String
getActionDefinitionKey()
java.lang.String
getActionInstanceId()
Category
getCategory()
org.flowable.content.api.ContentItem
getContentItem()
java.io.InputStream
getContentStream()
java.lang.String
getConversationId()
java.lang.String
getCreatorId()
java.lang.String
getExternalId()
java.lang.String
getMainContent()
java.lang.String
getMainContentType()
java.lang.String
getRecipientGroupId()
java.lang.String
getRecipientId()
java.lang.String
getReplyToMessageId()
java.lang.String
getScopeId()
java.lang.String
getScopeType()
java.lang.String
getSenderId()
java.lang.String
getSubType()
java.util.List<java.lang.String>
getTags()
java.lang.String
getTemplateLanguage()
java.lang.String
getTemplateMessageCode()
java.lang.String
getTemplateMessageKey()
java.util.Map<java.lang.String,java.lang.Object>
getTemplatePayload()
java.lang.String
getType()
java.lang.String
getUpdaterId()
boolean
hasContentTemplate()
boolean
isStickyMessage()
MessageBuilder
mainContent(java.lang.String mainContent)
MessageBuilder
mainContentTemplate(java.lang.String templateKey, java.lang.String messageCode, java.lang.String language, java.util.Map<java.lang.String,java.lang.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).MessageBuilder
mainContentTemplate(java.lang.String messageCode, java.lang.String language, java.util.Map<java.lang.String,java.lang.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).MessageBuilder
mainContentType(java.lang.String mainContentType)
MessageBuilder
media(org.flowable.content.api.ContentItem contentItem)
Send a media message with a provisional content itemMessageBuilder
media(org.flowable.content.api.ContentItem contentItem, java.io.InputStream contentStream)
MessageBuilder
privateGroupMessage(java.lang.String recipientGroupId)
The message should be a private message for the group with therecipientGroupId
MessageBuilder
privateMessage(java.lang.String recipientId)
The message should be a private message for the user with therecipientId
.MessageBuilder
replyToMessageId(java.lang.String messageId)
MessageBuilder
scope(java.lang.String scopeId, java.lang.String scopeType)
Set an explicit scope for a referenced action definition to be passed on to the action instance, if created when posting this message.Message
send(java.lang.String conversationId)
Creates and sends the message to the specified conversation.MessageBuilder
senderId(java.lang.String senderId)
void
setCategory(Category category)
MessageBuilder
stickyMessage()
MessageBuilder
subType(java.lang.String subType)
MessageBuilder
tags(java.util.List<java.lang.String> tags)
MessageBuilder
type(java.lang.String type)
MessageBuilder
updaterId(java.lang.String updaterId)
-
Field Details
-
commandExecutor
protected org.flowable.common.engine.impl.interceptor.CommandExecutor commandExecutor -
category
-
conversationId
protected java.lang.String conversationId -
creatorId
protected java.lang.String creatorId -
senderId
protected java.lang.String senderId -
updaterId
protected java.lang.String updaterId -
recipientId
protected java.lang.String recipientId -
recipientGroupId
protected java.lang.String recipientGroupId -
externalId
protected java.lang.String externalId -
actionInstanceId
protected java.lang.String actionInstanceId -
actionDefinitionId
protected java.lang.String actionDefinitionId -
actionDefinitionKey
protected java.lang.String actionDefinitionKey -
mainContent
protected java.lang.String mainContent -
templateMessageKey
protected java.lang.String templateMessageKey -
templateMessageCode
protected java.lang.String templateMessageCode -
templateLanguage
protected java.lang.String templateLanguage -
templatePayload
protected java.util.Map<java.lang.String,java.lang.Object> templatePayload -
mainContentType
protected java.lang.String mainContentType -
contentItem
protected org.flowable.content.api.ContentItem contentItem -
contentStream
protected java.io.InputStream contentStream -
type
protected java.lang.String type -
subType
protected java.lang.String subType -
stickyMessage
protected boolean stickyMessage -
tags
protected java.util.List<java.lang.String> tags -
scopeId
protected java.lang.String scopeId -
scopeType
protected java.lang.String scopeType -
replyToMessageId
protected java.lang.String replyToMessageId
-
-
Constructor Details
-
MessageBuilderImpl
public MessageBuilderImpl(org.flowable.common.engine.impl.interceptor.CommandExecutor commandExecutor)
-
-
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(java.lang.String messageCode, java.lang.String language, java.util.Map<java.lang.String,java.lang.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(java.lang.String templateKey, java.lang.String messageCode, java.lang.String language, java.util.Map<java.lang.String,java.lang.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
public MessageBuilder media(org.flowable.content.api.ContentItem contentItem, java.io.InputStream contentStream)- 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
public java.lang.String getConversationId() -
getCreatorId
public java.lang.String getCreatorId() -
getSenderId
public java.lang.String getSenderId() -
getUpdaterId
public java.lang.String getUpdaterId() -
getRecipientId
public java.lang.String getRecipientId() -
getRecipientGroupId
public java.lang.String getRecipientGroupId() -
getExternalId
public java.lang.String getExternalId() -
getActionInstanceId
public java.lang.String getActionInstanceId() -
getActionDefinitionId
public java.lang.String getActionDefinitionId() -
getActionDefinitionKey
public java.lang.String getActionDefinitionKey() -
getMainContent
public java.lang.String getMainContent() -
hasContentTemplate
public boolean hasContentTemplate() -
getTemplateMessageKey
public java.lang.String getTemplateMessageKey() -
getTemplateMessageCode
public java.lang.String getTemplateMessageCode() -
getTemplateLanguage
public java.lang.String getTemplateLanguage() -
getTemplatePayload
public java.util.Map<java.lang.String,java.lang.Object> getTemplatePayload() -
getMainContentType
public java.lang.String getMainContentType() -
getContentItem
public org.flowable.content.api.ContentItem getContentItem() -
getContentStream
public java.io.InputStream getContentStream() -
getType
public java.lang.String getType() -
getSubType
public java.lang.String getSubType() -
isStickyMessage
public boolean isStickyMessage() -
getTags
public java.util.List<java.lang.String> getTags() -
getScopeId
public java.lang.String getScopeId() -
getScopeType
public java.lang.String getScopeType() -
getReplyToMessageId
public java.lang.String 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
-