|
|
|
Re: How can i persist a new created KDM model? [message #1222202 is a reply to message #1222087] |
Thu, 19 December 2013 22:27 |
keynne Belle Messages: 30 Registered: January 2013 |
Member |
|
|
Thank you. Your explanations really helped me to persist my structure model.
I have another question about the StructureModel. I have populated my structure model with components and I created and saved the 9 structure relationships between these components. However, when i open my KDM representation with the MoDisco browser, i see the 9 structure relationships among the Types but i do not see these relationships among the Instances of my segment (in the tree viewer). I have attached a file to illustrate my problem. Below are the main instructions i use to create a structure relationship between two components. Could you help me figure out what is wrong with my code?
//create a new structure model
//populate the structure model with new components
//use the method below in a loop to create the structure relationships
private void createAStructureRelationship(Resource resourceModel, Component startComponent,
Component endComponent){
StructureRelationship structureRelation = StructureFactory.eINSTANCE.createStructureRelationship();
structureRelation.setFrom(startComponent);
structureRelation.setTo(endComponent);
EList<AbstractStructureRelationship> outgoingRelations = startComponent.getStructureRelationship();
outgoingRelations.add(structureRelation);
//add the structure relationship to the resource
resourceModel.getContents().add(structureRelation);
}
//add the structure model to the KDM segment
//add the KDM segment to the resource model
//save the resource model using the instruction : resourceModel.save(null);
[Updated on: Thu, 19 December 2013 22:39] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04340 seconds