How Can I get a list fo the classes from a package and each item XData content?
Hi community,
How Can I get a list fo the classes from a package and for each item of the list the XData content?
Product version:
IRIS 2020.3
Hi community,
How Can I get a list fo the classes from a package and for each item of the list the XData content?
To leave a comment or answer to post please log in
Please log in
To leave a post please log in
Here's a quick sample:
Note that this gets XData blocks defined in a class; if you want to get "inherited" XData blocks listed for each subclass along with the inherited content it's only slightly more complex:
Great answer, but I'd like to add that there are two distinct cases for working with XDatas:
The code above works for the first case, but for the second case it might be preferable to create an independent copy of an XData stream so that no locking happens - this prevents XData object access/modification errors, especially in Dev environments. Furthermore objectless way of getting XData contents would be faster.
I usually use this method to get streams if my XData work falls into the second category:
This code can be further improved for most use cases by replacing a stream with a string.
I see it is possible use sql too: https://community.intersystems.com/post/creating-and-listing-xdata-defin...