Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Cant add custom class to Services method
Cant add custom class to Services method [message #1835273] Sun, 29 November 2020 12:12 Go to next message
Håvard Farestveit is currently offline Håvard FarestveitFriend
Messages: 2
Registered: November 2020
Junior Member
Hi!
I'm having a problem calling java services from diagrams.

I have this test method:

 public String sampleService (EObject obj) {
       return "Foo";
 }


And when I call it from the diagram from a label of my node of domain class "City", it works no problem!

(FYI: when i sysout(obj.eClass() i get CityImpl)

But if change the code to:
 public String sampleService (City obj) {
       return "Foo";
 }

Eclipse can't find sampleService.
Does anyone know what happens and how to fix this?





Re: Cant add custom class to Services method [message #1835294 is a reply to message #1835273] Mon, 30 November 2020 11:54 Go to previous message
Håvard Farestveit is currently offline Håvard FarestveitFriend
Messages: 2
Registered: November 2020
Junior Member
Update: I've now tried the same with the sample project from Sirius and i still have the same problem.

I created two methods in the org.eclipse.sirius.sample.basicfamily.advanced.design.Services

public String testServiceObject(EObject object) {
		return "Foo";
	}
	
	public String testServicePerson(Person person) {
		return "Bar";
	}


And added them to the label cols in the person table.
Father label expressions: service:testServiceObject
Mother label expressions: service:getCousinsNumber
Children label expressions: aql:self.testServicePerson()
Cousin label expressions: service:getCousinsNumber()

(service:getCousinsNumber is the same as in the solution)

But it is only testServiceObject that returns anything.

https://i.gyazo.com/d46cdbcbf8c20bf25e06f0d3be5a4823.png

https://i.gyazo.com/6b6cd2453d81115974203c91392a5e16.png

Previous Topic:Fail to see the diagrams in a different machine
Next Topic:How to disable the auto triggered arrange action after a new semantic is added to the model?
Goto Forum:
  


Current Time: Thu Apr 25 22:33:23 GMT 2024

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

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

Back to the top