Starting from an Ecore metamodel with OCL constraints (written in OCLinEcore editor), I should generate an ATL transformation that contains the OCL constraints translated into ATL.
I don't know if it is convenient to use a ATL higher order transformation or Java to generate my ATL file. Is there any documentation or examples that treat/analyze Ecore metamodel with OCL constraints?
"I should generate an ATL transformation" makes no sense. Perhaps you are misunderstanding English's could/should/would/...
What do you actually want to do? What did you try to do? What did you fail to observe?
OCL enriches a Java-defined model, perhaps with interpreted, perhaps with CGed validations. These should be just as irrelevant to ATL as manually defined Java validations.
There are tutorials on OCL, OCLinEcore.
If you want to generate a transformation from a transformation, I would recommend that you use a language whose metamodel and semantics are better defined. Perhaps QVTo, perhaps QVTr which is becoming increasingly credible. Oxygen M5 even has a graphical syntax for it.
Yes, perhaps I had to use "would" instead of "should". Please excuse my poor English.
There are tutorials on OCLinEcore that show how to create metamodels and model instances, and how to validate them, etc. But I'm interested only at the use of the metamodels as input of a HOT.
I try to generate a ATL transformation from a Ecore metamodel (using a higher order transformation. In preference : written in ATL). What I fail to do, is to access the OCL constraints embedded in the metamodel in order to translate them into equivalent ATL helpers.
I asked about the use of Java because Java code that exploits the embedded OCL can be generated and perhaps, that can help translating the constraints. I'm just lost in front of several possibilities and I wish someone that has an experience can lead me to the more suitable solution.
If you are in the purely modeling world, Java is irrelevant (apart from speed optimizations.)
The OCL embedded in Ecore is embedded as EAnnotations. Read the tutorial, or the XML. Within an EAnnotation the OCL is an unparsed text string. If you want an OCL AST, then you can OCL->Save AS->Pivot in the OCLinEcore editor.