To create a
RecordType object, first
specify all the required properties. You can obtain the property descriptions
of all the required properties as shown in the code snippet given
below:
//Returns the property descriptions that are required to create a RecordType object
public PropertyDescriptions obtainRecordTypeProperties (RMObjectStore aoRMObjStr )
throws PropertyNotFoundException
{
ClassDescriptions loClassDescriptions =
aoRMObjStr.getClassDescriptions( new int[]{RMType.RM_TYPE_RECORDTYPE});
ClassDescription loClassDescription = (ClassDescription) loClassDescriptions.get(0);
PropertyDescriptions loPropertyDecriptions =
loClassDescription.getPropertyDescriptions();
loPropertyDecriptions =
(PropertyDescriptions) loPropertyDecriptions.filterByProperty(Property.IS_VALUE_REQUIRED,
ReadableMetadataObjects.IS_EQUAL,true);
return loPropertyDecriptions;
}
Then call the
createRecordType method
on an
RMObjectStore object as shown in the following
code snippet:
//Creates the RecordType object on the RMObjectStore interface
public void createRecordType(RMObjectStore aoRMOS, Properties aoRTProps,
Permission aoRTACLs)
{
RecordType loRecordType = aoRMOS.createRecordType(aoRTProps,aoRTACLs);
}