How to set a custom ID for a concept created via Open API?
Hi all,
I am creating different concepts via Open API. Instances of those concepts are then used in my model solution. If I delete such a concept and recreate it again, my model will be broken. I figured that this is due to the internal id of a concept.
So is there a way to set the id of such a concept to a custom one?
Best,
Dennis
I am creating different concepts via Open API. Instances of those concepts are then used in my model solution. If I delete such a concept and recreate it again, my model will be broken. I figured that this is due to the internal id of a concept.
So is there a way to set the id of such a concept to a custom one?
node<ConceptDeclaration> cncpt = new node<ConceptDeclaration>(); cncpt.name = "Test"; info "ID: " + cncpt/.getNodeId(); // Now I want to the set id kinda like this: cncpt/.setNodeId(...); // ??
Best,
Dennis
Please sign in to leave a comment.
https://confluence.jetbrains.com/display/MPSD32/Migrations
conceptNode.setId(oldConceptNodeId);
Currently, concept id is a pair of [languageId, conceptNodeId]. So, if the concept node has the same id as the old concept node and is located in the same language, conceptIds will be the same
However, it is not guaranteed that it will remain the same in future, our plan is to introduce a new property in AbstractConceptDeclaration, which will contain the id of the concept, so that it would be possible to change the future conceptId just in the editor of structure model or using smodel language.