Viabl Platform Variable Objects (e.g. Questions or Decision Trees) are derived from particular Base Classes. You can retrieve the Base Class of an object via the following .parentObj() method.
var gradeParent = #Grade.parentObj();
xpertrule.message("Grade is an instance of a " + gradeParent.aName + " object");