public class ConversationServiceImpl extends org.flowable.common.engine.impl.service.CommonEngineServiceImpl<EngageEngineConfiguration> implements ConversationService
| Modifier and Type | Field and Description | 
|---|---|
| static String | IDENTITY_LINK_CONVERSATION_SCOPE | 
| Constructor and Description | 
|---|
| ConversationServiceImpl(EngageEngineConfiguration configuration) | 
| 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  Conversationobjects. | 
| 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  tagsfrom 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. | 
| Conversation | startConversation(ConversationBuilderImpl conversationBuilder) | 
| ConversationHolder | startConversationWithReuse(ConversationBuilderImpl conversationBuilder) | 
| long | unreadMessagesCount(String userId,
                   String conversationId)The unread data count for the user with id  userIdin the conversation with idconversationId | 
| 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  userIdis typing in the conversation with idconversationId | 
getCommandExecutor, setCommandExecutorpublic static final String IDENTITY_LINK_CONVERSATION_SCOPE
public ConversationServiceImpl(EngageEngineConfiguration configuration)
public ConversationQuery createConversationQuery()
ConversationServiceConversationService.findById(String) because it takes the cache into account.createConversationQuery in interface ConversationServicepublic ConversationBuilder createConversationBuilder()
ConversationServiceConversation objects. Make sure to always explicitly set the sub type of the conversation as it
 is a mandatory information.createConversationBuilder in interface ConversationServicepublic ConversationUserQuery createConversationUserQuery()
