Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EOL and Flock(calling Java class in Epsilon Flock)
EOL and Flock [message #1061169] Thu, 30 May 2013 11:04 Go to next message
Amanuel Koshima is currently offline Amanuel KoshimaFriend
Messages: 6
Registered: October 2011
Junior Member
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
  • Attachment: EOL_Flock.zip
    (Size: 141.08KB, Downloaded 33 times)
Re: EOL and Flock [message #1061215 is a reply to message #1061169] Thu, 30 May 2013 14:45 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 310
Registered: January 2010
Senior Member
Could you please elaborate on how it was not successful? The error message and/or stack trace from Eclipse would be a big help.
Re: EOL and Flock [message #1061217 is a reply to message #1061215] Thu, 30 May 2013 14:52 Go to previous messageGo to next message
Amanuel Koshima is currently offline Amanuel KoshimaFriend
Messages: 6
Registered: October 2011
Junior Member
Hi Antonio,

I have attached the traces and both metamodel and model projects (i.e. the small example) that I have tried with in my first post (see the attachment file).


Re: EOL and Flock [message #1061397 is a reply to message #1061217] Fri, 31 May 2013 13:12 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 919
Registered: July 2009
Senior Member
Hi Amanuel,

You'll need to go to the Runtime tab of your MANIFEST.MF and add university.utils to the list of exported packages.

Cheers,
Dimitris
Re: EOL and Flock [message #1061471 is a reply to message #1061397] Fri, 31 May 2013 19:49 Go to previous messageGo to next message
Amanuel Koshima is currently offline Amanuel KoshimaFriend
Messages: 6
Registered: October 2011
Junior Member
Dear Dimitris,

I have added university.utils to the list of exported packages, but I still have the same error. The error trace is the following:


Caused by: Type 'university.utils.UUIDGenerator' not found (bundleentry://680.fwk27196165/model/migrationStrategy.mig@2:27)
at org.eclipse.epsilon.eol.types.EolNativeType.<init>(EolNativeType.java:37)
at org.eclipse.epsilon.eol.execute.TypeExecutor.execute(TypeExecutor.java:75)
at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:226)
at org.eclipse.epsilon.eol.execute.NewExecutor.execute(NewExecutor.java:26)
at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:226)
at org.eclipse.epsilon.eol.execute.AssignExecutor.execute(AssignExecutor.java:48)
at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:226)
at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:196)
at org.eclipse.epsilon.eol.execute.StatementBlockExecutor.execute(StatementBlockExecutor.java:26)
at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:226)
at org.eclipse.epsilon.flock.execution.EolExecutor.executeBlock(EolExecutor.java:42)
... 46 more
Re: EOL and Flock [message #1061483 is a reply to message #1061471] Fri, 31 May 2013 20:56 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Amanuel,

I'm afraid you've hit a bug here. I've fixed it locally and will
commit/release a new interim version when I have a more reliable internet
connection (I'm currently on a train) - most probably tomorrow morning.

Cheers,
Dimitris
Re: EOL and Flock [message #1061501 is a reply to message #1061483] Sat, 01 June 2013 08:33 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 919
Registered: July 2009
Senior Member
Hi Amanuel,

This has been fixed in the latest interim version:

http://download.eclipse.org/epsilon/interim/

Cheers,
Dimitris
Re: EOL and Flock [message #1061506 is a reply to message #1061501] Sat, 01 June 2013 11:39 Go to previous message
Amanuel Koshima is currently offline Amanuel KoshimaFriend
Messages: 6
Registered: October 2011
Junior Member
Dear Dimitris,

Thank You! It works perfect now with the latest interim version.

cheers,
Amanuel
Previous Topic:getContainmentReferences error
Next Topic:GridLayout problem
Goto Forum:
  


Current Time: Mon Dec 22 00:11:42 GMT 2014

Powered by FUDForum. Page generated in 0.06622 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software