How to get the currently executed *.xaml line in UiPath

Hi Everyone,

Recently we were brainstorming in our Team to see if it is in any way possible to get the current code line executed from the currently running *.xaml file.

To ellaborate…
XAML files which are the cornerstone of the UiPath builds, are of course nothing else but lines of code. When you have a closer look, those XAML files contain everything that you create / define / assign in your Studio.

Now to carry on with the thought, when you execute an XAML file, the internal UiPath Studio mechanism needs to know how to execute those lines. Therefore - as in any other programming language - it should be possible to get the currently executed XAML code line + it’s contents.
The need for this arose due to lack of certain information for e.g. during exception handling.

Any suggestions on how to get this, would be very much appreciated!

Regards,
Marcin

Hum… xaml dont really have lines… It is xml based so, they have nodes, elements etc discovering lines makes little sense in xml, as commands will be tags spanning multiple “lines” depending even on indentation… technically xaml and xml, only have one line from start to end of the document.

Thanks for the Reply bcorrea. If that is and we do have nodes, is it in any way possible to get to those nodes? Or get the info about currently executed node? Even if xaml is treated as one line from start to finish, if we are able to jump through the nodes you mentioned, that would still be something for me (I would imagine the iteration through them would look similar to the iteration through a JSON file?). Thanks in advance!

For sure there is a way, dont forget that all your xaml files are inside the project and could be parsed as text and searched by something like the activity name and then found the position where it lies…