ConversationServicecreateConversationUserQuery in interface ConversationServicepublic ConversationStatusQuery createConversationStatusQuery()
ConversationServicecreateConversationStatusQuery in interface ConversationServicepublic long unreadMessagesCount(String userId, String conversationId)
ConversationServiceuserId in the conversation with id conversationIdunreadMessagesCount in interface ConversationServiceuserId - the id of the user for which the unread data count is neededconversationId - the id of the conversation for which the count is neededpublic Conversation startConversation(ConversationBuilderImpl conversationBuilder)
public ConversationHolder startConversationWithReuse(ConversationBuilderImpl conversationBuilder)
public boolean exists(String conversationId)
exists in interface ConversationServicepublic Conversation setReference(String conversationId, String referenceId, String referenceType, String referenceDefinitionId)
ConversationServicesetReference in interface ConversationServiceconversationId - 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 itempublic Conversation updateName(String conversationId, String name)
ConversationServiceupdateName in interface ConversationServiceconversationId - the id of the conversation to change its namename - title of the conversation, it can be also be null or emptypublic Conversation updateDescription(String conversationId, String description)
ConversationServiceupdateDescription in interface ConversationServiceconversationId - the id of the conversation to change its descriptiondescription - the description of the conversation, it can be also be null or emptypublic Conversation updateAvatarId(String conversationId, String avatarId)
ConversationServiceupdateAvatarId in interface ConversationServiceconversationId - the id of the conversation to change its descriptionavatarId - the avatar id of the conversation, it can be also be null or emptypublic void archive(String conversationId)
ConversationServicearchive in interface ConversationServiceconversationId - the id of the conversation to be archivedpublic void reopen(String conversationId)
ConversationServicereopen in interface ConversationServiceconversationId - the id of the conversation to be reopenedpublic void addParticipants(String conversationId, Collection<String> participants)
ConversationServiceaddParticipants in interface ConversationServiceconversationId - the id of the conversation to which the participants needs to be addedparticipants - the ids of the participants that need to be addedpublic void removeParticipants(String conversationId, Collection<String> participants)
ConversationServiceremoveParticipants in interface ConversationServiceconversationId - the id of the conversation from which the participants need to be removedparticipants - the ids of the participants that need to be removedpublic void assignToGroup(String conversationId, String assignedGroupId)
ConversationServiceassignToGroup in interface ConversationServiceconversationId - the id of the conversation to be assigned to a groupassignedGroupId - the id of the group to assign the conversation topublic void removeAssignedGroup(String conversationId)
ConversationServiceremoveAssignedGroup in interface ConversationServiceconversationId - the id of the conversation to remove the assgined group frompublic void assignToUser(String conversationId, String assignedUserId)
ConversationServiceassignToUser in interface ConversationServiceconversationId - the id of the conversation to be assigned to a userassignedUserId - the id of the user to assign the conversation topublic void removeAssignedUser(String conversationId)
ConversationServiceremoveAssignedUser in interface ConversationServiceconversationId - the id of the conversatoin to remove the assigned user (set the assigneeId ot null).public void userTyping(String conversationId, String userId)
ConversationServiceuserId is typing in the conversation with id conversationIduserTyping in interface ConversationServiceconversationId - the id of the conversation in which the user is typinguserId - the id of the user that is doing the typingpublic void deleteConversation(String conversationId)
ConversationServicedeleteConversation in interface ConversationServiceconversationId - the id of the conversation which needs to be deleted.public void addTags(String conversationId, Collection<String> tags)
ConversationServicetagsaddTags in interface ConversationServiceconversationId - the id of the conversation to which the tags need to be addedtags - the tags that should be added to the conversationpublic void addTag(String conversationId, String tag)
ConversationServiceaddTag in interface ConversationServiceconversationId - the id of the conversation where the tag should be addedtag - the tag to be added, must not be null or emptypublic void removeTags(String conversationId, Collection<String> tags)
ConversationServicetags from the conversationremoveTags in interface ConversationServiceconversationId - the id of the conversation from which tags need to be removedtags - the tags that need to be removed from the conversationpublic void removeTag(String conversationId, String tag)
ConversationServiceremoveTag in interface ConversationServiceconversationId - the id of the conversatoin to remove the provided tag fromtag - the tag to be removedpublic long countConversationsWithLastMessageBetween(Date from, Date until, boolean includePrivateMessages, boolean includeStickMessages)
ConversationServiceConversationQuery 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.countConversationsWithLastMessageBetween in interface ConversationServicefrom - 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 consideredpublic List<Conversation> findConversationsWithLastMessageBetween(Date from, Date until, boolean includePrivateMessages, boolean includeStickMessages)
ConversationServiceConversationQuery 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.findConversationsWithLastMessageBetween in interface ConversationServicefrom - 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 consideredpublic Conversation findByIdWithIdentityLinks(String conversationId)
ConversationServicefindByIdWithIdentityLinks in interface ConversationServicepublic Conversation findByIdWithIdentityLinksAndVariables(String conversationId)
ConversationServicefindByIdWithIdentityLinksAndVariables in interface ConversationServicepublic Conversation findById(String conversationId)
ConversationServiceConversationService.findByIdWithIdentityLinks(String).findById in interface ConversationServiceconversationId - the conversation idpublic void linkConversationWithUserAccount(String conversationId, String userAccountId)
ConversationServiceConversationService.removeUserAccountFromConversation(String) first.linkConversationWithUserAccount in interface ConversationServiceconversationId - the id of the conversation that should be updateduserAccountId - the id of the user account that should be linked with the conversationpublic void removeUserAccountFromConversation(String conversationId)
ConversationServiceremoveUserAccountFromConversation in interface ConversationServiceconversationId - the id of the conversation that should be updatedpublic Map<String,Object> getVariables(String conversationId)
ConversationServicegetVariables in interface ConversationServiceconversationId - id of the conversation, cannot be null.public Object getVariable(String conversationId, String variableName)
ConversationServicegetVariable in interface ConversationServiceconversationId - id of conversation, cannot be null.variableName - name of variable, cannot be null.public void setVariable(String conversationId, String variableName, Object value)
ConversationServicesetVariable in interface ConversationServiceconversationId - 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.public void setVariables(String conversationId, Map<String,Object> variables)
ConversationServicesetVariables in interface ConversationServiceconversationId - id of the conversation, cannot be null.variables - map containing name (key) and value of variables, can be null.public void removeVariable(String conversationId, String variableName)
ConversationServiceremoveVariable in interface ConversationServiceconversationId - id of conversation to remove variable in.variableName - name of variable to remove.public void removeVariables(String conversationId, Collection<String> variableNames)
ConversationServiceremoveVariables in interface ConversationServiceconversationId - id of conversation to remove variable in.variableNames - collection containing name of variables to remove.Copyright © 2019. All rights reserved.