Class BaseExternalMessageBuilder
java.lang.Object
com.flowable.engage.external.system.common.BaseExternalMessageBuilder
- All Implemented Interfaces:
ExternalMessageBuilder
- Direct Known Subclasses:
LineExternalMessageBuilder,WeChatExternalMessageBuilder,WhatsAppExternalMessageBuilder
Base class that can be used by different external system provider
to provide an implementation for the sending of the outbound message.
- Author:
- Filip Hrisafov
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbusinessAccountId(String businessAccountId) The id of the business account for the external userprotected voidcheckBeforeSend(String type) Perform certain checks before sending the message.protected OutboundMessageDtocreateOutboundMessage(String type) externalUserId(String externalUserId) The id of the external user to which the message should be send toThe contents of the message that needs to be sendThe id of the message being send (can be used for logging purposes)protected OutboundMessageDtovoidsendMediaMessage(String mediaId) Perform sending of media messagevoidPerform sending a normal text messageprotected abstract voidsendOutboundMessage(OutboundMessageDto outboundMessage) protected StringThis method is invoked when the content for the outbound message is create.
-
Field Details
-
externalUserId
-
businessAccountId
-
messageId
-
message
-
-
Constructor Details
-
BaseExternalMessageBuilder
public BaseExternalMessageBuilder()
-
-
Method Details
-
externalUserId
Description copied from interface:ExternalMessageBuilderThe id of the external user to which the message should be send to- Specified by:
externalUserIdin interfaceExternalMessageBuilder- Parameters:
externalUserId- the external user id
-
businessAccountId
Description copied from interface:ExternalMessageBuilderThe id of the business account for the external user- Specified by:
businessAccountIdin interfaceExternalMessageBuilder- Parameters:
businessAccountId- the bussiness account id
-
messageId
Description copied from interface:ExternalMessageBuilderThe id of the message being send (can be used for logging purposes)- Specified by:
messageIdin interfaceExternalMessageBuilder- Parameters:
messageId- the message id
-
message
Description copied from interface:ExternalMessageBuilderThe contents of the message that needs to be send- Specified by:
messagein interfaceExternalMessageBuilder- Parameters:
message- the message content
-
sendMessage
public void sendMessage()Description copied from interface:ExternalMessageBuilderPerform sending a normal text message- Specified by:
sendMessagein interfaceExternalMessageBuilder
-
sendMediaMessage
Description copied from interface:ExternalMessageBuilderPerform sending of media message- Specified by:
sendMediaMessagein interfaceExternalMessageBuilder- Parameters:
mediaId- the id of the media that is being sent
-
checkBeforeSend
Perform certain checks before sending the message. By default this checks that theexternalUserIdandmessageIdhave been set.- Parameters:
type- the type of message that is being send
-
sendOutboundMessage
-
createOutboundMessage
-
newOutboundMessageDto
-
validateAndCreateMessageContent
This method is invoked when the content for the outbound message is create. It can be used to perform validations and to modify the content if it is required. By default this methods appends the display name to the message.- Parameters:
type- the type of the message for which the content is being created- Returns:
- the content that should be used to send the message
-