Skip to main content



      Home
Home » Modeling » Epsilon » EOL and Flock(calling Java class in Epsilon Flock)
EOL and Flock [message #1061169] Thu, 30 May 2013 07:04 Go to next message
Eclipse UserFriend
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 189 times)
Re: EOL and Flock [message #1061215 is a reply to message #1061169] Thu, 30 May 2013 10:45 Go to previous messageGo to next message
Eclipse UserFriend
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 10:52 Go to previous messageGo to next message
Eclipse UserFriend
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 09:12 Go to previous messageGo to next message
Eclipse UserFriend
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 15:49 Go to previous messageGo to next message
Eclipse UserFriend
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 16:56 Go to previous messageGo to next message
Eclipse UserFriend
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 04:33 Go to previous messageGo to next message
Eclipse UserFriend
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 07:39 Go to previous message
Eclipse UserFriend
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: Thu Jul 24 16:53:46 EDT 2025

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

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

Back to the top