Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Problem : Create VSM programatically during execution
Problem : Create VSM programatically during execution [message #1794369] Wed, 29 August 2018 15:59 Go to next message
Alejandro Rodriguez is currently offline Alejandro RodriguezFriend
Messages: 1
Registered: August 2018
Junior Member

I have been these days trying to create a "virtual" VSM in runtime. What I try to do is, given a project with an "model.ecore" model, and by pressing a button, to create a VSM (originally just with group > viewpoint > diagram description) and the "model.aird" of this model get the option to use the new VSM right after created.

The way I am trying to do is:


Create the elements that the VSM will contain:

Group group = DESCRIPTION_FACTORY.createGroup();

Viewpoint viewpoint = DESCRIPTION_FACTORY.createViewpoint();


DiagramDescription dd = DESCRIPTION_FACTORY_DIAGRAM.createDiagramDescription();



Register the viewpoint in the ViewpointRegistry (with the registerFromWorkspace method, since the plugins have been already loaded).

Set<Viewpoint> vps = new HashSet<Viewpoint>();


Get the session from the "model.aird" and create the representation with the DialectManager:

DialectManager.INSTANCE.createRepresentation("virtualCPN", semanticRoot, dd, session, new NullProgressMonitor());
Command createViewCommand = new CreateRepresentationCommand(createdSession, dd, rootObject," virtualCPN" , monitor);
SessionManager.INSTANCE.notifyRepresentationCreated(session); NullProgressMonitor());

I am doing something feasible? I am not sure if I am far away from a solution or it's just some adjusts to be done.

This is the further I have got, in spite of I get recognised the entry when I right click in the model.aird and go to Viewpoints selection, I get a "Not found" in the representations view of the model.aird (see image below).

Edit: updated

[Updated on: Fri, 31 August 2018 06:58]

Report message to a moderator

Re: Problem : Create VSM programatically during execution [message #1794653 is a reply to message #1794369] Tue, 04 September 2018 13:55 Go to previous message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
It seems to be a bug in the aird editor. Can you activate your viewpoint from aird editor even with the not found label? And from viewpoint selection wizard?


Pierre Guilet - Obeo
Need training or professional services for Sirius?
Previous Topic:Multiline Label
Next Topic:Model Operations Open Wizard: specify Title/Description/IsPageComplete at page level
Goto Forum:

Current Time: Thu Jan 21 12:47:01 GMT 2021

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

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

Back to the top