Class ConversationManagementBot
java.lang.Object
com.flowable.engage.engine.impl.bot.ConversationManagementBot
- All Implemented Interfaces:
BotService
A service bot supporting basic conversation management functionality like joining or dropping participants, archiving, etc.
- Author:
- Micha Kiener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConversationPermissionServiceprotected final ConversationServiceprotected StringThe user id of the digital assistant used in ticket and desk conversations, defaults to the digital assistant user, if not changed.protected final PlatformIdentityServiceprotected final MessageServiceprotected final com.fasterxml.jackson.databind.ObjectMapperprotected final TaskService -
Constructor Summary
ConstructorsConstructorDescriptionConversationManagementBot(ConversationService conversationService, TaskService taskService, MessageService messageService, ConversationPermissionService conversationPermissionService, PlatformIdentityService identityService, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionprotected BotActionResultaddParticipantsToConversation(Collection<String> participantIds, String conversationId, Map<String, Object> payload) protected BotActionResultarchiveConversation(String conversationId) protected StringcreateTask(String conversationId, String subject, String description, Date dueDate, String ownerId, String assigneeId) protected BooleangetBooleanValueOrDefault(Object value, Boolean defaultValue) protected BooleangetBooleanValueOrNull(Object value) protected StringgetConversationName(Conversation conversation) Returns the optional description of this bot, describing its capabilities or prerequisites.protected IntegergetIntegerValueOrNull(Object value) getKey()Returns the key of this bot which is used to linkActionDefinitions to this bot.getName()Returns the name of this bot, typically used as the label for it.protected StringgetStringValueOrNull(Object value) getUserName(String userId, String tenantId) protected BotActionResulthandleCreateNewConversationTask(String conversationId, String currentUserId, Map<String, Object> payload) protected BotActionResulthandleCreateNewTopicAction(String conversationId, String currentUserId, Map<String, Object> payload, String userIdForPermissionChecks) invokeBot(HistoricActionInstance actionInstance, ActionDefinition actionDefinition, Map<String, Object> payload) Whenever an action definition is triggered, an action instance is created and this method is invoked in order to execute the action.protected BotActionResultremoveParticipantsFromConversation(Collection<String> participantIds, String conversationId) voidsetDigitalAssistantUserId(String digitalAssistantUserId) protected voidvalidateAddParticipantsPermission(Collection<String> participantIds, String conversationId) protected voidvalidateArchiveConversationPermission(String conversationId) protected voidvalidateDropParticipantsPermission(Collection<String> participantIds, String conversationId) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.flowable.action.api.bot.BotService
invokeBot
-
Field Details
-
digitalAssistantUserId
The user id of the digital assistant used in ticket and desk conversations, defaults to the digital assistant user, if not changed. -
conversationService
-
taskService
-
messageService
-
conversationPermissionService
-
identityService
-
objectMapper
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Details
-
ConversationManagementBot
public ConversationManagementBot(ConversationService conversationService, TaskService taskService, MessageService messageService, ConversationPermissionService conversationPermissionService, PlatformIdentityService identityService, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
getKey
Description copied from interface:BotServiceReturns the key of this bot which is used to linkActionDefinitions to this bot.- Specified by:
getKeyin interfaceBotService- Returns:
- the key of this bot, which needs to be unique amongst other bots
-
getName
Description copied from interface:BotServiceReturns the name of this bot, typically used as the label for it.- Specified by:
getNamein interfaceBotService- Returns:
- the name of this bot
-
getDescription
Description copied from interface:BotServiceReturns the optional description of this bot, describing its capabilities or prerequisites.- Specified by:
getDescriptionin interfaceBotService- Returns:
- the optional description of this bot
-
invokeBot
public BotActionResult invokeBot(HistoricActionInstance actionInstance, ActionDefinition actionDefinition, Map<String, Object> payload) Description copied from interface:BotServiceWhenever an action definition is triggered, an action instance is created and this method is invoked in order to execute the action. You need to provide an action result according the execution and follow up needed.API NOTE: Prefer overriding
BotService.invokeBot(BotInvocationContext)instead and leave this empty. Alternatively useContextAwareBotServiceinstead, to avoid overriding an empty method.- Specified by:
invokeBotin interfaceBotService- Parameters:
actionInstance- the action instance to runactionDefinition- the action definition where the action instance is based onpayload- the optional payload containing the necessary information to run the action
-
addParticipantsToConversation
protected BotActionResult addParticipantsToConversation(Collection<String> participantIds, String conversationId, Map<String, Object> payload) -
validateAddParticipantsPermission
protected void validateAddParticipantsPermission(Collection<String> participantIds, String conversationId) -
removeParticipantsFromConversation
protected BotActionResult removeParticipantsFromConversation(Collection<String> participantIds, String conversationId) -
validateDropParticipantsPermission
protected void validateDropParticipantsPermission(Collection<String> participantIds, String conversationId) -
archiveConversation
-
validateArchiveConversationPermission
-
handleCreateNewTopicAction
-
handleCreateNewConversationTask
-
createTask
-
getConversationName
-
getStringValueOrNull
-
getBooleanValueOrNull
-
getBooleanValueOrDefault
-
getIntegerValueOrNull
-
getUserName
-
getDigitalAssistantUserId
-
setDigitalAssistantUserId
-