Possible to export a class without specific members?
Is there a way to exclude specific members from a class when exporting to an XML or UDL file? Bonus question: is there a way to import from that file without overwriting those members that were excluded?
The use case is to export an interoperability production class without the ProductionDefinition XDATA. We plan to source control the production items through the Ensemble Deployment Manager, but we still need to export any custom code in the class definition itself.
Comments
Hi Pravin,
afaik this is not possible.
I would suggest revisiting the design. If you need custom code to be able to extend your production, then include code hooks that will be called if implemented.
e.g.
In your production class include code during processing that checks for classes inheriting froma specific abstract class you also defined and call the respective method. Now any customisation can be done by inheriting from the abstract class and overwriting the respective methods.
We found a way to do the second part, importing the class from a file without overwriting a specific member. The trick is:
- open the old class definition with ##class(%Dictionary.ClassDefinition).%OpenId("class name")
- create a clone with %ConstructClone()
- load the class from the file without compiling it
- open the new class definition
- copy the member you want (in this case production definition XDATA) from the clone to the new class definition, and save the new class definition
- finally, compile the class.
IRIS supports multiple inheritance for methods, so create an abstract class which holds the methods and add it to a list of superclasses of your production class.