Gateway Messages with inherited projects

Hi,

I’m trying to send a message to a Gateway Message Handler defined on the parent project.
When defining the message handler on the client project, it works ok :

system.util.sendRequest(“Childproject”, “test”, {“data”: “TEST”})

But when defining the same message handler in the parent project, we get an exception:

system.util.sendRequest(“Parentproject”, “test”, {“data”: “TEST”})

results in :

Traceback (most recent call last):
File “event:actionPerformed”, line 1, in
com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: MessageHandlerManager is null in ScriptConfig!

caused by GatewayException: MessageHandlerManager is null in ScriptConfig!
caused by MessageHandlerException: MessageHandlerManager is null in ScriptConfig!

Ignition v8.0.10 (b2020031912)
Java: Azul Systems, Inc. 11.0.6

Kind regards

Inheritable projects are not “runnable” and that includes their tag change scripts, timer scripts, startup scripts, shutdown scripts, and message handlers.

(a “runnable” project is one that is enabled and not inheritable)

Thank you for the quick answer.

So is there a way to inherit these scripts, so they are available in the client project?

We would like to use this parent project as a base project for different customers. In this way we can promote inheritance and reusability across our customers.

Thank you

You can write your shared logic in script packages/modules in the parent project and those will be inherited, but you have to define the handlers in each child project. The handlers would then call the shared logic.

Ok,

That’s a pity. I think it would have been really valuable to have the child project also inherit these scripts and message handlers.

Certain parent windows send messages to the gateway in order to execute gateway functionality. Is there another way to execute code, defined in the parent project, on the gateway?

Thank you

Hi Kevin,

I did some new tests and started from a fresh empty project. As I was testing I did get different results. I think it is clear to me how it works now. It seems that defining Gateway Events on the parentproject also makes the gateway events available in the childproject. So this makes the messagehandler available in the childproject. This stops working from the moment we do an override of the Gateway Events node.

This mechanism makes sense when working with other resource nodes as Windows and templates, but in gateway events it should be possible to extend the functionality instead of overriding it. It would be good if we could override pieces of the gateway events window.

Another question: Is it possible to DE-override as certain Resource? I know deleting a window in a child project makes it de-overriden, but this is not possible in Scripting/Gateway Events or Vision/Client Events, because we simply can’t delete these nodes. Or Am I missing something over here?

Thanks