Class MessageBuilderImpl

java.lang.Object
com.flowable.engage.engine.impl.message.MessageBuilderImpl
All Implemented Interfaces:
MessageBuilder

public class MessageBuilderImpl extends Object implements MessageBuilder
  • Field Details

    • commandExecutor

      protected CommandExecutor commandExecutor
    • category

      protected Category category
    • conversationId

      protected String conversationId
    • creatorId

      protected String creatorId
    • senderId

      protected String senderId
    • updaterId

      protected String updaterId
    • recipientId

      protected String recipientId
    • recipientGroupId

      protected String recipientGroupId
    • externalId

      protected String externalId
    • actionInstanceId

      protected String actionInstanceId
    • actionDefinitionId

      protected String actionDefinitionId
    • actionDefinitionKey

      protected String actionDefinitionKey
    • mainContent

      protected String mainContent
    • templateMessageKey

      protected String templateMessageKey
    • templateMessageCode

      protected String templateMessageCode
    • templateLanguage

      protected String templateLanguage
    • templatePayload

      protected Map<String,Object> templatePayload
    • mainContentType

      protected String mainContentType
    • contentItem

      protected ContentItem contentItem
    • contentStream

      protected InputStream contentStream
    • type

      protected String type
    • subType

      protected String subType
    • stickyMessage

      protected boolean stickyMessage
    • tags

      protected List<String> tags
    • scopeId

      protected String scopeId
    • scopeType

      protected String scopeType
    • replyToMessageId

      protected String replyToMessageId
  • Constructor Details

    • MessageBuilderImpl

      public MessageBuilderImpl(CommandExecutor commandExecutor)
  • Method Details

    • creatorId

      public MessageBuilder creatorId(String creatorId)
      Specified by:
      creatorId in interface MessageBuilder
    • senderId

      public MessageBuilder senderId(String senderId)
      Specified by:
      senderId in interface MessageBuilder
    • updaterId

      public MessageBuilder updaterId(String updaterId)
      Specified by:
      updaterId in interface MessageBuilder
    • externalId

      public MessageBuilder externalId(String externalId)
      Specified by:
      externalId in interface MessageBuilder
    • actionInstanceId

      public MessageBuilder actionInstanceId(String actionInstanceId)
      Specified by:
      actionInstanceId in interface MessageBuilder
    • actionDefinitionId

      public MessageBuilder actionDefinitionId(String 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 using MessageBuilder.scope(String, String), if not set, the conversation is automatically used as the scope for the action instance.
      Specified by:
      actionDefinitionId in interface MessageBuilder
      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

      public MessageBuilder actionDefinitionKey(String 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 using MessageBuilder.scope(String, String), if not set, the conversation is automatically used as the scope for the action instance.
      Specified by:
      actionDefinitionKey in interface MessageBuilder
      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

      public MessageBuilder mainContent(String mainContent)
      Specified by:
      mainContent in interface MessageBuilder
    • 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 interface MessageBuilder
      Parameters:
      messageCode - the message code to be used for the variation of the template
      language - the language or null to use the default one
      payload - 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 interface MessageBuilder
      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 template
      language - the language or null to use the default one
      payload - the optional payload containing the values for the placeholder of the template, if needed
      Returns:
      the message builder for method chaining
    • mainContentType

      public MessageBuilder mainContentType(String mainContentType)
      Specified by:
      mainContentType in interface MessageBuilder
    • media

      public MessageBuilder media(ContentItem contentItem, InputStream contentStream)
      Specified by:
      media in interface MessageBuilder
    • media

      public MessageBuilder media(ContentItem contentItem)
      Description copied from interface: MessageBuilder
      Send a media message with a provisional content item
      Specified by:
      media in interface MessageBuilder
      Parameters:
      contentItem - the provisional content
    • type

      public MessageBuilder type(String type)
      Specified by:
      type in interface MessageBuilder
    • subType

      public MessageBuilder subType(String subType)
      Specified by:
      subType in interface MessageBuilder
    • privateMessage

      public MessageBuilder privateMessage(String recipientId)
      Description copied from interface: MessageBuilder
      The message should be a private message for the user with the recipientId.
      Specified by:
      privateMessage in interface MessageBuilder
      Parameters:
      recipientId - the id of the recipient user
    • privateGroupMessage

      public MessageBuilder privateGroupMessage(String recipientGroupId)
      Description copied from interface: MessageBuilder
      The message should be a private message for the group with the recipientGroupId
      Specified by:
      privateGroupMessage in interface MessageBuilder
      Parameters:
      recipientGroupId - the id of the recipient group
    • stickyMessage

      public MessageBuilder stickyMessage()
      Specified by:
      stickyMessage in interface MessageBuilder
    • tags

      public MessageBuilder tags(List<String> tags)
      Specified by:
      tags in interface MessageBuilder
    • addTag

      public MessageBuilder addTag(String tag)
      Specified by:
      addTag in interface MessageBuilder
    • addTags

      public MessageBuilder addTags(List<String> tags)
      Specified by:
      addTags in interface MessageBuilder
    • replyToMessageId

      public MessageBuilder replyToMessageId(String messageId)
      Specified by:
      replyToMessageId in interface MessageBuilder
    • scope

      public MessageBuilder scope(String scopeId, String scopeType)
      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 interface MessageBuilder
      Parameters:
      scopeId - the id of the scope a referenced action definition should be bound to
      scopeType - the type of the scope for the referenced action definition
      Returns:
      the message builder for method chaining
    • getCategory

      public Category getCategory()
    • setCategory

      public void setCategory(Category category)
    • getConversationId

      public String getConversationId()
    • getCreatorId

      public String getCreatorId()
    • getSenderId

      public String getSenderId()
    • getUpdaterId

      public String getUpdaterId()
    • getRecipientId

      public String getRecipientId()
    • getRecipientGroupId

      public String getRecipientGroupId()
    • getExternalId

      public String getExternalId()
    • getActionInstanceId

      public String getActionInstanceId()
    • getActionDefinitionId

      public String getActionDefinitionId()
    • getActionDefinitionKey

      public String getActionDefinitionKey()
    • getMainContent

      public String getMainContent()
    • hasContentTemplate

      public boolean hasContentTemplate()
    • getTemplateMessageKey

      public String getTemplateMessageKey()
    • getTemplateMessageCode

      public String getTemplateMessageCode()
    • getTemplateLanguage

      public String getTemplateLanguage()
    • getTemplatePayload

      public Map<String,Object> getTemplatePayload()
    • getMainContentType

      public String getMainContentType()
    • getContentItem

      public ContentItem getContentItem()
    • getContentStream

      public InputStream getContentStream()
    • getType

      public String getType()
    • getSubType

      public String getSubType()
    • isStickyMessage

      public boolean isStickyMessage()
    • getTags

      public List<String> getTags()
    • getScopeId

      public String getScopeId()
    • getScopeType

      public String getScopeType()
    • getReplyToMessageId

      public String getReplyToMessageId()
    • send

      public Message send(String conversationId)
      Description copied from interface: MessageBuilder
      Creates and sends the message to the specified conversation.
      Specified by:
      send in interface MessageBuilder
      Parameters:
      conversationId - the id of the conversation to send the message to
      Returns:
      the created and sent message object