Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to call a Java service
How to call a Java service [message #1699234] Mon, 22 June 2015 19:43 Go to next message
qwer qwer is currently offline qwer qwerFriend
Messages: 9
Registered: June 2015
Junior Member
Hi everyone,

a couple of days I'm trying to call a Java Service from my viewpoint but I can't make it work. I need a service with a method which creates a label for a component of my diagram.
I have a single viewpoint specification project with my metamodel, model, .odesign and in src/mypackage I defined the Java service with a public constructor with no arguments and a public method which takes a paramter from type EObject and returns an EObject. I tried to reference the service through Java Extension (with path: MyProject/src/mypackage/Service.java) but it doesn't seem to be working. The service could not be found and I am not able to call the method (through Service:myMethod or [myObject.myMethod()/]).
Could you please tell me, what I'm doing wrong and what is the right way to call a Java Service. Sirius is something new for me, I'm a beginner.

Thank you in advance! Smile
Re: How to call a Java service [message #1699339 is a reply to message #1699234] Tue, 23 June 2015 13:33 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 500
Registered: July 2009
Location: Nantes, France
Senior Member
Hi "qwer qwer"


Le 23/06/2015 15:08, qwer qwer a écrit :
> Hi everyone,
>
> a couple of days I'm trying to call a Java Service from my viewpoint but
> I can't make it work. I need a service with a method which creates a
> label for a component of my diagram.
> I have a single viewpoint specification project with my metamodel,
> model, .odesign and in src/mypackage I defined the Java service with a
> public constructor with no arguments and a public method which takes a
> paramter from type EObject and returns an EObject. I tried to reference
> the service through Java Extension (with path:
> MyProject/src/mypackage/Service.java) but it doesn't seem to be working.

You will find information about Java services in [1], note that you have
to use the "fully qualified Java name" of your service class.

You should try: mypackage.Service


> The service could not be found and I am not able to call the method
> (through Service:myMethod or [myObject.myMethod()/]).

"Service:" is not supported, the prefix of the service interpreter is
"service:".

> Could you please tell me, what I'm doing wrong and what is the right way
> to call a Java Service. Sirius is something new for me, I'm a beginner.
>
> Thank you in advance! :)

Regards

--
Maxime - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
--
[1]
https://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html#service_methods


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to call a Java service [message #1699361 is a reply to message #1699339] Tue, 23 June 2015 15:32 Go to previous message
qwer qwer is currently offline qwer qwerFriend
Messages: 9
Registered: June 2015
Junior Member
Thank you, Maxime but it doesn't work again. I suppose, the different parts have to be deployed on different eclipse instances but I don't know which parts and in what kind of projects. I found this topic here and in one of the posts there are two exmples attached but the links don't work. https://www.eclipse.org/forums/index.php/t/632359/
Do you have any exmaples with Java services?
Previous Topic:Get model file location of current editing diagram
Next Topic:How to implement Label Propagation Mechanism with the Java Extension or Java Service?
Goto Forum:
  


Current Time: Tue Jan 19 18:07:28 GMT 2021

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

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

Back to the top