Class UserManagementBot
java.lang.Object
com.flowable.platform.service.bot.UserManagementBot
- All Implemented Interfaces:
BotService
public class UserManagementBot extends java.lang.Object implements BotService
Implements a bot managing user based action definitions.
- Author:
- Micha Kiener
-
Field Summary
Fields Modifier and Type Field Description protected com.flowable.core.idm.api.PlatformIdentityService
platformIdentityService
protected com.flowable.core.idm.api.UserPermissionService
userPermissionService
-
Constructor Summary
Constructors Constructor Description UserManagementBot(com.flowable.core.idm.api.PlatformIdentityService platformIdentityService, com.flowable.core.idm.api.UserPermissionService userPermissionService)
-
Method Summary
Modifier and Type Method Description java.lang.String
getDescription()
Returns the optional description of this bot, describing its capabilities or prerequisites.java.lang.String
getKey()
Returns the key of this bot which is used to linkActionDefinition
s to this bot.java.lang.String
getName()
Returns the name of this bot, typically used as the label for it.BotActionResult
invokeBot(HistoricActionInstance actionInstance, ActionDefinition actionDefinition, java.util.Map<java.lang.String,java.lang.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 static void
verifyHasPermission(java.util.function.Supplier<java.util.Optional<java.lang.String>> messageSupplier)
-
Field Details
-
platformIdentityService
protected final com.flowable.core.idm.api.PlatformIdentityService platformIdentityService -
userPermissionService
protected final com.flowable.core.idm.api.UserPermissionService userPermissionService
-
-
Constructor Details
-
UserManagementBot
public UserManagementBot(com.flowable.core.idm.api.PlatformIdentityService platformIdentityService, com.flowable.core.idm.api.UserPermissionService userPermissionService)
-
-
Method Details
-
getKey
public java.lang.String getKey()Description copied from interface:BotService
Returns the key of this bot which is used to linkActionDefinition
s to this bot.- Specified by:
getKey
in interfaceBotService
- Returns:
- the key of this bot, which needs to be unique amongst other bots
-
getName
public java.lang.String getName()Description copied from interface:BotService
Returns the name of this bot, typically used as the label for it.- Specified by:
getName
in interfaceBotService
- Returns:
- the name of this bot
-
getDescription
public java.lang.String getDescription()Description copied from interface:BotService
Returns the optional description of this bot, describing its capabilities or prerequisites.- Specified by:
getDescription
in interfaceBotService
- Returns:
- the optional description of this bot
-
invokeBot
public BotActionResult invokeBot(HistoricActionInstance actionInstance, ActionDefinition actionDefinition, java.util.Map<java.lang.String,java.lang.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.- Specified by:
invokeBot
in 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- Returns:
- the result of invoking the action
-
verifyHasPermission
protected static void verifyHasPermission(java.util.function.Supplier<java.util.Optional<java.lang.String>> messageSupplier)
-