One of my python functions sends a message to all projects using system.util.sendMessage
with scope session.
All messageHandlers in all my projects run accordingly - I've programmed a messageHandler in the Session events section of each project, plus a messageHandler in each view of the project that must react to the message.
The only view that seems not to react to the message is a view in a project marked as inheritable: when that view is open in a project that inherits from that parent, nothing I expect happens on that view as reaction to the messageHandler (I've also tried to program a messageHadler in the Session events section of the inheritable project, but with no success).
Inheritable projects do not have an independent runtime existence. Only leaf projects actually run anything, and potentially run everything in their inheritance chain.
Due to the all-or-nothing behavior of the project resources for events, it is extremely unwise to define any gateway, Perspective session, or Vision client events in inheritable projects.
Ok thanks @pturmel . But if a view in an Inheritable project needs to react to a message, I cannot seem to find the way to do it: defining a messageHandler in the view itself seems to do nothing.
My caution only applies to session events. Message handlers on views defined in an an inheritable project but used in a leaf project should work just fine in that leaf project.
Note that there's two different 'messaging' systems at play, which causes lots of confusion, unfortunately.
system.util.sendMessage is the older, not-Perspective-specific, bus that was 'overloaded' to allow messaging to entire Perspective sessions. The handlers for these messages are defined in 'Session Events', and as Phil noted - not generally suitable for participation in the project inheritance scheme currently; all your handlers, of any type, are all managed by a single project resource, so inheritance is "all or nothing". This is a limitation that we're going to address in 8.3, but worth noting right now.
system.perspective.sendMessage, and the component messaging action, meanwhile, are the limited to Perspective message handling system. The handlers you define for these messages are those on individual Perspective components and views.
In other words: a system.util.sendMessage broadcast with a target of a specific session will not interact with a view or component message handler, even if it's set to 'session' listening scope.
That complication and/or the tricky interaction with project inheritance may be at the root of your issue here.
Hi @PGriffith , thanks for your help. I know what you point out and therefore the messageHandler in the Session Events of the running project (not the inheritable one) which is supposed to react to the system.util.sendMessage sends the message further with a system.perspective.sendMessage, while the final messageHandler is written in the target view, which however is defined in the inheritable project and used in the running one. Unfortunately that does not seem to work.