Adding comments to entities

There are many scenarios in which users need to interact with each other to complete a task inside the application. Users frequently use other media like chat or e-mail to carry out those interactions, as many applications do not include a collaboration module. By adding the notifications and collaboration module to the application, the interactions remain inside the application, improving the user experience and keeping all relevant information in the system.

This module implements collaboration features, where end users can communicate inside the application by adding comments to entity instances. This can be used to integrate those comments with the data they are related to.

EntityCommentsSample
Comments associated with an entity

Accessing this feature

This feature is integrated in Entity Manager objects. To enable this feature, the “Allow User Comments” property must be set to “True” in the transaction node of the pattern instance for that transaction.

As this feature uses notifications the event types metadata must be initialized. To do this, the “Initialize Event Types” option found in the K2BTools menu must be executed.

Comments and comment threads

All comments belong to a comment thread. Comment threads are associated with an entity instance, and should be used to group comments related to a certain topic.

Threads can be started by any user. The thread author must write the initial comment, as all threads must contain at least one comment.

The status for newly created threads is “Open”. Threads can be marked as resolved when it is no longer relevant. Resolved threads are not shown by default but the end user can choose to see resolved threads. The module stores who resolved each thread and when.

Comments can be added to all open threads. Comments are always shown chronologically. The user can choose to reply to a message. In that case, the module stores a reference to the replied message and the UI shows information about which message was replied.

Mentioning users

Users can mention other users when writing comments. To mention another user, the comment author must write the username preceded by the “@” symbol.

To implement this, the module must have access to the user list. To do this, the “GetCommentsCandidateUsers” procedure must be implemented. If using the GAM integration module this procedure is implemented automatically.

Attaching a meeting to a comment

As of K2BTools 12.4, users can choose to attach a meeting to a comment. See more in Video conferencing in the collaboration module.

Notifications generation

Users may be notified when a new comment is added. When comments are enabled for an entity, three event types are created:

  • New Comment: Users can subscribe to this event type to get notifications whenever a new comment is created.

  • Comment mentions you: This event is sent to all the users that were mentioned in a comment.

  • Comment replied: When a user replies a comment, this notification is sent to the original comment’s author.

These notifications are sent using the notifications module. When the module’s metadata is initialized, these event types are created automatically for entities that allow user comments.

Users can customize how and which notifications they will receive using the module’s configuration.

These events are created with this relevant data:

  • MESSAGE: The comment text as entered by the user.
  • MESSAGE100: The first 100 characters of the comment text.
  • MESSAGE50: The first 50 characters of the comment text.
  • AUTHOR: The username of the comment author.
  • DA_VALUE: The value for the description attribute of the entity instance where the comment was created.

Users are not notified in these cases:

  1. Users are not notified about comments that they authored.
  2. Users that receive a notification because they are being replied to, or they are mentioned in a comment, will only receive one notification regarding that comment. Another way of seeing this is that no user will receive two notifications about the same comment.
  3. Users that are seeing the comments section when the comment is entered (they saw the comment as it was created) are not notified.