Class ConversationBuilderImpl
java.lang.Object
com.flowable.engage.engine.impl.conversation.ConversationBuilderImpl
- All Implemented Interfaces:
Taggable
,ConversationBuilder
public class ConversationBuilderImpl extends java.lang.Object implements ConversationBuilder
- Author:
- Filip Hrisafov, Joram Barrez
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ConversationBuilderImpl.StartConversationWithChecksCmd<T>
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
assignedGroupId
protected java.lang.String
assigneeId
protected java.lang.String
avatarId
protected java.util.Set<java.lang.String>
candidateGroups
protected java.lang.String
conversationDefinitionId
protected java.lang.String
conversationDefinitionKey
protected ConversationServiceImpl
conversationService
protected java.lang.String
description
protected EngageEngineConfiguration
engageEngineConfiguration
protected java.lang.String
externalId
protected java.lang.String
fallbackName
protected java.lang.String
joiningType
protected java.lang.String
name
protected java.lang.String
ownerId
protected java.lang.String
parentId
protected java.util.Set<java.lang.String>
participants
protected java.lang.String
permissionType
protected java.lang.String
referenceDefinitionId
protected java.lang.String
referenceId
protected java.lang.String
referenceType
protected java.lang.String
subType
protected java.util.List<java.lang.String>
tags
protected java.lang.String
tenantId
protected java.lang.String
type
-
Constructor Summary
Constructors Constructor Description ConversationBuilderImpl(ConversationServiceImpl conversationService, EngageEngineConfiguration engageEngineConfiguration)
-
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.java.lang.String
determineTenantId(org.flowable.common.engine.impl.interceptor.CommandContext commandContext)
protected void
enrichWithConversationDefinition()
protected void
enrichWithConversationDefinition(org.flowable.common.engine.impl.interceptor.CommandContext commandContext)
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.util.List<java.lang.String>
getTags()
Returns the optional list of tags for this object.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 asConversationBuilder.start()
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 asConversationBuilder.startWithReuse()
with an additional permission check that the user withuserId
is allowed to create the conversation.ConversationBuilder
subType(java.lang.String subType)
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.
-
Field Details
-
conversationService
-
engageEngineConfiguration
-
externalId
protected java.lang.String externalId -
parentId
protected java.lang.String parentId -
type
protected java.lang.String type -
subType
protected java.lang.String subType -
permissionType
protected java.lang.String permissionType -
joiningType
protected java.lang.String joiningType -
name
protected java.lang.String name -
fallbackName
protected java.lang.String fallbackName -
conversationDefinitionId
protected java.lang.String conversationDefinitionId -
conversationDefinitionKey
protected java.lang.String conversationDefinitionKey -
description
protected java.lang.String description -
referenceId
protected java.lang.String referenceId -
referenceType
protected java.lang.String referenceType -
referenceDefinitionId
protected java.lang.String referenceDefinitionId -
avatarId
protected java.lang.String avatarId -
ownerId
protected java.lang.String ownerId -
assigneeId
protected java.lang.String assigneeId -
assignedGroupId
protected java.lang.String assignedGroupId -
participants
protected java.util.Set<java.lang.String> participants -
candidateGroups
protected java.util.Set<java.lang.String> candidateGroups -
tags
protected java.util.List<java.lang.String> tags -
tenantId
protected java.lang.String tenantId
-
-
Constructor Details
-
ConversationBuilderImpl
public ConversationBuilderImpl(ConversationServiceImpl conversationService, EngageEngineConfiguration engageEngineConfiguration)
-
-
Method Details
-
getExternalId
public java.lang.String getExternalId()- Specified by:
getExternalId
in interfaceConversationBuilder
- See Also:
Conversation.getExternalId()
-
externalId
Description copied from interface:ConversationBuilder
Set the external id of the conversation.- Specified by:
externalId
in interfaceConversationBuilder
- Parameters:
externalId
- the external id for the conversation
-
getParentId
public java.lang.String getParentId()- Specified by:
getParentId
in interfaceConversationBuilder
- See Also:
Conversation.getParentId()
-
parentId
Description copied from interface:ConversationBuilder
Set the id of the parent conversation, if this is a child conversation (e.g. a topic, ticket or something similar).- Specified by:
parentId
in interfaceConversationBuilder
- Parameters:
parentId
- the id of the parent conversation- Returns:
- conversation builder for method chaining
-
getType
public java.lang.String getType()- Specified by:
getType
in interfaceConversationBuilder
- See Also:
Conversation.getType()
-
subType
Description copied from interface:ConversationBuilder
Set the sub type of this conversation.- Specified by:
subType
in interfaceConversationBuilder
- Parameters:
subType
- the sub type of the conversation- Returns:
- conversation builder for method chaining
-
getSubType
public java.lang.String getSubType()- Specified by:
getSubType
in interfaceConversationBuilder
- See Also:
Conversation.getSubType()
-
type
Description copied from interface:ConversationBuilder
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 theConversationBuilder.joiningType(String)
andConversationBuilder.permissionType(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.- Specified by:
type
in interfaceConversationBuilder
- Parameters:
type
- the sub type to set for this conversation- Returns:
- conversation builder for method chaining
- See Also:
Conversation.getType()
,ConversationTypes
-
getPermissionType
public java.lang.String getPermissionType()- Specified by:
getPermissionType
in interfaceConversationBuilder
- See Also:
Conversation.getPermissionType()
-
permissionType
Description copied from interface:ConversationBuilder
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 theConversationBuilder.type(String)
, make sure to set it explicitly using this method AFTER the type is set!- Specified by:
permissionType
in interfaceConversationBuilder
- Parameters:
permissionType
- the permission type to be set for the conversation- Returns:
- conversation builder for method chaining
- See Also:
Conversation.getPermissionType()
,PermissionTypes
-
getJoiningType
public java.lang.String getJoiningType()- Specified by:
getJoiningType
in interfaceConversationBuilder
- See Also:
Conversation.getJoiningType()
-
joiningType
Description copied from interface:ConversationBuilder
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 theConversationBuilder.type(String)
, make sure to set it explicitly using this method AFTER the type is set!- Specified by:
joiningType
in interfaceConversationBuilder
- Parameters:
joiningType
- the joining type to be set for this conversation- Returns:
- conversation builder for method chaining
- See Also:
Conversation.getJoiningType()
,JoiningTypes
-
getName
public java.lang.String getName()- Specified by:
getName
in interfaceConversationBuilder
- See Also:
Conversation.getName()
-
name
Description copied from interface:ConversationBuilder
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.- Specified by:
name
in interfaceConversationBuilder
- Parameters:
name
- the name for the created conversation- Returns:
- conversation builder for method chaining
-
getFallbackName
public java.lang.String getFallbackName()Description copied from interface:ConversationBuilder
Optional name to display when there's no title. By default, this will be the participant names separated by comas.- Specified by:
getFallbackName
in interfaceConversationBuilder
- Returns:
- Optional conversation title
-
fallbackName
Description copied from interface:ConversationBuilder
Set the optional fallback name to be used, if there is no explicit name being set (e.g. the name of the participants).- Specified by:
fallbackName
in interfaceConversationBuilder
- Parameters:
fallbackName
- the optional fallback name for the conversation- Returns:
- conversation builder for method chaining
- See Also:
Conversation.getFallbackName()
-
getConversationDefinitionId
public java.lang.String getConversationDefinitionId()- Specified by:
getConversationDefinitionId
in interfaceConversationBuilder
- See Also:
Conversation.getConversationDefinitionId()
-
getConversationDefinitionKey
public java.lang.String getConversationDefinitionKey()Description copied from interface:ConversationBuilder
Returns the key that will be used to do the conversation definition lookup when creating the conversation.- Specified by:
getConversationDefinitionKey
in interfaceConversationBuilder
-
conversationDefinitionId
Description copied from interface:ConversationBuilder
Set the id of the conversation definition.- Specified by:
conversationDefinitionId
in interfaceConversationBuilder
- Parameters:
conversationDefinitionId
- the id of the conversation definition- Returns:
- conversation builder for method chaining
-
conversationDefinitionKey
Description copied from interface:ConversationBuilder
Set the key of the conversation definition.- Specified by:
conversationDefinitionKey
in interfaceConversationBuilder
- Parameters:
conversationDefinitionKey
- The key that will be used to find the latest version of the conversation definition.- Returns:
- conversation builder for method chaining
-
getDescription
public java.lang.String getDescription()- Specified by:
getDescription
in interfaceConversationBuilder
- See Also:
Conversation.getDescription()
-
description
Description copied from interface:ConversationBuilder
Set the optional description describing the reason or goal of the conversation in more details than the name.- Specified by:
description
in interfaceConversationBuilder
- Parameters:
description
- the description for the conversation- Returns:
- conversation builder for method chaining
-
referenceId
Description copied from interface:ConversationBuilder
Set the reference id of the conversation pointing to for example a case or process instance id.- Specified by:
referenceId
in interfaceConversationBuilder
- Parameters:
referenceId
- The reference id pointing to for example a case or process instance id.- Returns:
- conversation builder for method chaining
-
getReferenceId
public java.lang.String getReferenceId()- Specified by:
getReferenceId
in interfaceConversationBuilder
-
referenceType
Description copied from interface:ConversationBuilder
Set the reference type of the conversation pointing to for example a case or process instance type.- Specified by:
referenceType
in interfaceConversationBuilder
- Parameters:
referenceType
- The reference id pointing to for example a case or process instance type.- Returns:
- conversation builder for method chaining
-
getReferenceType
public java.lang.String getReferenceType()- Specified by:
getReferenceType
in interfaceConversationBuilder
-
referenceDefinitionId
Description copied from interface:ConversationBuilder
Set the reference definition id of the conversation pointing to for example a case or process definition id.- Specified by:
referenceDefinitionId
in interfaceConversationBuilder
- Parameters:
referenceDefinitionId
- The reference definition id pointing to for example a case or process definition id.- Returns:
- conversation builder for method chaining
-
getReferenceDefinitionId
public java.lang.String getReferenceDefinitionId()- Specified by:
getReferenceDefinitionId
in interfaceConversationBuilder
-
getAvatarId
public java.lang.String getAvatarId()- Specified by:
getAvatarId
in interfaceConversationBuilder
- See Also:
Conversation.getAvatarId()
-
avatarId
Description copied from interface:ConversationBuilder
Optionally set the avatar information for this conversation.- Specified by:
avatarId
in interfaceConversationBuilder
- Parameters:
avatarId
- the optional information for the avatar of this conversation- Returns:
- conversation builder for method chaining
-
getOwnerId
public java.lang.String getOwnerId()- Specified by:
getOwnerId
in interfaceConversationBuilder
-
ownerId
- Specified by:
ownerId
in interfaceConversationBuilder
-
getAssigneeId
public java.lang.String getAssigneeId()- Specified by:
getAssigneeId
in interfaceConversationBuilder
-
assigneeId
- Specified by:
assigneeId
in interfaceConversationBuilder
-
getAssignedGroupId
public java.lang.String getAssignedGroupId()- Specified by:
getAssignedGroupId
in interfaceConversationBuilder
-
assignedGroupId
- Specified by:
assignedGroupId
in interfaceConversationBuilder
-
getParticipants
public java.util.Set<java.lang.String> getParticipants()- Specified by:
getParticipants
in interfaceConversationBuilder
-
participants
- Specified by:
participants
in interfaceConversationBuilder
-
addParticipant
- Specified by:
addParticipant
in interfaceConversationBuilder
-
getCandidateGroups
public java.util.Set<java.lang.String> getCandidateGroups()- Specified by:
getCandidateGroups
in interfaceConversationBuilder
-
candidateGroups
- Specified by:
candidateGroups
in interfaceConversationBuilder
-
addCandidateGroup
- Specified by:
addCandidateGroup
in interfaceConversationBuilder
-
getTags
public java.util.List<java.lang.String> getTags()Description copied from interface:Taggable
Returns the optional list of tags for this object. Tags might be used for different reasons, most likely for filtering and to have an impact on how the object might be rendered. -
tags
- Specified by:
tags
in interfaceConversationBuilder
-
addTag
- Specified by:
addTag
in interfaceConversationBuilder
-
tenantId
Description copied from interface:ConversationBuilder
Optionally sets the tenantId for this conversation. If missing, it will take the tenantId of the current user.- Specified by:
tenantId
in interfaceConversationBuilder
- Returns:
- conversation builder for method chaining
-
getTenantId
public java.lang.String getTenantId()- Specified by:
getTenantId
in interfaceConversationBuilder
- Returns:
- The tenantId, if set before on this builder.
-
determineTenantId
public java.lang.String determineTenantId(org.flowable.common.engine.impl.interceptor.CommandContext commandContext) -
start
Description copied from interface:ConversationBuilder
Returns the newly created conversation object. This actually performs the persistence of the conversation.- Specified by:
start
in interfaceConversationBuilder
- Returns:
- the newly built conversation object
-
startWithPermissionCheck
Deprecated.Description copied from interface:ConversationBuilder
Same asConversationBuilder.start()
with an additional permission check that the user withuserId
is allowed to create the conversation.- Specified by:
startWithPermissionCheck
in interfaceConversationBuilder
- Parameters:
userId
- the id of the user that is creating the conversation- Returns:
- the newly created conversation
- See Also:
ConversationBuilder.start()
-
startWithPermissionCheck
public Conversation startWithPermissionCheck(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId)Description copied from interface:ConversationBuilder
Same asConversationBuilder.start()
with an additional permission check that the user withuserId
is allowed to create the conversation.- Specified by:
startWithPermissionCheck
in interfaceConversationBuilder
- 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
- See Also:
ConversationBuilder.start()
-
startWithReuse
Description copied from interface:ConversationBuilder
Tries to find a similar conversation, if found it would return that one. Otherwise it will create a new conversation and persist it.- Specified by:
startWithReuse
in interfaceConversationBuilder
- Returns:
- the already existing similar conversation, or the newly built conversation
-
startWithReuseAndPermissionCheck
Deprecated.Description copied from interface:ConversationBuilder
Same asConversationBuilder.startWithReuse()
with an additional permission check that the user withuserId
is allowed to create the conversation.- Specified by:
startWithReuseAndPermissionCheck
in interfaceConversationBuilder
- Parameters:
userId
- the id of the user that is creating the conversation- Returns:
- the already existing similar conversation, or the newly build conversation
-
startWithReuseAndPermissionCheck
public ConversationHolder startWithReuseAndPermissionCheck(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId)Description copied from interface:ConversationBuilder
Same asConversationBuilder.startWithReuse()
with an additional permission check that the user withuserId
is allowed to create the conversation.- Specified by:
startWithReuseAndPermissionCheck
in interfaceConversationBuilder
- 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
-
enrichWithConversationDefinition
protected void enrichWithConversationDefinition() -
enrichWithConversationDefinition
protected void enrichWithConversationDefinition(org.flowable.common.engine.impl.interceptor.CommandContext commandContext)
-