How to get class from DB
Hi All,
How can i get class from database.
I found class and subclass in node table .
But how can i join this subclass with class.
———————————————————–
SUBCLASS
6141 6005 Mechanical Change Order 13 0 11210 3 ECO 15-FEB-07 20-APR-10
2470419 6005 Operational Change Order 13 0 0 2 OperationalChangeOrder 19-FEB-08 20-APR-10
2470425 6005 Environmental Change order 13 0 0 2 EnvironmentalChangeOrder 19-FEB-08 20-APR-10
2470431 6005 Software Change Order 13 0 0 3 SoftwareChangeOrder 19-FEB-08 20-APR-10
————————————————-
CLASS
6000 5002 Change Orders 5 0 10000 ChangeOrdersClass 15-FEB-07 20-APR-10
Thanks,
Dinesh
As mentioned in other answers, it is not a good idea to get information from Database but using the AgileSDK.
The code to retrieve the hierarchyis the following
Change->Change Order->Subclass
//From an Object: IAgileClass subclass = iDataObject.getAgileClass(); IAgileClass changeOrder= subclass.getSuperClass(); IAgileClass changes = changeOrder.getSuperClass(); //From AdminInstance IAgileClass agileClass = iAgileSession.getAdminInstance().getAgileClass(ChangeConstants.CLASS_CHANGE_BASE_CLASS); IAgileClass[] changes = agileClass.getSubclasses(); //{ChangeOrder; Change Request,....}
Just about everything in NODETABLE is part of a hierarchy. The entire configuration starts with the classes, and then proceeds down from there. Note that NODETABLE has an attribute named PARENTID. Find the ID for the Change Orders class (6000) and then execute the query “select * from NODETABLE where PARENTID=6000”. You will see LifeCycle Phases, Attributes, Actions, Tabs and User-Defined Subclasses. Run the same query but with the ID for the subclasses (6005, usually) as PARENTID. That will list the names of all of the Change Order subclasses. You can do the same for any other class.
Note that not everything for the configuration is in NODETABLE. PROPERTYTABLE, ADMINMSATT, ADMINCRITERIA, QUERY, CRITERIA and SELECT_LIST are just a few of the other tables in which configuration data is stored. As Antonio stated, it is far easier to use the SDK, because it knows how everything is connected. Figuring it out on your own to be able to get information using SQL queries will take a lot of time and energy, and you will have to re-check those queries every time you upgrade the schema. Whereas the SDK will always be correct.
you execute admin report you for all classes and subclass, Node ID will get published.
In DB,
All Agile Admin objects will start with ID
Select * from nodetable where id=5000;
Main admin node object select * from nodetable where parentid = 5000;
All admin subnode object will come select * from nodetable where parentid = 5001;
list of id of all Classes will get select * from nodetable where parentid = 5002;
Each class or Subcalss object will have child id that are associated with
Attributes, Tabs, User-Defined Subclasses, LifeCycle Phases, Actions
usid id associated with clss or subclass associated with id and parent id you can get details.
Example if attributes are needed for parts class
select * from nodetable where parentid = 10000;
elect * from nodetable where parentid = 10005;
if subclass is needed
select * from nodetable where parentid = 10000;
elect * from nodetable where parentid = 10004;
In Agile 9.3.3 there is package which will fetch needed information.
PDQ, you can use for simplicity. to get object and attribute info.