Fire Component Event

How to trigger the "onMessageEvent" from the example Messenger component?

I have tried this.component.fireEvent("model", "onMessageEvent", event); in MessageComponentModelDelegate.java but it doesn't work.

link to code

I figured it out:
this.component.fireEvent(EventConfig.COMPONENT_EVENTS, "onMessageEvent", event);

You generally should not do this. Instead, move the code in the event to a function in a project library script. Then the event becomes a one-liner that calls the real code, and the real code can also be called wherever else you need it.

Thanks for the reply. I am adding a Component Event on my Perspective Component so the Designer user has the choice of either using the Component Event or adding a Change Script of a perspective property depends on their preference.

The example in MessageComponentModelDelegate.java gets me most of the way there. I just needed to figure out the call signature of com.inductiveautomation.perspective.gateway.api.Component.fireEvent which is undocumented.