Class ConversationManagementBot

java.lang.Object
com.flowable.engage.engine.impl.bot.ConversationManagementBot
All Implemented Interfaces:
BotService

public class ConversationManagementBot extends Object implements BotService
A service bot supporting basic conversation management functionality like joining or dropping participants, archiving, etc.
Author:
Micha Kiener
  • Field Details

    • digitalAssistantUserId

      protected String digitalAssistantUserId
      The user id of the digital assistant used in ticket and desk conversations, defaults to the digital assistant user, if not changed.
    • conversationService

      protected final ConversationService conversationService
    • taskService

      protected final TaskService taskService
    • messageService

      protected final MessageService messageService
    • conversationPermissionService

      protected final ConversationPermissionService conversationPermissionService
    • identityService

      protected final PlatformIdentityService identityService
    • objectMapper

      protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
  • Constructor Details

  • Method Details

    • getKey

      public String getKey()
      Description copied from interface: BotService
      Returns the key of this bot which is used to link ActionDefinitions to this bot.
      Specified by:
      getKey in interface BotService
      Returns:
      the key of this bot, which needs to be unique amongst other bots
    • getName

      public String getName()
      Description copied from interface: BotService
      Returns the name of this bot, typically used as the label for it.
      Specified by:
      getName in interface BotService
      Returns:
      the name of this bot
    • getDescription

      public String getDescription()
      Description copied from interface: BotService
      Returns the optional description of this bot, describing its capabilities or prerequisites.
      Specified by:
      getDescription in interface BotService
      Returns:
      the optional description of this bot
    • invokeBot

      public BotActionResult invokeBot(HistoricActionInstance actionInstance, ActionDefinition actionDefinition, Map<String,Object> payload)
      Description copied from interface: BotService
      Whenever 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 use ContextAwareBotService instead, to avoid overriding an empty method.

      Specified by:
      invokeBot in interface BotService
      Parameters:
      actionInstance - the action instance to run
      actionDefinition - the action definition where the action instance is based on
      payload - 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

      protected BotActionResult archiveConversation(String conversationId)
    • validateArchiveConversationPermission

      protected void validateArchiveConversationPermission(String conversationId)
    • handleCreateNewTopicAction

      protected BotActionResult handleCreateNewTopicAction(String conversationId, String currentUserId, Map<String,Object> payload, String userIdForPermissionChecks)
    • handleCreateNewConversationTask

      protected BotActionResult handleCreateNewConversationTask(String conversationId, String currentUserId, Map<String,Object> payload)
    • createTask

      protected String createTask(String conversationId, String subject, String description, Date dueDate, String ownerId, String assigneeId)
    • getConversationName

      protected String getConversationName(Conversation conversation)
    • getStringValueOrNull

      protected String getStringValueOrNull(Object value)
    • getBooleanValueOrNull

      protected Boolean getBooleanValueOrNull(Object value)
    • getBooleanValueOrDefault

      protected Boolean getBooleanValueOrDefault(Object value, Boolean defaultValue)
    • getIntegerValueOrNull

      protected Integer getIntegerValueOrNull(Object value)
    • getUserName

      public String getUserName(String userId, String tenantId)
    • getDigitalAssistantUserId

      public String getDigitalAssistantUserId()
    • setDigitalAssistantUserId

      public void setDigitalAssistantUserId(String digitalAssistantUserId)