|
Re: programmatically working out cost of path [message #1413850 is a reply to message #1413359] |
Fri, 29 August 2014 15:16 |
|
Hi,
Le 28/08/2014 14:18, Terence Ung a écrit :
> I have a object with an attribute "next" pointing to another object.
> Each object has a cost. These objects are inherited from the same
> superclass in the ecore model. I have successfully create a diagram
> representation of the model using sirius.
>
> However, there is not much resource about the sirius api and external
> java action. I think there are two ways of working out the cost. Please
> correct me if I am thinking in the wrong direction.
You could also call a Java service from a Change Context model operation
defined in a tool to compute and set the costs.
>
> Case 1: using sirius api to open the representation.aird and read the
> object and find the next object until the next attribute is null/empty
> and add up all the cost.
Here, I understand you would like to modify your domain model out of a
Sirius editor. In this case I think you should directly load you domain
model and modify it without loading the Sirius model (an action on your
file ?, you could even check if the file is loaded in a Sirius session
and directly your loaded elements or load the file, modify and save it.
>
> Case 2: external java action to do such as right click on the first
> object and add up the cost.
You could try to do it in several ways: External java action or
operation action to add an action/menu in the contextual menu or a
generic tool displayed in the palette.
>
> I tried to find and example of using external java action.
> Unfortunately, the example link is down.
Could you precise which link is broken ?
>
> Could anyone give me an example with code
> Many thanks.
> Terence
Regards,
--
Maxime - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.03012 seconds