Class ConversationManagementBot
java.lang.Object
com.flowable.engage.engine.impl.bot.ConversationManagementBot
- All Implemented Interfaces:
com.flowable.action.api.bot.BotService
public class ConversationManagementBot
extends java.lang.Object
implements com.flowable.action.api.bot.BotService
A service bot supporting basic conversation management functionality like joining or dropping participants, archiving, etc.
- Author:
- Micha Kiener
-
Field Summary
Fields Modifier and Type Field Description protected ConversationPermissionService
conversationPermissionService
protected ConversationService
conversationService
protected java.lang.String
digitalAssistantUserId
The user id of the digital assistant used in ticket and desk conversations, defaults to the digital assistant user, if not changed.protected com.flowable.core.idm.api.PlatformIdentityService
identityService
protected MessageService
messageService
protected com.fasterxml.jackson.databind.ObjectMapper
objectMapper
protected org.flowable.engine.TaskService
taskService
-
Constructor Summary
Constructors Constructor Description ConversationManagementBot(ConversationService conversationService, org.flowable.engine.TaskService taskService, MessageService messageService, ConversationPermissionService conversationPermissionService, com.flowable.core.idm.api.PlatformIdentityService identityService, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
Method Summary
Modifier and Type Method Description protected com.flowable.action.api.bot.BotActionResult
addParticipantsToConversation(java.util.Collection<java.lang.String> participantIds, java.lang.String conversationId, java.util.Map<java.lang.String,java.lang.Object> payload)
protected com.flowable.action.api.bot.BotActionResult
archiveConversation(java.lang.String conversationId)
protected java.lang.String
createTask(java.lang.String conversationId, java.lang.String subject, java.lang.String description, java.util.Date dueDate, java.lang.String ownerId, java.lang.String assigneeId)
protected java.lang.Boolean
getBooleanValueOrDefault(java.lang.Object value, java.lang.Boolean defaultValue)
protected java.lang.Boolean
getBooleanValueOrNull(java.lang.Object value)
protected java.lang.String
getConversationName(Conversation conversation)
java.lang.String
getDescription()
java.lang.String
getDigitalAssistantUserId()
protected java.lang.Integer
getIntegerValueOrNull(java.lang.Object value)
java.lang.String
getKey()
java.lang.String
getName()
protected java.lang.String
getStringValueOrNull(java.lang.Object value)
java.lang.String
getUserName(java.lang.String userId, java.lang.String tenantId)
protected com.flowable.action.api.bot.BotActionResult
handleCreateNewConversationTask(java.lang.String conversationId, java.lang.String currentUserId, java.util.Map<java.lang.String,java.lang.Object> payload)
protected com.flowable.action.api.bot.BotActionResult
handleCreateNewTopicAction(java.lang.String conversationId, java.lang.String currentUserId, java.util.Map<java.lang.String,java.lang.Object> payload, java.lang.String userIdForPermissionChecks)
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)
protected com.flowable.action.api.bot.BotActionResult
removeParticipantsFromConversation(java.util.Collection<java.lang.String> participantIds, java.lang.String conversationId)
void
setDigitalAssistantUserId(java.lang.String digitalAssistantUserId)
protected void
validateAddParticipantsPermission(java.util.Collection<java.lang.String> participantIds, java.lang.String conversationId)
protected void
validateArchiveConversationPermission(java.lang.String conversationId)
protected void
validateDropParticipantsPermission(java.util.Collection<java.lang.String> participantIds, java.lang.String conversationId)
-
Field Details
-
digitalAssistantUserId
protected java.lang.String digitalAssistantUserIdThe user id of the digital assistant used in ticket and desk conversations, defaults to the digital assistant user, if not changed. -
conversationService
-
taskService
protected final org.flowable.engine.TaskService taskService -
messageService
-
conversationPermissionService
-
identityService
protected final com.flowable.core.idm.api.PlatformIdentityService identityService -
objectMapper
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Details
-
ConversationManagementBot
public ConversationManagementBot(ConversationService conversationService, org.flowable.engine.TaskService taskService, MessageService messageService, ConversationPermissionService conversationPermissionService, com.flowable.core.idm.api.PlatformIdentityService identityService, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
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
-
addParticipantsToConversation
protected com.flowable.action.api.bot.BotActionResult addParticipantsToConversation(java.util.Collection<java.lang.String> participantIds, java.lang.String conversationId, java.util.Map<java.lang.String,java.lang.Object> payload) -
validateAddParticipantsPermission
protected void validateAddParticipantsPermission(java.util.Collection<java.lang.String> participantIds, java.lang.String conversationId) -
removeParticipantsFromConversation
protected com.flowable.action.api.bot.BotActionResult removeParticipantsFromConversation(java.util.Collection<java.lang.String> participantIds, java.lang.String conversationId) -
validateDropParticipantsPermission
protected void validateDropParticipantsPermission(java.util.Collection<java.lang.String> participantIds, java.lang.String conversationId) -
archiveConversation
protected com.flowable.action.api.bot.BotActionResult archiveConversation(java.lang.String conversationId) -
validateArchiveConversationPermission
protected void validateArchiveConversationPermission(java.lang.String conversationId) -
handleCreateNewTopicAction
protected com.flowable.action.api.bot.BotActionResult handleCreateNewTopicAction(java.lang.String conversationId, java.lang.String currentUserId, java.util.Map<java.lang.String,java.lang.Object> payload, java.lang.String userIdForPermissionChecks) -
handleCreateNewConversationTask
protected com.flowable.action.api.bot.BotActionResult handleCreateNewConversationTask(java.lang.String conversationId, java.lang.String currentUserId, java.util.Map<java.lang.String,java.lang.Object> payload) -
createTask
protected java.lang.String createTask(java.lang.String conversationId, java.lang.String subject, java.lang.String description, java.util.Date dueDate, java.lang.String ownerId, java.lang.String assigneeId) -
getConversationName
-
getStringValueOrNull
protected java.lang.String getStringValueOrNull(java.lang.Object value) -
getBooleanValueOrNull
protected java.lang.Boolean getBooleanValueOrNull(java.lang.Object value) -
getBooleanValueOrDefault
protected java.lang.Boolean getBooleanValueOrDefault(java.lang.Object value, java.lang.Boolean defaultValue) -
getIntegerValueOrNull
protected java.lang.Integer getIntegerValueOrNull(java.lang.Object value) -
getUserName
public java.lang.String getUserName(java.lang.String userId, java.lang.String tenantId) -
getDigitalAssistantUserId
public java.lang.String getDigitalAssistantUserId() -
setDigitalAssistantUserId
public void setDigitalAssistantUserId(java.lang.String digitalAssistantUserId)
-