Class WeChatTemplateMessageBot
- java.lang.Object
-
- com.flowable.engage.external.system.wechat.WeChatTemplateMessageBot
-
- All Implemented Interfaces:
BotService
public class WeChatTemplateMessageBot extends Object implements 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
Fields Modifier and Type Field Description protected ConversationPermissionService
conversationPermissionService
protected ConversationService
conversationService
protected JmsMessageOperations
jmsMessagingOperations
protected MessageService
messageService
protected PlatformIdentityService
platformIdentityService
protected TemplateService
templateService
protected UserAccountService
userAccountService
static String
WECHAT_TEMPLATE_ACTION_DEFINITION_KEY
static String
WECHAT_TEMPLATE_KEY
protected WeChatProperties
weChatProperties
-
Constructor Summary
Constructors Constructor Description WeChatTemplateMessageBot(TemplateService templateService, ConversationService conversationService, ConversationPermissionService conversationPermissionService, MessageService messageService, PlatformIdentityService platformIdentityService, JmsMessageOperations jmsMessageOperations, WeChatProperties weChatProperties, UserAccountService userAccountService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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.protected Map<String,String>
extractTemplateParameters(List<TemplateParameter> templateParameters, Map<String,Object> payload)
Extract all the template parameters from the payload.String
getDescription()
String
getKey()
String
getName()
BotActionResult
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 Detail
-
WECHAT_TEMPLATE_KEY
public static final String WECHAT_TEMPLATE_KEY
- See Also:
- Constant Field Values
-
WECHAT_TEMPLATE_ACTION_DEFINITION_KEY
public static final String WECHAT_TEMPLATE_ACTION_DEFINITION_KEY
- See Also:
- Constant Field Values
-
templateService
protected final TemplateService templateService
-
conversationService
protected final ConversationService conversationService
-
conversationPermissionService
protected final ConversationPermissionService conversationPermissionService
-
messageService
protected final MessageService messageService
-
platformIdentityService
protected final PlatformIdentityService platformIdentityService
-
jmsMessagingOperations
protected final JmsMessageOperations jmsMessagingOperations
-
weChatProperties
protected final WeChatProperties weChatProperties
-
userAccountService
protected final UserAccountService userAccountService
-
-
Constructor Detail
-
WeChatTemplateMessageBot
public WeChatTemplateMessageBot(TemplateService templateService, ConversationService conversationService, ConversationPermissionService conversationPermissionService, MessageService messageService, PlatformIdentityService platformIdentityService, JmsMessageOperations jmsMessageOperations, WeChatProperties weChatProperties, UserAccountService userAccountService)
-
-
Method Detail
-
getKey
public String getKey()
- Specified by:
getKey
in interfaceBotService
-
getName
public String getName()
- Specified by:
getName
in interfaceBotService
-
getDescription
public String getDescription()
- Specified by:
getDescription
in interfaceBotService
-
invokeBot
public BotActionResult invokeBot(HistoricActionInstance actionInstance, ActionDefinition actionDefinition, Map<String,Object> payload)
- Specified by:
invokeBot
in interfaceBotService
-
sendExternalTemplateMessage
protected void sendExternalTemplateMessage(Conversation conversation, Message internalMessage, Map<String,String> templateParameters, String weChatTemplateId)
-
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
-
-