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 Details

  • Constructor Details

    • MessageBuilderImpl

      public MessageBuilderImpl​(org.flowable.common.engine.impl.interceptor.CommandExecutor commandExecutor)
  • Method Details

    • creatorId

      public MessageBuilder creatorId​(java.lang.String creatorId)
      Specified by:
      creatorId in interface MessageBuilder
    • senderId

      public MessageBuilder senderId​(java.lang.String senderId)
      Specified by:
      senderId in interface MessageBuilder
    • updaterId

      public MessageBuilder updaterId​(java.lang.String updaterId)
      Specified by:
      updaterId in interface MessageBuilder
    • externalId

      public MessageBuilder externalId​(java.lang.String externalId)
      Specified by:
      externalId in interface MessageBuilder
    • actionInstanceId

      public MessageBuilder actionInstanceId​(java.lang.String actionInstanceId)
      Specified by:
      actionInstanceId in interface MessageBuilder
    • actionDefinitionId

      public MessageBuilder actionDefinitionId​(java.lang.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​(java.lang.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​(java.lang.String mainContent)
      Specified by:
      mainContent in interface MessageBuilder
    • 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 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​(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 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​(java.lang.String mainContentType)
      Specified by:
      mainContentType in interface MessageBuilder
    • media

      public MessageBuilder media​(org.flowable.content.api.ContentItem contentItem, java.io.InputStream contentStream)
      Specified by:
      media in interface MessageBuilder
    • media

      public MessageBuilder media​(org.flowable.content.api.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​(java.lang.String type)
      Specified by:
      type in interface MessageBuilder
    • subType

      public MessageBuilder subType​(java.lang.String subType)
      Specified by:
      subType in interface MessageBuilder
    • privateMessage

      public MessageBuilder privateMessage​(java.lang.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​(java.lang.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​(java.util.List<java.lang.String> tags)
      Specified by:
      tags in interface MessageBuilder
    • addTag

      public MessageBuilder addTag​(java.lang.String tag)
      Specified by:
      addTag in interface MessageBuilder
    • addTags

      public MessageBuilder addTags​(java.util.List<java.lang.String> tags)
      Specified by:
      addTags in interface MessageBuilder
    • replyToMessageId

      public MessageBuilder replyToMessageId​(java.lang.String messageId)
      Specified by:
      replyToMessageId in interface MessageBuilder
    • scope

      public MessageBuilder scope​(java.lang.String scopeId, java.lang.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 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

      public Message send​(java.lang.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