papyrusm2doc

m2doc ERROR: EClassifier=String is not registered in the current environment


I use m2doc in eclipse papyrus. When I click on the element, I can see its properties.

enter image description here

It has the property "Name".

But when I use self.name in m2doc interpreter, I got this error: m2doc ERROR: EClassifier=String is not registered in the current environment (117, 122)

If I use self.visibility or self.namespace, I can get the correct value in the properties view.

Here, self is the variable I defined when I create my m2doc project, and its value is the element I clicked on.

I went through some other questions on stack overflow, one of a related question is this: EClassifier=Boolean is not registered in the current environment

But the answer did not help me, because the properties of the element self are all default properties of a papyrus model element, I did not create them, and I cannot define their types. I just filled in the blanks when I created the element.

I want to get the name of the element, how can I achieve that? Please help me, thank you.


Solution

  • From the Papyrus metamodel, it looks like EAttribute "name" is of type org.eclipse.uml2.types/model/Types.ecore#//String. Did you register the nsURI of Types.ecore?