How to set primary classification attribute while creating part
Hi All,
I am trying to create a WTPart from java. In my set up the classification is set as a mandatory attribute.
Could you please help me on how to set the value of the primary classification? I tried to set the default value for the classfication, however it does not work. Here is the code I am using to create WTPart.
WTPart wtpart=WTPart.newWTPart();
try {
/
TypeIdentifier typeidentifier = TypeHelper.getTypeIdentifier("WCTYPE|wt.part.WTPart");
WCTypeIdentifier wctypeidentifier = (WCTypeIdentifier) typeidentifier;
TypeDefinitionReference typeDefinitionReference = TypedUtilityServiceHelper.service.getTypeDefinitionReference(wctypeidentifier.getTypename());
wtpart.setTypeDefinitionReference(typeDefinitionReference);
wtpart.setName("Test part007");
String container_path = "/wt.inf.container.OrgContainer=yyyy/wt.pdmlink.PDMLinkProduct=xxxx";
WTContainerRef containerRef = WTContainerHelper.service .getByPath(container_path);
wtpart.setContainerReference(containerRef);
String folder_path = "/Default";
Folder folder = FolderHelper.service .getFolder(folder_path,containerRef);
FolderHelper. assignLocation(wtpart, folder);
wtpart=(WTPart) wt.fc.PersistenceHelper.manager .store(wtpart);
}
Thanks in advance.

