Class WeChatTemplateMessageBot
java.lang.Object
com.flowable.engage.external.system.wechat.WeChatTemplateMessageBot
- All Implemented Interfaces:
BotService
An action bot handling the action definition to send a WeChat template message based on a template handled by the template engine.
- Author:
- Micha Kiener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConversationPermissionService
protected final ConversationService
protected final JmsMessageOperations
protected final MessageService
protected final PlatformIdentityService
protected final TemplateService
protected final UserAccountService
static final String
static final String
protected final WeChatProperties
-
Constructor Summary
ConstructorsConstructorDescriptionWeChatTemplateMessageBot
(TemplateService templateService, ConversationService conversationService, ConversationPermissionService conversationPermissionService, MessageService messageService, PlatformIdentityService platformIdentityService, JmsMessageOperations jmsMessageOperations, WeChatProperties weChatProperties, UserAccountService userAccountService) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkTemplateParametersSize
(Map<String, String> templateParameters) Check if the total size of all the template parameters do not exceed the maximum allowed size which is given by WeChat.extractTemplateParameters
(List<TemplateParameter> templateParameters, Map<String, Object> payload) Extract all the template parameters from the payload.getKey()
getName()
invokeBot
(HistoricActionInstance actionInstance, ActionDefinition actionDefinition, Map<String, Object> payload) protected void
sendExternalTemplateMessage
(Conversation conversation, Message internalMessage, Map<String, String> templateParameters, String weChatTemplateId) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.flowable.action.api.bot.BotService
invokeBot
-
Field Details
-
WECHAT_TEMPLATE_KEY
- See Also:
-
WECHAT_TEMPLATE_ACTION_DEFINITION_KEY
- See Also:
-
templateService
-
conversationService
-
conversationPermissionService
-
messageService
-
platformIdentityService
-
jmsMessagingOperations
-
weChatProperties
-
userAccountService
-
-
Constructor Details
-
WeChatTemplateMessageBot
public WeChatTemplateMessageBot(TemplateService templateService, ConversationService conversationService, ConversationPermissionService conversationPermissionService, MessageService messageService, PlatformIdentityService platformIdentityService, JmsMessageOperations jmsMessageOperations, WeChatProperties weChatProperties, UserAccountService userAccountService)
-
-
Method Details
-
getKey
- Specified by:
getKey
in interfaceBotService
-
getName
- Specified by:
getName
in interfaceBotService
-
getDescription
- Specified by:
getDescription
in interfaceBotService
-
invokeBot
public BotActionResult invokeBot(HistoricActionInstance actionInstance, ActionDefinition actionDefinition, Map<String, Object> payload) - Specified by:
invokeBot
in interfaceBotService
-
sendExternalTemplateMessage
-
extractTemplateParameters
protected Map<String,String> extractTemplateParameters(List<TemplateParameter> templateParameters, Map<String, Object> payload) Extract all the template parameters from the payload.- Parameters:
templateParameters
-payload
-- Returns:
- a map of the extracted parameters
-
checkTemplateParametersSize
Check if the total size of all the template parameters do not exceed the maximum allowed size which is given by WeChat.- Parameters:
templateParameters
-
-