EOL and Flock [message #1061169] |
Thu, 30 May 2013 07:04  |
Eclipse User |
|
|
|
Dear Dimitris,
I want to call a Java calss from Flock migration script ( for example, blabla.mig). Could it be possible to do that?
My main idea is to get the EcoreUtil and some other java classes I define locally and call them in Flock.
For example, to assign UUIDs for each newly creatd model element using XMLResource and EcoreUtil.generateUUID()
-- other codes
migrate Course {
var assistant = new Migrated!Assistant();
var emfTool = new Native("org.eclipse.epsilon.emc.emf.tools.EmfTool");
var ecoreUtil = emfTool.ecoreUtil;
migrated.assistant = assistant
assistant.eResource().setID(assistant,ecoreUtil.generateUUID());
--other codes
}
or
migrate Course{
var assistant = new Migrated!Assistant();
migrated.assistant = assistant
var genUUID = new Native("university.utils.UUIDGenerator");
assistant.eResource().setID(assistant,genUUID.getUUID());
--other codes
}
I have followed the instruction and create a local class called emf.example.epsilon.test.GenerateUUID and followed the instruction given on
http://www.eclipse.org/epsilon/doc/articles/call-java-from-epsilon/ and http://www.eclipse.org/epsilon/examples/index.php?example=org.eclipse.epsilon.examples.clone
but I was not sussful. What should I do to call this classes while migrating the model?
Kind Regards,
Amanuel
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03215 seconds