Can not reference my own Service ("Unknown service...") [message #1225515] |
Mon, 30 December 2013 02:56 |
Michael Lukaszczyk 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 |
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03131 seconds