How can load the class name from the available child class details
Hi Team, I want to get the class name from the child (subclass)deatils. We have part & document as a class for the base class Item. I have sublass called “XYZ” and details of it like number, type etc , i am able to read it. But in my code i need to check for only Part type class not the Document type. Since i am reading the CO first to get Affected Item and iterate to get item deatils. while iteration only i want to check that the Affected item is of Document type and skip its check in my code. below code is available in the user guide . But i do not want to check it from the admin user deatils. IAgileClass[] classes = m_admin.getAgileClasses(IAdmin.CONCRETE); for (int i = 0; i < classes.length; i++) { if (classes[i].getTargetType() == IItem.OBJECT_TYPE) { System.out.println(“Class Name : ” + classes[i].getName()); System.out.println(“ID : ” + classes[i].getId()); } } }
Personally, I usually check this by fetching the IAgileClass of the affected item, and then using the isSubclassOf method:
ITable affectedItems = ichg.getTable(ChangeConstants.TABLE_AFFECTEDITEMS);
Iterator it = affectedItems.Iterator();
while(it.hasNext()){
IRow row =(IRow)it.next()
IAgileClass subcls = row.getReferent().getAgileClass();
if(subcls.isSubclassOf("Documents"){
//ignore
else if(subcls.isSubclassOf("Parts"){
//DoSomething
}
}