Hi Suresh,
This should work:
export async function createGeneralization(model: IModel, moduleName: string, entityName: string) {
const domainModelInterface = model.allDomainModels().filter((dm) => dm.containerAsModule.name === moduleName)[0];
const domainModel = await domainModelInterface.load();
const newEntity = domainmodels.Entity.createIn(domainModel);
const generalization = domainmodels.Generalization.create(model);
const generalizedEntity = model.findEntityByQualifiedName("System.Image");
if (generalizedEntity) {
generalization.generalization = generalizedEntity;
}
newEntity.name = entityName;
newEntity.generalization = generalization;
}
+1 Same Problem as OP. Cannot find any System Entites, and System as a module is also not to be found.
Workaround:
Create a entity (in studio) that generalises System.FileDocument or what you need, and in your Code use that to Generalise from:
-> use workingModel.findEntityByQualifiedName("<yourModule>.NotesAttachment") or what your entity is called.
Don't forget that you have to commit the entity so that your SDK knows of the entity.