|
|
|
Re: How to call own Java Method in Sirius [message #1847804 is a reply to message #1847609] |
Mon, 08 November 2021 23:20   |
|
Hello,
Indeed, you should use a double click tool in the end, but before that fix the problem with your java services. You don't have to use java services, but it quickly become an easy solution with more complex tools. When you created your Viewpoint Specification Project (project with the .odesign), it should have created a class with the name of your viewpoint and ending by services (if you called your odesign project "AwesomeProject" the java service class will be named "AwesomeProjectServices"). Each public java method you add to this class is accessible from your odesign, in the "interpreted expression" fields like "semantic candidate expression" (all the text fileds with a yellow background). If you have a java service named "myJavaService", in the odesign you can call it with the expression aql:self.myJavaService. Remember that the class of the first parameter of the java service should match the class of the context where the expression will be executed. For instance, if you make a double click tool for a node mapping with the domain class "MyClass", then the java service should have as first argument a "MyClass" element. You can have your service with a first element as an EObject as a first test, but you will probably want to switch it to a proper type later in order to only have the service for the good context when you are working in your odesign.
Best regards,
Steve
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Re: How to call own Java Method in Sirius [message #1848011 is a reply to message #1847804] |
Wed, 17 November 2021 12:07  |
Hakan Yüksek Messages: 22 Registered: October 2021 |
Junior Member |
|
|
Steve Monnier wrote on Mon, 08 November 2021 23:20Hello,
Indeed, you should use a double click tool in the end, but before that fix the problem with your java services. You don't have to use java services, but it quickly become an easy solution with more complex tools. When you created your Viewpoint Specification Project (project with the .odesign), it should have created a class with the name of your viewpoint and ending by services (if you called your odesign project "AwesomeProject" the java service class will be named "AwesomeProjectServices"). Each public java method you add to this class is accessible from your odesign, in the "interpreted expression" fields like "semantic candidate expression" (all the text fileds with a yellow background). If you have a java service named "myJavaService", in the odesign you can call it with the expression aql:self.myJavaService. Remember that the class of the first parameter of the java service should match the class of the context where the expression will be executed. For instance, if you make a double click tool for a node mapping with the domain class "MyClass", then the java service should have as first argument a "MyClass" element. You can have your service with a first element as an EObject as a first test, but you will probably want to switch it to a proper type later in order to only have the service for the good context when you are working in your odesign.
Best regards,
Steve
Thank you
|
|
|
Powered by
FUDForum. Page generated in 0.01680 seconds