Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » programmatically working out cost of path
programmatically working out cost of path [message #1413359] Thu, 28 August 2014 10:57 Go to next message
Terence Ung is currently offline Terence UngFriend
Messages: 1
Registered: August 2014
Junior Member
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.

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.

Case 2: external java action to do such as right click on the first object and add up the cost.

I tried to find and example of using external java action. Unfortunately, the example link is down.

Could anyone give me an example with code
Many thanks.
Terence
Re: programmatically working out cost of path [message #1413850 is a reply to message #1413359] Fri, 29 August 2014 15:16 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
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
Previous Topic:Custom XML model editor
Next Topic:How can Sirius interact with other systems
Goto Forum:
  


Current Time: Fri Apr 26 05:33:02 GMT 2024

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

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

Back to the top