Vision Project Resource Editing Via XML

I am attempting to use the XMLDeserializer class to grab existing windows in a project, then add/delete/edit Vision components to the window. This is my personal step toward agentic Ignition development, and seems like the lesser of all evils regarding programmatic component creation and persistence. I can already collect the window object, deserialize it, and inject components into the XML before reserializing the window. However, I do not know if my methods are supported, as they have been fairly unstable thus far.

If someone (@paul-griffith) could shed some light on the XML structure and perhaps provide a simple example of adding a PMILabel object to a window with an expression-bound text value, that would be incredibly helpful.

I am aware that the binding system relies on the InteractionController object on the window itself, but have had trouble registering an acceptable binding (besides tag bindings).

It's unclear to me in which scope you're trying to do your agentic stuff. If you're calling scripts within the designer process externally somehow, that's probably going to be more fruitful than directly authoring/editing XML changes. Though, if you are going down the raw XML road, make sure you're changing the project property to save your Vision resources as XML instead of binary - then you can directly read them via the filesystem, potentially.

Bindings are all instances of the Adapter class:

Each binding instance is created by a bespoke XBindingConfigurator class that handles the GUI and the creation logic, and exposes a public static bind method that's ultimately invoked reflectively by other machinery.

XML serialization of adapters within an interaction controller relies on reflection over their beans plus some extra bits, e.g WindowDelegate extends from a DefaultObjectSerializationDelegate.