I am facing a problem and I am kind of desesperate :
I am trying to transform a constraint OCL into a C# program. To do so, I define my ocl constraints in a CompleteOCL document, and I save it as Abstract Syntax : POC.ocl.oclas. Then I use Acceleo with the Pivot Meta-model ('http://www.eclipse.org/ocl/2015/Pivot').
However, common OCL operations (such as 'size') are defined in another model : the Library. So when I try to recover operations used on my OCL model, nothing happened, I can only recover the operation I defined in my ocl document.
When I opened POC.ocl.oclas, I have these 2 models : POC.ocl model + Library model.
I defined these generation :
[comment encoding = UTF-8 /]
[module generate('http://www.eclipse.org/ocl/2015/Pivot','http://www.eclipse.org/ocl/2015/Library')]
[template public generateElement(aModel : Model)]
[comment @main/]
[file (aModel.name + 'xx', false, 'UTF-8')]
yo
[/file]
[/template]
And it only generate one file : "POC.oclxx", not "Library.oclxx"
That lead us to this question : Is it possible in Acceleo to make a reference to another model (than the main one) ? And if it is, how to do that ?
ANNEXE :
The code I wrote :
[comment getCode() opération/]
[template public getCode(operationCallExp : pivot::OperationCallExp) post (trim())]
[operationCallExp.ownedSource.getCode()/]
[operationCallExp.referredOperation.name/][operationCallExp.ownedArguments -> getArguments()/]
[/template]
In theory, [operationCallExp.referredOperation.name/]
gives me the name of the operation. In reality, it gives me nothing, except when I defined the operation (and thus when the operation doesn't come from the OCL Library)
Thank you in advance !
The zipped projet : Archive_OCL_Acceleo
The POC folder contains POC metamodel (POC.ecore), OCL constraint on this metamodel (POC.ocl) and the Pivot model associate (POC.ocl.oclas). Files generated by Acceleo are in the files folder
The POC_Acceleo forlder contains the Acceleo transformation (generate.mtl)