For one of my client’s needs, I would like to be able to create new module instances outside Ignition using http requests. I know this is something that isn’t really possible normally so that’s why I wanted to share my thoughts with you about what could be the best solution.
I have a dedicated module that is handling every request to do the interface between calls and ignition. I receive any needed properties in JSON format and after that I would be able to create a new persistence record of another module (already installed on my gateway). My problem is that I do not have access to the custom Persistence Record class of the module that I need to create an instance of. I cannot instantiate a PersistenceRecord and then modify it to match my needed record format.
E.g.: It is possible to create a new device, by creating a new instance of Device settings record and then add some specs to it (add META fields for each attributes).
DeviceSettingsRecord deviceRecord = context.getPersistenceInterface() .createNew(DeviceSettingsRecord.META, session.getDataSet());
So, i wanted to know if anybody has any idea on how could iImanage to do that? Otherwise, I had the idea of instead of creating the module directly from another module to just send like an “event” to tell to the module to create a new instance of itself. I’ve look into some example demonstrating alarm notifications but it seems not appropriate and over complicated for what I am trying to achieve. My other lead would be to make a notification through a tag change and then pass the information inside tag’s metadata. This should work, but that seems a little too far-fetched to me.
What’s your opinion about that?