Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Can not reference my own Service ("Unknown service...")
icon9.gif  Can not reference my own Service ("Unknown service...") [message #1225515] Mon, 30 December 2013 02:56 Go to next message
Michael Lukaszczyk is currently offline Michael LukaszczykFriend
Messages: 14
Registered: November 2013
Junior Member
Hey there,

(please take simultaneously a look at the screenshot to get an idea of my setup)

Screenshot: http://i.pictr.com/4tyyzl0c41.png

right now I want to create a custom Service that for example just builds a String like the render methods in the EcoreService Class in the sirius...design package. I then reference it like in the ecore.odesign (I tried several classifiers for referencing: my.project.design.src.service.FooService, src.service.FooService, service.FooService, FooService, /my.project.design/src/service/FooService.java etc). Then I created some rules to draw a node based on EClass and display this node on the diagram canvas. The label of this node is supposed to be named via the service method. So I created a Square description with the Label Expression "service:fooService". But I get this error: Feature: labelExpression Unknown service fooService and the Label of the node is "invalid feature name". But it should be "foo" like you can see on the screenshot in FooService.java.

Am I missing something? Do I have to make a special build? So the FooService will be found by sirius? Am I taking a wrong qualifier? I don´t get it.

Thanks,

Michael

[Updated on: Mon, 30 December 2013 02:57]

Report message to a moderator

Re: Can not reference my own Service ("Unknown service...") [message #1225604 is a reply to message #1225515] Mon, 30 December 2013 09:11 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Le 30/12/2013 03:56, Michael Lukaszczyk a écrit :
> Hey there,

Hi Michael,


>
> (please take simultaneously a look at the screenshot to get an idea of
> my setup)
>
> ! I had to add whitespaces to the link since my account can´t post links !
> Screenshot: arrgh -.-" Can´t post links until I have at least 5
> messages. I´ll edit the link or post again when I have the permission
>
> right now I want to create a custom Service that for example just builds
> a String like the render methods in the EcoreService Class in the
> sirius...design package. I then reference it like in the ecore.odesign
> (I tried several classifiers for referencing:
> my.project.design.src.service.FooService, src.service.FooService,
> service.FooService, FooService,
> /my.project.design/src/service/FooService.java etc)

If you created a MyServices class in the my.sample.package package of
your sepecification project, you simply have to reference it with its
Java qualified name in the 'Qualified Class Name' property of the Java
Extension element created in your Viewpoint, ie:
my.sample.package.MyServices (see [1]).


> . Then I created some
> rules to draw a node based on EClass and display this node on the
> diagram canvas. The label of this node is supposed to be named via the
> service method. So I created a Square description with the Label
> Expression "service:fooService".

This is an accepted form (see [2])


But I get this error: Feature:
> labelExpression Unknown service fooService and the Label of the node is
> "invalid feature name". But it should be "foo" like you can see on the
> screenshot in FooService.java.
>
> Am I missing something? Do I have to make a special build? So the
> FooService will be found by sirius? Am I taking a wrong qualifier? I
> don´t get it.

You encountered one of the Service interpreter limitations documented in
[2]:
"Intended limitations exist to be more efficient:
The services should be in the same bundle as the VSM and should be deployed"

You should deploy your VSM, ie launch a runtime to test the services.

I attached two sample projects SampleProjectWithService.zip and
SampleProjectWithService2.zip both contaiingn a sample service and some
node mappings which use this service. SampleProjectWithService.zip has
the particularity to define a third mapping which uses the service in an
Acceleo expression: it shows how to call a service in Acceleo expression
but it also has the side effect to make the service available without
deployment for the Service interpreter. The Acceleo interpreter is able
to find non deployed services but for a simple service call without
complex expression, it will be less efficient once deployed.

>
> Thanks,
>
> Michael


Regards,

Maxime


[1]
http://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html#service_methods

[2]
http://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html#specialized


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Can not reference my own Service ("Unknown service...") [message #1225846 is a reply to message #1225604] Tue, 31 December 2013 00:28 Go to previous messageGo to next message
Michael Lukaszczyk is currently offline Michael LukaszczykFriend
Messages: 14
Registered: November 2013
Junior Member
Great! Thank you very much! The Acceleo way seems to do the trick for me perfectly. But can you please explain me the VSM deploying process?

Thanks,

Michael
Re: Can not reference my own Service ("Unknown service...") [message #1225953 is a reply to message #1225846] Tue, 31 December 2013 08:30 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Michael

Le 31/12/2013 01:28, Michael Lukaszczyk a écrit :
> Great! Thank you very much! The Acceleo way seems to do the trick for me
> perfectly. But can you please explain me the VSM deploying process?

As mentionned in [1], the Viewpoint Specification Projects are normal
eclipse plug-in project and their activator start/stop methods handle
the Viewpoint register process.

So the VSM deploying process is simply an Eclipse deploying process:
during development, you can simply launch a runtime to use/test/debug
your services. Deployed VSM will be available in the Viewpoint Selection
dialog (the plugin icon overlays the Viewpoint one).


>
> Thanks,
>
> Michael

Regards,

Maxime

[1]
http://www.eclipse.org/sirius/doc/specifier/general/Specifying_Viewpoints.html#Viewpoint
Specification Projects


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Sirius on MacOSX
Next Topic:Diagram extensions behave differently
Goto Forum:
  


Current Time: Tue Apr 23 08:59:44 GMT 2024

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

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

Back to the top