Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Java Service
Java Service [message #1860882] Thu, 07 September 2023 07:03 Go to next message
Frédéric Cadier is currently offline Frédéric CadierFriend
Messages: 6
Registered: September 2023
Junior Member
Hi community !

I'm trying, with no success so far, to get a functional Java Service in my odesign project.

I'm pretty sure that my service is correctly registered, because the autocompletion works and propose the methods that I've written. Also, if I suppress the Java extension declaration, the validation tells me that the services can't be found.

But.

But nothing happens then. For example, I have a simple Task concept with an attribute 'name' and the service below returns nothing:

public String getTaskName(Task task) {
    	return task.getName();
    }


or when I try to calculate a collection, it seems to return nothing:
    public List<Task> getAllTargets(Task task) {
      List<Task> targets = new ArrayList<>();
      targets.add(task);
      return targets;
    }


Have anyone have a clue about what I've missed ?

Thx
Re: Java Service [message #1860884 is a reply to message #1860882] Thu, 07 September 2023 08:21 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 705
Registered: July 2009
Senior Member
Hi,

The code for the service methods seem fine, so the problem is probably elsewhere.

How do you invoke these in your odesign?


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Java Service [message #1860887 is a reply to message #1860884] Thu, 07 September 2023 08:43 Go to previous messageGo to next message
Frédéric Cadier is currently offline Frédéric CadierFriend
Messages: 6
Registered: September 2023
Junior Member
Hi Pierre-Charles,

for example, on a Relation Based Edge whose Source and Target mappings are 'Task node', I'm trying to use the getAllTargets() service in the 'TargetFinder Expression' with
aql:self.getAllTargets()


or in a Label Expression, under the 'Task node', I'm using
aql:self.getTaskName()

[Updated on: Thu, 07 September 2023 08:45]

Report message to a moderator

Re: Java Service [message #1861111 is a reply to message #1860887] Thu, 21 September 2023 09:50 Go to previous message
Frédéric Cadier is currently offline Frédéric CadierFriend
Messages: 6
Registered: September 2023
Junior Member
Hi,

at last, it works... but I had to delete my Eclipse workspace and re-import my projects.

So, I don't know where the problem was.
Previous Topic:Sirius at EclipseCon 2023
Next Topic:Creating multiple views for an element
Goto Forum:
  


Current Time: Sat Dec 21 15:58:15 GMT 2024

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

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

Back to the top