General questions about the EMFNotationSourceModelStorage #1334
Replies: 1 comment
-
Hi @MichaZoomZoom, Part 1: If your elements are uniquely identified by their names, you can use these names as For further reference, you might find this example useful: GLSP Examples - Java EMF Eclipse. Additionally, you could store notation-related properties directly in the semantic model. Part 2: From an older example of ours, I can share a snippet, where we created the empty models on the backend to ensure the user can create an project (consisting of an empty semantic and notation model). ...
protected Model createNewModel(final URI modelUri) {
Model newModel = MyModelFactory.eINSTANCE.createModel();
String modelName = modelUri.lastSegment().split("." + modelUri.fileExtension())[0];
newModel.setName(modelName);
return newModel;
}
protected Diagram createNewDiagram(final Model model) {
Diagram newDiagram = NotationFactory.eINSTANCE.createDiagram();
SemanticElementReference semanticElement = NotationFactory.eINSTANCE.createSemanticElementReference();
semanticElement.setUri(EcoreUtil.getURI(model).fragment());
newDiagram.setSemanticElement(semanticElement);
return newDiagram;
}
... I hope this helps! If you have any more questions or need further assistance, please don't hesitate to reach out. ✨ |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
I got some questions about the
EMFNotationSourceModelStorage
:Are there any preconditions to the metamodel to use this storage? I saw there is a mapping between the elements of the semantic and notation model, done by the
EMFSemanticIdConverter
. The 'TaskList' nodes provide an 'Identifiable' which is set during the task creation in the handler. So the subquesition would be is this the id the converter uses or exists there any other id in the background? I want to reuse an existing metamodel which does not provide such an 'Identifiable' - the elements are just distinguished by there names, so maybe I could adapt this.How do I start a client session without any existing source model files in the
app
folder of the client? Do I have to provide any empty notation or semantic model files or could I even reuse a semantic model from a Sirius-Editor with the same metamodel? Or do I have to implement something which creates them?I would be thankful for any kind of help. And please tell me if there are already wrong assumption in the questions, I am just new to the whole topic.
Beta Was this translation helpful? Give feedback.
All reactions