Is there a mechanism to send messages/notifications to other users?

Does the Platform have such a feature or do you have a plan to work on it?
For example, I Approve a Contract in BPM, and everyone involved get a message that a Contract moves to other stage.
Or someone edits an entity that I created, so that I want to receive a notification about this action, and write a direct message to that person (some kind of a chat, maybe).

The platform contains only a very simple mechanism of sending messages to currently active users. It is available to administrators in the User Sessions screen. The message is appeared on the recipient’s screen on the next ping request, which is performed three times per HTTP session timeout (set by the cuba.httpSessionExpirationTimeoutSec app property), i.e. not immediately.

We also have some indefinite plans about implementing the messaging and chat functionality in the form of an optional application component.

Hi,

additionally to what Konstantin said, i created a blog post a while ago: async event handling in CUBA where the last part of the blog post shows an implementation of what you described (although it is not real time and it is just a receive message inbox kind of a thing).

You can see the example code here: GitHub - mariodavid/cuba-example-application-events: CUBA platform example that shows how to use Springs internal event bus to create a event driven architecture within a CUBA app

Bye
Mario

There is a way to use this function via code or via API? I want to automate the deployment process across various applications, and before the update, I use this exact function to manually send a message to all sessions on all applications.

I’m aware that exist a “Global Events Add-on”, but I already use the Session Message function, which serves the purpose, and I just want to send the message with a script, which will call an existing API or a new custom API with minimal code (I have already other custom API, so it will be just a couple of lines of code)

1 Like

Sure, use UserSessionService.postMessage() method.

See how it’s done in the framework: cuba/SessionMessageWindow.java at 0ccda82ac6cacb9c645c0029f3b1d626214a4a40 · cuba-platform/cuba · GitHub

1 Like