Interface ConversationBuilder
- All Superinterfaces:
Taggable
- All Known Implementing Classes:
ConversationBuilderImpl
public interface ConversationBuilder extends Taggable
A builder interface building
Conversation
objects. An instance might be received through
ConversationService.createConversationBuilder()
.- Author:
- Micha Kiener, Filip Hrisafov
-
Method Summary
Modifier and Type Method Description ConversationBuilder
addCandidateGroup(java.lang.String candidateGroup)
ConversationBuilder
addParticipant(java.lang.String participant)
ConversationBuilder
addTag(java.lang.String tag)
ConversationBuilder
assignedGroupId(java.lang.String assignedGroupId)
ConversationBuilder
assigneeId(java.lang.String assigneeId)
ConversationBuilder
avatarId(java.lang.String avatarId)
Optionally set the avatar information for this conversation.ConversationBuilder
candidateGroups(java.util.Set<java.lang.String> candidateGroups)
ConversationBuilder
conversationDefinitionId(java.lang.String conversationDefinitionId)
Set the id of the conversation definition.ConversationBuilder
conversationDefinitionKey(java.lang.String conversationDefinitionKey)
Set the key of the conversation definition.ConversationBuilder
description(java.lang.String description)
Set the optional description describing the reason or goal of the conversation in more details than the name.ConversationBuilder
externalId(java.lang.String externalId)
Set the external id of the conversation.ConversationBuilder
fallbackName(java.lang.String fallbackName)
Set the optional fallback name to be used, if there is no explicit name being set (e.g.java.lang.String
getAssignedGroupId()
java.lang.String
getAssigneeId()
java.lang.String
getAvatarId()
java.util.Set<java.lang.String>
getCandidateGroups()
java.lang.String
getConversationDefinitionId()
java.lang.String
getConversationDefinitionKey()
Returns the key that will be used to do the conversation definition lookup when creating the conversation.java.lang.String
getDescription()
java.lang.String
getExternalId()
java.lang.String
getFallbackName()
Optional name to display when there's no title.java.lang.String
getJoiningType()
java.lang.String
getName()
java.lang.String
getOwnerId()
java.lang.String
getParentId()
java.util.Set<java.lang.String>
getParticipants()
java.lang.String
getPermissionType()
java.lang.String
getReferenceDefinitionId()
java.lang.String
getReferenceId()
java.lang.String
getReferenceType()
java.lang.String
getSubType()
java.lang.String
getTenantId()
java.lang.String
getType()
ConversationBuilder
joiningType(java.lang.String joiningType)
Set the joining type used for this conversation.ConversationBuilder
name(java.lang.String name)
Set the optional name for this conversation.ConversationBuilder
ownerId(java.lang.String ownerId)
ConversationBuilder
parentId(java.lang.String parentId)
Set the id of the parent conversation, if this is a child conversation (e.g.ConversationBuilder
participants(java.util.Set<java.lang.String> participants)
ConversationBuilder
permissionType(java.lang.String permissionType)
Set the permission type to be used for this conversation.ConversationBuilder
referenceDefinitionId(java.lang.String referenceDefinitionId)
Set the reference definition id of the conversation pointing to for example a case or process definition id.ConversationBuilder
referenceId(java.lang.String referenceId)
Set the reference id of the conversation pointing to for example a case or process instance id.ConversationBuilder
referenceType(java.lang.String referenceType)
Set the reference type of the conversation pointing to for example a case or process instance type.Conversation
start()
Returns the newly created conversation object.Conversation
startWithPermissionCheck(java.lang.String userId)
Deprecated.Conversation
startWithPermissionCheck(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId)
Same asstart()
with an additional permission check that the user withuserId
is allowed to create the conversation.ConversationHolder
startWithReuse()
Tries to find a similar conversation, if found it would return that one.ConversationHolder
startWithReuseAndPermissionCheck(java.lang.String userId)
Deprecated.ConversationHolder
startWithReuseAndPermissionCheck(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId)
Same asstartWithReuse()
with an additional permission check that the user withuserId
is allowed to create the conversation.ConversationBuilder
subType(java.lang.String type)
Set the sub type of this conversation.ConversationBuilder
tags(java.util.Collection<java.lang.String> tags)
ConversationBuilder
tenantId(java.lang.String tenantId)
Optionally sets the tenantId for this conversation.ConversationBuilder
type(java.lang.String type)
Set the type for this conversation which has an impact on how participants might be joined, on permissions or other behaviors of the conversation.
-
Method Details
-
getExternalId
java.lang.String getExternalId()- See Also:
Conversation.getExternalId()
-
externalId
Set the external id of the conversation.- Parameters:
externalId
- the external id for the conversation
-
getParentId
java.lang.String getParentId()- See Also:
Conversation.getParentId()
-
parentId
Set the id of the parent conversation, if this is a child conversation (e.g. a topic, ticket or something similar).- Parameters:
parentId
- the id of the parent conversation- Returns:
- conversation builder for method chaining
-
getConversationDefinitionId
java.lang.String getConversationDefinitionId() -
conversationDefinitionId
Set the id of the conversation definition.- Parameters:
conversationDefinitionId
- the id of the conversation definition- Returns:
- conversation builder for method chaining
-
conversationDefinitionKey
Set the key of the conversation definition.- Parameters:
conversationDefinitionKey
- The key that will be used to find the latest version of the conversation definition.- Returns:
- conversation builder for method chaining
-
getConversationDefinitionKey
java.lang.String getConversationDefinitionKey()Returns the key that will be used to do the conversation definition lookup when creating the conversation. -
subType
Set the sub type of this conversation.- Parameters:
type
- the sub type of the conversation- Returns:
- conversation builder for method chaining
-
getSubType
java.lang.String getSubType()- See Also:
Conversation.getSubType()
-
type
Set the type for this conversation which has an impact on how participants might be joined, on permissions or other behaviors of the conversation. Setting the type of the builder will lead to evaluate thejoiningType(String)
andpermissionType(String)
of it as well. The type is a mandatory field and must be set explicitly using this method. As the joining and permission types are evaluated according the type within this method, make sure to explicitly set them (if necessary) AFTER setting the sub type, otherwise they will be overwritten with defaults.- Parameters:
type
- the sub type to set for this conversation- Returns:
- conversation builder for method chaining
- See Also:
Conversation.getType()
,ConversationTypes
-
getType
java.lang.String getType()- See Also:
Conversation.getType()
-
getPermissionType
java.lang.String getPermissionType()- See Also:
Conversation.getPermissionType()
-
permissionType
Set the permission type to be used for this conversation. If not set, it will be evaluated according type and sub type automatically. As the permission type is initialized automatically when setting thetype(String)
, make sure to set it explicitly using this method AFTER the type is set!- Parameters:
permissionType
- the permission type to be set for the conversation- Returns:
- conversation builder for method chaining
- See Also:
Conversation.getPermissionType()
,PermissionTypes
-
getJoiningType
java.lang.String getJoiningType()- See Also:
Conversation.getJoiningType()
-
joiningType
Set the joining type used for this conversation. If not set, it will be evaluated according type and sub type automatically. As the joining type is initialized automatically when setting thetype(String)
, make sure to set it explicitly using this method AFTER the type is set!- Parameters:
joiningType
- the joining type to be set for this conversation- Returns:
- conversation builder for method chaining
- See Also:
Conversation.getJoiningType()
,JoiningTypes
-
getName
java.lang.String getName()- See Also:
Conversation.getName()
-
name
Set the optional name for this conversation. Some sub types need the name (e.g. a desk or channel, etc), in this case the name is mandatory.- Parameters:
name
- the name for the created conversation- Returns:
- conversation builder for method chaining
-
getFallbackName
java.lang.String getFallbackName()Optional name to display when there's no title. By default, this will be the participant names separated by comas.- Returns:
- Optional conversation title
-
fallbackName
Set the optional fallback name to be used, if there is no explicit name being set (e.g. the name of the participants).- Parameters:
fallbackName
- the optional fallback name for the conversation- Returns:
- conversation builder for method chaining
- See Also:
Conversation.getFallbackName()
-
getDescription
java.lang.String getDescription()- See Also:
Conversation.getDescription()
-
description
Set the optional description describing the reason or goal of the conversation in more details than the name.- Parameters:
description
- the description for the conversation- Returns:
- conversation builder for method chaining
-
referenceId
Set the reference id of the conversation pointing to for example a case or process instance id.- Parameters:
referenceId
- The reference id pointing to for example a case or process instance id.- Returns:
- conversation builder for method chaining
-
getReferenceId
java.lang.String getReferenceId() -
referenceType
Set the reference type of the conversation pointing to for example a case or process instance type.- Parameters:
referenceType
- The reference id pointing to for example a case or process instance type.- Returns:
- conversation builder for method chaining
-
getReferenceType
java.lang.String getReferenceType() -
referenceDefinitionId
Set the reference definition id of the conversation pointing to for example a case or process definition id.- Parameters:
referenceDefinitionId
- The reference definition id pointing to for example a case or process definition id.- Returns:
- conversation builder for method chaining
-
getReferenceDefinitionId
java.lang.String getReferenceDefinitionId() -
getAvatarId
java.lang.String getAvatarId()- See Also:
Conversation.getAvatarId()
-
avatarId
Optionally set the avatar information for this conversation.- Parameters:
avatarId
- the optional information for the avatar of this conversation- Returns:
- conversation builder for method chaining
-
getOwnerId
java.lang.String getOwnerId() -
ownerId
-
getAssigneeId
java.lang.String getAssigneeId() -
assigneeId
-
getAssignedGroupId
java.lang.String getAssignedGroupId() -
assignedGroupId
-
getParticipants
java.util.Set<java.lang.String> getParticipants() -
participants
-
addParticipant
-
getCandidateGroups
java.util.Set<java.lang.String> getCandidateGroups() -
candidateGroups
-
addCandidateGroup
-
tags
-
addTag
-
tenantId
Optionally sets the tenantId for this conversation. If missing, it will take the tenantId of the current user.- Returns:
- conversation builder for method chaining
-
getTenantId
java.lang.String getTenantId()- Returns:
- The tenantId, if set before on this builder.
-
start
Conversation start()Returns the newly created conversation object. This actually performs the persistence of the conversation.- Returns:
- the newly built conversation object
-
startWithPermissionCheck
Deprecated.Same asstart()
with an additional permission check that the user withuserId
is allowed to create the conversation.- Parameters:
userId
- the id of the user that is creating the conversation- Returns:
- the newly created conversation
- Throws:
org.flowable.common.engine.api.FlowableForbiddenException
- if the user withuserId
does not have rights to create the conversation- See Also:
start()
-
startWithPermissionCheck
Conversation startWithPermissionCheck(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId)Same asstart()
with an additional permission check that the user withuserId
is allowed to create the conversation.- Parameters:
userId
- the id of the user that is creating the conversationuserGroupKeys
- the group keys of the user that is creating the conversationuserTenantId
- the tenant id of the user that is creating the conversation- Returns:
- the newly created conversation
- Throws:
org.flowable.common.engine.api.FlowableForbiddenException
- if the user withuserId
does not have rights to create the conversation- See Also:
start()
-
startWithReuse
ConversationHolder startWithReuse()Tries to find a similar conversation, if found it would return that one. Otherwise it will create a new conversation and persist it.- Returns:
- the already existing similar conversation, or the newly built conversation
-
startWithReuseAndPermissionCheck
Deprecated.Same asstartWithReuse()
with an additional permission check that the user withuserId
is allowed to create the conversation.- Parameters:
userId
- the id of the user that is creating the conversation- Returns:
- the already existing similar conversation, or the newly build conversation
- Throws:
org.flowable.common.engine.api.FlowableForbiddenException
- if the user withuserId
does not have rights to create the conversation
-
startWithReuseAndPermissionCheck
ConversationHolder startWithReuseAndPermissionCheck(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId)Same asstartWithReuse()
with an additional permission check that the user withuserId
is allowed to create the conversation.- Parameters:
userId
- the id of the user that is creating the conversationuserGroupKeys
- the group keys of the user that is creating the conversationuserTenantId
- the tenant id of the user that is creating the conversation- Returns:
- the already existing similar conversation, or the newly build conversation
- Throws:
org.flowable.common.engine.api.FlowableForbiddenException
- if the user withuserId
does not have rights to create the conversation
-