Calling Java Service [message #1744043] |
Wed, 21 September 2016 16:35 |
Alex B. 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 |
|
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 #1744089 is a reply to message #1744082] |
Thu, 22 September 2016 09:49 |
|
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 |
Alex B. 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 |
|
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 |
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03220 seconds