public interface ConversationService
Modifier and Type | Method and Description |
---|---|
void |
addParticipants(String conversationId,
Collection<String> participants)
Adds the given participants to the conversation with the given id
|
void |
addTag(String conversationId,
String tag)
Adds the provided tag to the specified conversation.
|
void |
addTags(String conversationId,
Collection<String> tags)
Tag the conversation with provided
tags |
void |
archive(String conversationId)
Archives the conversation with the given id.
|
void |
assignToGroup(String conversationId,
String assignedGroupId)
Assigns the conversation to a group of users (set the assignedGroupId property).
|
void |
assignToUser(String conversationId,
String assignedUserId)
Assigns the conversation to a user (set the assigneeId property).
|
long |
countConversationsWithLastMessageBetween(Date from,
Date until,
boolean includePrivateMessages,
boolean includeStickMessages)
TODO: this might be not the right service
Number of conversations which received new messages within a given time frame.
|
ConversationBuilder |
createConversationBuilder()
Returns a conversation builder used to start new
Conversation objects. |
ConversationQuery |
createConversationQuery()
Creates a new conversation query as a builder where you can add predicates in order to query for conversations.
|
ConversationStatusQuery |
createConversationStatusQuery()
Creates a new conversation status query, that can be used to get the
different unread statuses for a conversation.
|
ConversationUserQuery |
createConversationUserQuery()
Creates a new user query to request user ids involved in a specific conversation (e.g.
|
void |
deleteConversation(String conversationId)
Deletes a conversation and all related data (messages, unread counts, etc.).
|
boolean |
exists(String conversationId) |
Conversation |
findById(String conversationId)
Finds the conversation with the given id.
|
Conversation |
findByIdWithIdentityLinks(String conversationId)
Finds the conversation with the given id, with the identity links already prefetched.
|
Conversation |
findByIdWithIdentityLinksAndVariables(String conversationId)
Finds the conversation with the given id, with the identity links and variables already prefetched.
|
List<Conversation> |
findConversationsWithLastMessageBetween(Date from,
Date until,
boolean includePrivateMessages,
boolean includeStickMessages)
TODO: this might be not the right service
Finds conversations which received new messages within a given time frame.
|
Object |
getVariable(String conversationId,
String variableName)
The variable value.
|
Map<String,Object> |
getVariables(String conversationId)
All variables visible from the given conversation.
|
void |
linkConversationWithUserAccount(String conversationId,
String userAccountId)
Set the id of the user account that is linked with this conversation.
|
void |
removeAssignedGroup(String conversationId)
Removes an assigned group from a conversation (sets the assignedGroupId proeprty to null).
|
void |
removeAssignedUser(String conversationId)
Removes an assigned user from a conversation.
|
void |
removeParticipants(String conversationId,
Collection<String> participants)
Removes the given participants to the conversation with the given id
|
void |
removeTag(String conversationId,
String tag)
Removes the provided tag from the specified conversation, if it exists.
|
void |
removeTags(String conversationId,
Collection<String> tags)
Remove the provided
tags from the conversation |
void |
removeUserAccountFromConversation(String conversationId)
Remove the id of the user account from this conversation.
|
void |
removeVariable(String conversationId,
String variableName)
Removes a variable for a conversation.
|
void |
removeVariables(String conversationId,
Collection<String> variableNames)
Removes variables for a conversation.
|
void |
reopen(String conversationId)
Reopens the archived conversation with the given id.
|
Conversation |
setReference(String conversationId,
String referenceId,
String referenceType,
String referenceDefinitionId)
Set the optional reference for a conversation like a case or process where the conversation is liked to.
|
void |
setVariable(String conversationId,
String variableName,
Object value)
Update or create a variable for a conversation.
|
void |
setVariables(String conversationId,
Map<String,Object> variables)
Update or create given variables for a conversation.
|
long |
unreadMessagesCount(String userId,
String conversationId)
The unread data count for the user with id
userId in the conversation with id conversationId |
Conversation |
updateAvatarId(String conversationId,
String avatarId)
Updates the conversation avatar id for the given conversation.
|
Conversation |
updateDescription(String conversationId,
String description)
Updates the conversation description for the given conversation.
|
Conversation |
updateName(String conversationId,
String name)
Updates the conversation name (title) for the given conversation.
|
void |
userTyping(String conversationId,
String userId)
Information that a user with id
userId is typing in the conversation with id conversationId |
ConversationQuery createConversationQuery()
findById(String)
because it takes the cache into account.ConversationBuilder createConversationBuilder()
Conversation
objects. Make sure to always explicitly set the sub type of the conversation as it
is a mandatory information.ConversationUserQuery createConversationUserQuery()
ConversationStatusQuery createConversationStatusQuery()
boolean exists(String conversationId)
long unreadMessagesCount(String userId, String conversationId)
userId
in the conversation with id conversationId
userId
- the id of the user for which the unread data count is neededconversationId
- the id of the conversation for which the count is neededConversation setReference(String conversationId, String referenceId, String referenceType, String referenceDefinitionId)
conversationId
- the id of the conversation to set its referencereferenceId
- the id of the referenced work itemreferenceType
- the type of the referenced work itemreferenceDefinitionId
- the optional definition id of the referenced work itemConversation updateName(String conversationId, String name)
conversationId
- the id of the conversation to change its namename
- title of the conversation, it can be also be null or emptyConversation updateDescription(String conversationId, String description)
conversationId
- the id of the conversation to change its descriptiondescription
- the description of the conversation, it can be also be null or emptyConversation updateAvatarId(String conversationId, String avatarId)
conversationId
- the id of the conversation to change its descriptionavatarId
- the avatar id of the conversation, it can be also be null or emptyvoid archive(String conversationId)
conversationId
- the id of the conversation to be archivedvoid reopen(String conversationId)
conversationId
- the id of the conversation to be reopenedvoid addParticipants(String conversationId, Collection<String> participants)
conversationId
- the id of the conversation to which the participants needs to be addedparticipants
- the ids of the participants that need to be addedvoid removeParticipants(String conversationId, Collection<String> participants)
conversationId
- the id of the conversation from which the participants need to be removedparticipants
- the ids of the participants that need to be removedvoid assignToGroup(String conversationId, String assignedGroupId)
conversationId
- the id of the conversation to be assigned to a groupassignedGroupId
- the id of the group to assign the conversation tovoid removeAssignedGroup(String conversationId)
conversationId
- the id of the conversation to remove the assgined group fromvoid assignToUser(String conversationId, String assignedUserId)
conversationId
- the id of the conversation to be assigned to a userassignedUserId
- the id of the user to assign the conversation tovoid removeAssignedUser(String conversationId)
conversationId
- the id of the conversatoin to remove the assigned user (set the assigneeId ot null).void userTyping(String conversationId, String userId)
userId
is typing in the conversation with id conversationId
conversationId
- the id of the conversation in which the user is typinguserId
- the id of the user that is doing the typingvoid deleteConversation(String conversationId)
conversationId
- the id of the conversation which needs to be deleted.void addTags(String conversationId, Collection<String> tags)
tags
conversationId
- the id of the conversation to which the tags need to be addedtags
- the tags that should be added to the conversationvoid addTag(String conversationId, String tag)
conversationId
- the id of the conversation where the tag should be addedtag
- the tag to be added, must not be null or emptyvoid removeTags(String conversationId, Collection<String> tags)
tags
from the conversationconversationId
- the id of the conversation from which tags need to be removedtags
- the tags that need to be removed from the conversationvoid removeTag(String conversationId, String tag)
conversationId
- the id of the conversatoin to remove the provided tag fromtag
- the tag to be removedlong countConversationsWithLastMessageBetween(Date from, Date until, boolean includePrivateMessages, boolean includeStickMessages)
ConversationQuery
and build a query with ConversationQuery.lastMessageAfter(Date)
or ConversationQuery.lastMessageBefore(Date)
This method is needed if private or sticky messages are also to be taken account, because Conversation.getLastMessageTime()
will not be updated for private or sticky messages.from
- start of the time frame (optional)until
- end of the time frame (optional)includePrivateMessages
- true if private messages should also be consideredincludeStickMessages
- true if sticky messages should also be consideredList<Conversation> findConversationsWithLastMessageBetween(Date from, Date until, boolean includePrivateMessages, boolean includeStickMessages)
ConversationQuery
and build a query with ConversationQuery.lastMessageAfter(Date)
or ConversationQuery.lastMessageBefore(Date)
This method is needed if private or sticky messages are also to be taken account, because Conversation.getLastMessageTime()
will not be updated for private or sticky messages.from
- start of the time frame (optional)until
- end of the time frame (optional)includePrivateMessages
- true if private messages should also be consideredincludeStickMessages
- true if sticky messages should also be consideredConversation findByIdWithIdentityLinks(String conversationId)
Conversation findByIdWithIdentityLinksAndVariables(String conversationId)
Conversation findById(String conversationId)
findByIdWithIdentityLinks(String)
.conversationId
- the conversation idvoid linkConversationWithUserAccount(String conversationId, String userAccountId)
removeUserAccountFromConversation(String)
first.conversationId
- the id of the conversation that should be updateduserAccountId
- the id of the user account that should be linked with the conversationvoid removeUserAccountFromConversation(String conversationId)
conversationId
- the id of the conversation that should be updatedMap<String,Object> getVariables(String conversationId)
conversationId
- id of the conversation, cannot be null.org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no conversation is found for the given conversationId.Object getVariable(String conversationId, String variableName)
conversationId
- id of conversation, cannot be null.variableName
- name of variable, cannot be null.org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no conversation is found for the given conversationId.void setVariable(String conversationId, String variableName, Object value)
conversationId
- id of conversation to set variable in, cannot be null.variableName
- name of variable to set, cannot be null.value
- value to set. When null is passed, the variable is not removed, only it's value will be set to null.org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no conversation is found for the given conversationId.void setVariables(String conversationId, Map<String,Object> variables)
conversationId
- id of the conversation, cannot be null.variables
- map containing name (key) and value of variables, can be null.org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no conversation is found for the given conversationId.void removeVariable(String conversationId, String variableName)
conversationId
- id of conversation to remove variable in.variableName
- name of variable to remove.void removeVariables(String conversationId, Collection<String> variableNames)
conversationId
- id of conversation to remove variable in.variableNames
- collection containing name of variables to remove.Copyright © 2019. All rights reserved.