Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Usage of java services defined inside a different viewpoint - is that possible?
Usage of java services defined inside a different viewpoint - is that possible? [message #1853861] Wed, 20 July 2022 09:55 Go to next message
Namea lasta is currently offline Namea lastaFriend
Messages: 50
Registered: March 2022
Member
Hello,
In this example of sirius specifier, we got a number of services that are defined under the viewpoint (Operational Analysis) (See attached picture).
Question: Can you call upon the functions /services of this viewpoint from a different viewpoint? How does that work?
Thank you.
Re: Usage of java services defined inside a different viewpoint - is that possible? [message #1853868 is a reply to message #1853861] Wed, 20 July 2022 12:47 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 300
Registered: July 2009
Senior Member
Hello,
The services are not really defined under the viewpoint. They are register in it. So you can reuse it , by registering it in another viewpoint, by adding a Java extension. For more detail, you can read this documentation: https://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html#service_methods

Regards,
Laurent


Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Usage of java services defined inside a different viewpoint - is that possible? [message #1853870 is a reply to message #1853868] Wed, 20 July 2022 13:13 Go to previous messageGo to next message
Namea lasta is currently offline Namea lastaFriend
Messages: 50
Registered: March 2022
Member
That's awesome. Thank you.
It seems the option to 'add a Java extension" is not available at all for "Property View Description" Am I wrong? (Without even talking about registering external services, just making my own java extension here, it does not seem to be possible for a property view description?)

Thanks
Regards

[Updated on: Wed, 20 July 2022 13:26]

Report message to a moderator

Re: Usage of java services defined inside a different viewpoint - is that possible? [message #1853897 is a reply to message #1853870] Thu, 21 July 2022 15:07 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 300
Registered: July 2009
Senior Member
You're right. The "Property View Descriptions" reuse the java extensions defined in viewpoint.

Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Usage of java services defined inside a different viewpoint - is that possible? [message #1854087 is a reply to message #1853897] Mon, 01 August 2022 07:41 Go to previous messageGo to next message
Namea lasta is currently offline Namea lastaFriend
Messages: 50
Registered: March 2022
Member
Hello Laurent,
But it does not seem to be working right, look at this image (attached).
I made the function NEW4(), and tried to assign the value returned ( string) to a variable that hold a string (context was changed correctly). yet nothing happens.

What is more alarming is that the function DOES NOT APPEAR when you do a CTRL+SPACE. That's kind of a ring flag, it indicates that it is not working as intended, Am I wrong?

Please verify this. I made this whole topic just because I felt the Property value description did not take the service the viewpoint in the end. Something is off. Could you investigate please?

Thanks
best regards
Re: Usage of java services defined inside a different viewpoint - is that possible? [message #1854369 is a reply to message #1854087] Tue, 16 August 2022 11:58 Go to previous messageGo to next message
Namea lasta is currently offline Namea lastaFriend
Messages: 50
Registered: March 2022
Member
Up!
Still not working
Re: Usage of java services defined inside a different viewpoint - is that possible? [message #1854420 is a reply to message #1854369] Thu, 18 August 2022 07:10 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 704
Registered: July 2009
Senior Member
Your NEW4 Java service method is not valid. It does not follow the rules mentioned in the documentation, and in particular:
Quote:

A service method must take at least one parameter, which should be an EMF type (i.e. EObject or a sub-type of EObject).


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Usage of java services defined inside a different viewpoint - is that possible? [message #1854462 is a reply to message #1854420] Fri, 19 August 2022 15:42 Go to previous message
Namea lasta is currently offline Namea lastaFriend
Messages: 50
Registered: March 2022
Member
Hello Pierre-Charles
Thank you so much!
This reminds me a bit of tables in the Sirius Specifier, you have to give it a Attribute that exists THEN you can change the context to anything you want. BUT You need to put an existing Attribute even if you don't want to use it.
In my java service, I had to add an Eobject as parameter as you suggested, then I CAN IGNORE that parameter and return whatever I want.
It's quite curious but it works somehow.
Thanks again

[Updated on: Fri, 19 August 2022 15:59]

Report message to a moderator

Previous Topic:Labeling Relation Edges
Next Topic:Adding a "Load Resources" tool to Sirius diagram viewpoint, unsure how to do so.
Goto Forum:
  


Current Time: Wed Jun 19 07:40:09 GMT 2024

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

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

Back to the top