# Additional Gateway Event Script Hook

**URL:** <https://forum.inductiveautomation.com/t/additional-gateway-event-script-hook/52593>\
**Category:** Module Development\
**Tags:** sdk, ignition80, ignition81\
**Created:** [November 1, 2021, 10:07pm UTC](https://forum.inductiveautomation.com/t/additional-gateway-event-script-hook/52593 "2021-11-01T22:07:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cody.tamaki](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cody.tamaki](https://forum.inductiveautomation.com/u/cody.tamaki)\
**Post date:** [November 1, 2021, 10:07pm UTC](https://forum.inductiveautomation.com/t/additional-gateway-event-script-hook/52593/1 "2021-11-01T22:07:23Z")

</div>

Is there a way to add in a custom “Gateway Event Script” hook from the module SDK?

I’m writing a module that will stream/gather an entire dataset as a single packet from a device and I’d like a hook to use python to process that data. I was thinking a “onDataReceived” gateway event script would be the easiest way to handle that but I’m open to other suggestions if there’s an easier method.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 1, 2021, 10:18pm UTC](https://forum.inductiveautomation.com/t/additional-gateway-event-script-hook/52593/2 "2021-11-01T22:18:40Z")

</div>

Sorry, none of that is extensible. I think you’d have to add your own kind of resource and node to the Designer resource tree… and build your own UI for editing.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 1, 2021, 11:06pm UTC](https://forum.inductiveautomation.com/t/additional-gateway-event-script-hook/52593/3 "2021-11-01T23:06:13Z")

</div>

You would need your own singleton resource type. If you extend `com.inductiveautomation.ignition.common.script.ScriptConfig` (ignoring the builtin bean properties), you can also subclass `com.inductiveautomation.ignition.designer.scripteditor.GlobalScriptEditor` to register your own `com.inductiveautomation.ignition.designer.scripteditor.GlobalScriptEditor.ScriptConfigPanel` - that’ll save you _some_ effort in recreating the UI. That’s how client and session event scripts work.

---

<div class="post-metadata">

**Author:** ![cody.tamaki](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cody.tamaki](https://forum.inductiveautomation.com/u/cody.tamaki)\
**Post date:** [November 1, 2021, 11:15pm UTC](https://forum.inductiveautomation.com/t/additional-gateway-event-script-hook/52593/4 "2021-11-01T23:15:28Z")

</div>

If I did that I’d still have to set that up as a separate resource in the designer project browser correct?

I might play with it a bit because that might not be the end of the world…

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 1, 2021, 11:41pm UTC](https://forum.inductiveautomation.com/t/additional-gateway-event-script-hook/52593/5 "2021-11-01T23:41:07Z")

</div>

Yeah, you’d have to add your own ‘Tamaki Control’ (or whatever else) node to the project browser.

Another option that the SECS/GEM module uses is to programatically fire a message and require a message handler with a specific name be defined in the gateway event scripts. However, that’s got pretty poor discoverability and isn’t a great paradigm (in my opinion).

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 2, 2021, 5:49pm UTC](https://forum.inductiveautomation.com/t/additional-gateway-event-script-hook/52593/6 "2021-11-02T17:49:17Z")

</div>

It’s not the end of the world. I did it as a global editor for events from my Ethernet/IP module.
