| [XPAND] Xpandfacade with metamodel .ecore [message #1093594] |
Sat, 24 August 2013 06:01  |
Adnan AL-SOSWA Messages: 33 Registered: May 2010 |
Member |
|
|
HI ALL ,
I am new with xapnd language , and I am wondering if there is any good documentation about xpnadfacade and how to use it .
I have actually a template written in xpand language to generate code out of .ecore file . all work fine when I run it using the workflow as " run as " after some modification for workflow file to run on .ecore file for sure.
but I want to use the template without workflow from java code . I reached to xpandfacade as the solution but I do not know how to specifiy my .ecore file as it is parameter in my application and the user will choose .ecore file from enry form I offer .
sample of my code
Shell shell = new Shell(Display.getDefault());
FileDialog modelDialog = new FileDialog(shell, SWT.OPEN);
modelDialog.setFilterExtensions(new String[] { "*.ecore" });
modelDialog.setText("Select Model to transform...");
String modelSelected = modelDialog.open();
now I have my model as string in modelSelected variable .
after creating xpand context i use
xpandfacade.evaluate(java.lang.String definitionName,
java.lang.Object targetObject,
java.lang.Object... params)
definitionName : I use the template path separated by ::
but I do not know what is targetObjec, and params . and how I specify my model with this function ?
sorry for my bad english ,hope to see some responses soon .
|
|
|
|
| Re: [XPAND] Xpandfacade with metamodel .ecore [message #1096050 is a reply to message #1095564] |
Tue, 27 August 2013 18:45   |
Adnan AL-SOSWA Messages: 33 Registered: May 2010 |
Member |
|
|
Thank you christian for response.
what I meant that my model that i am working with is actually the .ecore file which is the metamodel . and this .ecore is choosen by user from system , so the model is not included in my plugin. and I want to implement my template file on this metamodel .ecore file
i have for example this path of the model
c:\mymodels\mymodel.ecore , and I have template that access the element in this model
with this path
Template::mytemplate::main
how I can use xpandfacde class with these file mymodel.ecore and the template ?
thanks again and please be patient with me 
[Updated on: Tue, 27 August 2013 18:46] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04395 seconds