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 void
checkBeforeSend
(String type) Perform certain checks before sending the message.protected OutboundMessageDto
createOutboundMessage
(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 OutboundMessageDto
void
sendMediaMessage
(String mediaId) Perform sending of media messagevoid
Perform sending a normal text messageprotected abstract void
sendOutboundMessage
(OutboundMessageDto outboundMessage) protected String
This 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:ExternalMessageBuilder
The id of the external user to which the message should be send to- Specified by:
externalUserId
in interfaceExternalMessageBuilder
- Parameters:
externalUserId
- the external user id
-
businessAccountId
Description copied from interface:ExternalMessageBuilder
The id of the business account for the external user- Specified by:
businessAccountId
in interfaceExternalMessageBuilder
- Parameters:
businessAccountId
- the bussiness account id
-
messageId
Description copied from interface:ExternalMessageBuilder
The id of the message being send (can be used for logging purposes)- Specified by:
messageId
in interfaceExternalMessageBuilder
- Parameters:
messageId
- the message id
-
message
Description copied from interface:ExternalMessageBuilder
The contents of the message that needs to be send- Specified by:
message
in interfaceExternalMessageBuilder
- Parameters:
message
- the message content
-
sendMessage
public void sendMessage()Description copied from interface:ExternalMessageBuilder
Perform sending a normal text message- Specified by:
sendMessage
in interfaceExternalMessageBuilder
-
sendMediaMessage
Description copied from interface:ExternalMessageBuilder
Perform sending of media message- Specified by:
sendMediaMessage
in 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 theexternalUserId
andmessageId
have 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
-