Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Calling Java Service
Calling Java Service [message #1744043] Wed, 21 September 2016 16:35 Go to next message
Alex B. is currently offline Alex B.Friend
Messages: 20
Registered: June 2016
Junior Member
Hi,

I got a problem when I try to call a Java Service in a precondition of a connection.

When I type "service:" the content assist does not show my Java Service that I declared as a Java Extension with its Fully Qualified Domain Name.

I got one source folder having two packages (additionally tried with a services source folder, but did not work either):
org.eclipse.myprojectname.design and
org.eclipse.myprojectname.design.service (having a Java class named DiagramServices.java).

My project name is equal to the first package name from above. So my Java Extension has the FQDN: org.eclipse.myprojectname.design.service.DiagramServices

I started a new Eclipse instance which contained the sample project. Not even that the AQL ínterpreter does not show my service in the content assist, it does also not execute, since a simple System.out.println(...) in the service method does not show up.

Following the steps from the documentation or the tutorial did not help.

Any ideas? I was not able to find any known issues in this field, so I might do something wrong...

Here is my complete service:

package org.eclipse.myprojectname.design.service;

import org.eclipse.emf.ecore.EObject;

public class DiagramServices {

	public DiagramServices() {	
	}
	
	public EObject foo(EObject bla){
		System.out.println("------------------------aAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
                return null;
	}
}


Thx!

[Updated on: Wed, 21 September 2016 16:40]

Report message to a moderator

Re: Calling Java Service [message #1744072 is a reply to message #1744043] Thu, 22 September 2016 08: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
Hi Alex,

Your declaration of your Java service seems ok. (I would just make a modification and return bla in the implementation, for later reuse of the service in change context task for exemple)
I tested with Sirius 4.0.0 with the same "names" than you.
I get the foo service on ContainerMapping, NodeMapping, EdgeMapping expressions (preconditions and other).
Did you put the id of the mappings, the domain class ?
Did you register your metamodels in the Metamodels property tab of the diagram description ?

Regards;

Maxime
Re: Calling Java Service [message #1744082 is a reply to message #1744072] Thu, 22 September 2016 09:19 Go to previous messageGo to next message
Alex B. is currently offline Alex B.Friend
Messages: 20
Registered: June 2016
Junior Member
Hi Maxime,

thx for your reply.

Quote:
Did you put the id of the mappings, the domain class ?

Yes, I set the Id and the domain class properly. The latter was proposed in the content assist, so I assume that the metamodel is correctly referenced.

Quote:
Did you register your metamodels in the Metamodels property tab of the diagram description ?

Yes, the reference exists.

Do I maybe need to import any special plugin?

Could you maybe attach both projects that you created? - Maybe I can find the mistake by simply comparing the projects.

In general: Would it principally be possible to get some questions answered outside of this forum by Obeo Sirius Pros? - I already contacted Obeo, but received no reaction... :/

Thx and regards!
Alex
Re: Calling Java Service [message #1744089 is a reply to message #1744082] Thu, 22 September 2016 09:49 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Alex,

You will find attached two zips:
. org.eclipse.myprojectname.design.zip : contain an incomplete VSM on Ecore metamodel, with several mappings (domain class set to an Ecore class), interpreted expressions completed with autocompletion, foo() was proposed.
. org.eclipse.myprojectname.design2.zip: I replay the same steps but with the basic family sample model and in a runtime. foo() was also proposed.

I noticed a glitch: if i select the interpreter using the auto-completion, then the next call to auto-completion does nothing I need to re-select the property section or to write and delete some characters.

If I type service: or aql: then I can continue with auto-completion.
It seems that calling auto-completion just after selecting an auto-completion result and without writing anything between the two calls fails.

Could you try to type the interpreter (service: or aql:) and then call the completion ?

An additional idea, your service does not require it yet, but you could add the dependancy between your odesign plugin and the plugin declaring the metamodel

Regards;

Maxime
Re: Calling Java Service [message #1744091 is a reply to message #1744089] Thu, 22 September 2016 10:05 Go to previous messageGo to next message
Alex B. is currently offline Alex B.Friend
Messages: 20
Registered: June 2016
Junior Member
Hi Maxime,

thx for your reply.

Quote:
I noticed a glitch: if i select the interpreter using the auto-completion, then the next call to auto-completion does nothing I need to re-select the property section or to write and delete some characters.

I only found one project attached, but nevermind, I noticed the same glitch as you described.

Quote:
If I type service: or aql: then I can continue with auto-completion.
It seems that calling auto-completion just after selecting an auto-completion result and without writing anything between the two calls fails.
Could you try to type the interpreter (service: or aql:) and then call the completion ?

Meanwhile and after approximately 3 hours of searching I discovered, that I added a external Java extension in my plugin.xml which had no Java class in it. That caused the error of the missing content assist contents. When I removed that extension entry, the content assist worked fine again besides the effect you described.

Quote:
An additional idea, your service does not require it yet, but you could add the dependancy between your odesign plugin and the plugin declaring the metamodel

I already did that.

Now it works... Thx!

Any idea on that?
Quote:
In general: Would it principally be possible to get some questions answered outside of this forum by Obeo Sirius Pros? - I already contacted Obeo, but received no reaction... :/


Thank you and regards
Alex


Re: Calling Java Service [message #1744222 is a reply to message #1744091] Fri, 23 September 2016 12:52 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Alex,

Which OS do you use ? I am currently on macOS and I get the completion issue I mentioned yesterday but my co-worker which works with Windows do not reproduce it.

Regards

Maxime
Re: Calling Java Service [message #1744262 is a reply to message #1744091] Fri, 23 September 2016 16:23 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 701
Registered: July 2009
Senior Member
Quote:

In general: Would it principally be possible to get some questions answered outside of this forum by Obeo Sirius Pros? - I already contacted Obeo, but received no reaction... :/


Sorry about that; it seems we dropped the ball on this one. I've seen with our commercial team, and someone should have contacted you in private.


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Calling Java Service [message #1744517 is a reply to message #1744222] Tue, 27 September 2016 16:01 Go to previous messageGo to next message
Alex B. is currently offline Alex B.Friend
Messages: 20
Registered: June 2016
Junior Member
Maxime Porhel wrote on Fri, 23 September 2016 12:52

Which OS do you use ? I am currently on macOS and I get the completion issue I mentioned yesterday but my co-worker which works with Windows do not reproduce it.


Dear Maxime,

I am using Windows 7 x64.

Best
Alex
Re: Calling Java Service [message #1803305 is a reply to message #1744517] Tue, 26 February 2019 15:10 Go to previous message
Dat Nguyen is currently offline Dat NguyenFriend
Messages: 34
Registered: July 2014
Member
Im have same problem. I already added the dependancy between odesign plugin and the plugin declaring the metamodel. But it does not work.
Thanks for any idea...
Previous Topic:Selection Wizard Semnatic Candidate: All of one type
Next Topic:Creating dynamic representation for a container
Goto Forum:
  


Current Time: Fri Mar 29 15:54:02 GMT 2024

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

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

Back to the top