Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to access operations defined in a class of my metamodel when in a sirius instance
How to access operations defined in a class of my metamodel when in a sirius instance [message #1841518] Wed, 19 May 2021 19:45 Go to next message
Thomas Chiang is currently offline Thomas ChiangFriend
Messages: 83
Registered: March 2020
Member
Hi,

I'm just playing around and trying to figure out how some things work in Sirius, specifically around Java External Actions. I'm thinking I might need to make some custom methods to allow for model navigation and highlighting but I'm not sure how to go about it. To start off I have been trying to create some operations in my Ecore metamodel but now I'm running into the problem about not even knowing how to call it from either my java external action or aql. Any help?
Re: How to access operations defined in a class of my metamodel when in a sirius instance [message #1841530 is a reply to message #1841518] Thu, 20 May 2021 07:52 Go to previous message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 180
Registered: October 2014
Senior Member
Hello

You can effectively call java code using either JavaAction or directly service with AQL.

I recommend the use of AQL which is simpler to write and does not require any extension

With Sirius, to call a service with AQL, just add a service java class and call it with aql:self.myservice(xxx)
Refer to the documentation https://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html#service_methods

To call a Java action refer to the documentation : https://www.eclipse.org/sirius/doc/specifier/general/Model_Operations.html#extensions

More documentation about AQL : https://www.eclipse.org/acceleo/documentation/aql.html

Regards
Laurent


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:What is this icon, and can I use it?
Next Topic:Forcing some mappings to anchor on the diagrams' edge
Goto Forum:
  


Current Time: Sun Sep 25 21:15:20 GMT 2022

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

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

Back to the top