Run external file from LO Draw

I would like to run an external program from Draw (odg).

This could be either by clicking a button or by running a macro. Which of these are possible?

I am using an odg diagram as a control system configuration and turning it into a specific XML format, and I would like to verify the transformation from the diagram.

Yo can use Shell from LibO BASIC.
Of course you have to call the routine (Sub, Function) containing the call to Shell() in its body. You can do this by an event for a conrtol (button …) or by using ‘Tools’ > ‘Macros’ > ‘Run’ or as a side effect of a function called from a formula evaluation …

(Editing with respect to the comments below:)

Here the announced demo.

@Lupp. Thanks. Can you point me to a resource that explains how to add a control button to a diagram?

Do you mean the current ‘Page’ in ‘Draw’ by your term “diagram”?
If so it’s the same as with other document classes: Select the ‘Form Controls’ toolbar visible. Switch to design mode, choose the control you want, click into the drawing, drag …
A few additional details you may get from the example that I attach to my answer above.
Documentation you find generally here. I doubt if you find much about this specific question there.

Thanks. Wasn’t at all aware of ‘Form Controls’