[XPAND] Xpandfacade with metamodel .ecore [message #1093594] |
Sat, 24 August 2013 06:01  |
Eclipse User |
|
|
|
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 .
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03000 seconds