Alarm History acknowledgements use only Default datasource

I’m using the Alarm History widget available on the downloads page, and it works quite well. on this current project, however, I’m logging data into an Oracle database, but using a MySQL database for the alarms. (Mostly because the Alarm History widget is only available for MySQL or MSSQL and I’m too lazy to rewrite it.)

The Alarm Table.Data binding can be directed toward any datasource by the dropdown menu. The Acknowledge and Acknowledge All buttons, however, use only the default datasource. If they don’t match, FPMI starts throwing errors.

I got around this by adding a dynamic property called “Datasource” to the Alarms container. Then to the actionPerformed script on the Acknowledge buttons, added the line:

datasource = event.source.parent.parent.getPropertyValue("Datasource")

and also changed the runUpdateQuery line to:

fpmi.db.runUpdateQuery(query, datasource)

Is there a better way to do this?

Nope - your solution is just fine!