The Java Class Name Manager
The Java Class Name Manager supplied with Creo Elements/Direct Manager Server determines what database class an object belongs to. The steps it uses to do this are:
1. Get a list of all database classes from the database. If there are excluded classes (from the <ExcludeSearchClassName> tag), they will not be included in this list. If there is a list of classes to search (from the <SearchClassName> tag), only those classes will be included.
2. Go through the list one-by-one, and check the active xml to see what business object class is associated with the database class (from the <BusinessObjectClass> tag).
a. If no business object class is specifically defined for the database class in the xml, it is ignored.
b. There can be only one business object class per database class.
c. A business object class can be associated with more than one database class.
3. Determine if the business object class inherits from a base business object class.
For example:
A database class is defined as a part if the business object class inherits from com.osm.datamgmt.biz.Part
The MASTERDATA class business object class is:
<BusinessObjectClass>com.osm.dm.biz.DMMasterdata</BusinessObjectClass>
This business object class defines the data type as a part because it is an extension of com.osm.datamgmt.biz.Part
A database class is defined as a drawing if the business object class inherits from com.osm.datamgmt.biz.Drawing
The DRAWING_2D class business object is:
<BusinessObjectClass>com.osm.dm.biz.DMDrawing2D</BusinessObjectClass>
This business object class defines the data type as a drawing because it is an extension of com.osm.datamgmt.biz.Drawing
A database class is defined as a model if the business object class inherits from com.osm.datamgmt.biz.Model
The MODEL_3D class business object is:
<BusinessObjectClass>com.osm.dm.biz.DMModel3D</BusinessObjectClass>
This business object defines the data type as a model because it is an extension of com.osm.datamgmt.biz.Model
The class name manager also controls whether the Change Class action is available from the Action menu. This menu item will only be available if you configure multiple classes for this data type (models, drawings, parts, etc.).
A Model or Drawing can be saved to a user specified database table (class) in the Model Manager Save window. The Java class name can be chosen during the first save to the database; sample Model class names: MODEL_3D or MY_MODEL_CLASS
* 
The class name cannot be re-set in the Save window after the first save.
The class of a drawing or model can be changed after the first save in the Model Manager Workspace window. Right-click on the Workspace entry to produce a menu with the 'Change Class' option.
Customizing the class name manager
The "class manager" Java code can be customized to use a specified class as the default class for saving data.
A customization to the Creo Elements/Direct Model Manager business object class code can be made to programmatically choose the save class name based on parameters like part name, or the user’s group name.
The xml files can be configured to show the document or part class attributes. If there is more than one class defined for a certain data type, a pull down menu will be available in the save window. This menu will allow the user to choose the class to use when saving the data.
Configuring a custom Class Name Manager
A different MMClassNameManager may be created by either:
Extending the MMClassNameManager class and overwriting the required methods, or
Implementing the IClassNameManager interface.
The new MMClassNameManager must then be registered in the Options section of the xml file by specifying the fully qualified class name using the tag <ClassNameManager>.
MMClassNameManager methods:
MMClassNameManager has a set of methods that get a list of classes defined as a given data type. For example
getDrawingClasses
getLibraryClasses
getModelClasses
getPartClasses
etc
Each of these methods calls getClassInstances(xxxx) where xxxx is actually one of the following classes:
Drawing
Library
Model
Part
etc.
For example:
WMSession.getWMSession().getClassInstances(Drawing.class);
The getClassInstances method queries the database for all database class names. Then the program finds the names of the business objects for each database classes as defined in the xml file. If the business object is an instance of the class name in the getClassInstances argument field, then that database class is added to the returned list of classes
There is another set of methods that return one of the items in the list returned by the getxxxxClasses lists. The method returns the first item in the list that matches the logic in the getxxxxClasses list. For example:
getDrawingClassName
getFrameClassName
getLibraryClassName
getModelClassName
getPartClassName
etc.
CAUTION FOR CONFIGURING CUSTOM CLASSES:
Strange behavior may occur if the class name manager does not recognize the object as the desired data type.
For example:
You have a special database class called MY_PART_CLASS. The xml configuration for the class defined the business object as com.osm.biz.WMPart instead of a class extended from com.osm.datamgmt.biz.Part. A drawing was created and linked to the special part class. When the drawing was loaded into Creo Elements/Direct Annotation, no part text reference attributes were sent to Creo Elements/Direct Annotation because Creo Elements/Direct Model Manager did not recognize MY_PART_CLASS as a part.
Was this helpful?