Class WeChatTemplateMessageBot
java.lang.Object
com.flowable.engage.external.system.wechat.WeChatTemplateMessageBot
- All Implemented Interfaces:
com.flowable.action.api.bot.BotService
public class WeChatTemplateMessageBot
extends java.lang.Object
implements com.flowable.action.api.bot.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 org.springframework.jms.core.JmsMessageOperations
jmsMessagingOperations
protected MessageService
messageService
protected com.flowable.core.idm.api.PlatformIdentityService
platformIdentityService
protected com.flowable.template.api.TemplateService
templateService
protected com.flowable.core.idm.api.UserAccountService
userAccountService
static java.lang.String
WECHAT_TEMPLATE_ACTION_DEFINITION_KEY
static java.lang.String
WECHAT_TEMPLATE_KEY
protected WeChatProperties
weChatProperties
-
Constructor Summary
Constructors Constructor Description WeChatTemplateMessageBot(com.flowable.template.api.TemplateService templateService, ConversationService conversationService, ConversationPermissionService conversationPermissionService, MessageService messageService, com.flowable.core.idm.api.PlatformIdentityService platformIdentityService, org.springframework.jms.core.JmsMessageOperations jmsMessageOperations, WeChatProperties weChatProperties, com.flowable.core.idm.api.UserAccountService userAccountService)
-
Method Summary
Modifier and Type Method Description protected void
checkTemplateParametersSize(java.util.Map<java.lang.String,java.lang.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 java.util.Map<java.lang.String,java.lang.String>
extractTemplateParameters(java.util.List<com.flowable.template.api.repository.TemplateParameter> templateParameters, java.util.Map<java.lang.String,java.lang.Object> payload)
Extract all the template parameters from the payload.java.lang.String
getDescription()
java.lang.String
getKey()
java.lang.String
getName()
com.flowable.action.api.bot.BotActionResult
invokeBot(com.flowable.action.api.history.HistoricActionInstance actionInstance, com.flowable.action.api.repository.ActionDefinition actionDefinition, java.util.Map<java.lang.String,java.lang.Object> payload)
-
Field Details
-
WECHAT_TEMPLATE_KEY
public static final java.lang.String WECHAT_TEMPLATE_KEY- See Also:
- Constant Field Values
-
WECHAT_TEMPLATE_ACTION_DEFINITION_KEY
public static final java.lang.String WECHAT_TEMPLATE_ACTION_DEFINITION_KEY- See Also:
- Constant Field Values
-
templateService
protected final com.flowable.template.api.TemplateService templateService -
conversationService
-
conversationPermissionService
-
messageService
-
platformIdentityService
protected final com.flowable.core.idm.api.PlatformIdentityService platformIdentityService -
jmsMessagingOperations
protected final org.springframework.jms.core.JmsMessageOperations jmsMessagingOperations -
weChatProperties
-
userAccountService
protected final com.flowable.core.idm.api.UserAccountService userAccountService
-
-
Constructor Details
-
WeChatTemplateMessageBot
public WeChatTemplateMessageBot(com.flowable.template.api.TemplateService templateService, ConversationService conversationService, ConversationPermissionService conversationPermissionService, MessageService messageService, com.flowable.core.idm.api.PlatformIdentityService platformIdentityService, org.springframework.jms.core.JmsMessageOperations jmsMessageOperations, WeChatProperties weChatProperties, com.flowable.core.idm.api.UserAccountService userAccountService)
-
-
Method Details
-
getKey
public java.lang.String getKey()- Specified by:
getKey
in interfacecom.flowable.action.api.bot.BotService
-
getName
public java.lang.String getName()- Specified by:
getName
in interfacecom.flowable.action.api.bot.BotService
-
getDescription
public java.lang.String getDescription()- Specified by:
getDescription
in interfacecom.flowable.action.api.bot.BotService
-
invokeBot
public com.flowable.action.api.bot.BotActionResult invokeBot(com.flowable.action.api.history.HistoricActionInstance actionInstance, com.flowable.action.api.repository.ActionDefinition actionDefinition, java.util.Map<java.lang.String,java.lang.Object> payload)- Specified by:
invokeBot
in interfacecom.flowable.action.api.bot.BotService
-
extractTemplateParameters
protected java.util.Map<java.lang.String,java.lang.String> extractTemplateParameters(java.util.List<com.flowable.template.api.repository.TemplateParameter> templateParameters, java.util.Map<java.lang.String,java.lang.Object> payload)Extract all the template parameters from the payload.- Parameters:
templateParameters
-payload
-- Returns:
- a map of the extracted parameters
-
checkTemplateParametersSize
protected void checkTemplateParametersSize(java.util.Map<java.lang.String,java.lang.String> templateParameters)Check if the total size of all the template parameters do not exceed the maximum allowed size which is given by WeChat.- Parameters:
templateParameters
-
-