m2doc

EClassifier=Boolean is not registered in the current environment


I want to generate a docx from my own ecore model. With most of the querys it works fine but I my new query show me the following error message in the mygeneration.validation.docx:

<---EClassifier=Boolean is not registered in the current environment

I have test the querys with the Sirius Interpreter and aql. In the interpreter I got the result i want.

Running query: aClass.Name (Result is a String)

Not Running query: aClass.IsAbstract (Result is a Boolean)

I have searched on Google, but it seems that no one else has the same error message. Does anyone have any idea how I can solve this?

Thanks


Solution

  • I guess your metamodel (.ecore) has the concept of Class and the aClass.IsAbstract has an eType of Boolean which is also defined in your metamodel.

    First of all you should register you metamodel using its nsURI in the template. You can use the template property wizard to do so.

    For your EAttribute IsAbstract you may want to reuse EString, EBoolean, ...

    If you choose to create your own Boolean, you should declare it as an EDataType and set its instance class name to boolean or java.lang.Boolean (Java types). This way AQL and M2Doc can evaluate the value as a boolean in conditions for instance.