Interface ContextAwareBotService

All Superinterfaces:
BotService
All Known Implementing Classes:
ScriptEvaluationBot

public interface ContextAwareBotService extends BotService
The context object aware variant of BotService.

Adapts to the new BotService.invokeBot(BotInvocationContext) method and does not force to implement the discouraged invokeBot(HistoricActionInstance, ActionDefinition, Map) method. Override BotService.getName() and BotService.getDescription() if required.

Author:
Arthur Hupka-Merle
  • Method Details

    • invokeBot

      default 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
    • invokeBot

      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.
      Specified by:
      invokeBot in interface BotService
      Parameters:
      context - context objects related to the invocation
      Returns:
      the result of invoking the action