Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Representations.aird - programmatically add model to Project Dependencies(Representations.aird - programmatically add model to Project Dependencies)
Representations.aird - programmatically add model to Project Dependencies [message #1829618] Tue, 07 July 2020 16:32 Go to next message
Cynthia Diedrich is currently offline Cynthia DiedrichFriend
Messages: 2
Registered: July 2020
Junior Member
Hello :),

I am relatively new to Sirius and I want to programmatically add a model of a different Modeling Project to the Project Dependencies of another projects representations.aird file.

Manually I am able to do this (see image) but I would like to programmatically set this dependency within an External Java Action.

I would be very grateful for any help!

Kind regards,
Cynthia Diedrich

[Updated on: Tue, 07 July 2020 21:43]

Report message to a moderator

Re: Representations.aird - programmatically add model to Project Dependencies [message #1829678 is a reply to message #1829618] Wed, 08 July 2020 15:07 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 300
Registered: July 2009
Senior Member
Hi Cynthia,

The code of the corresponding action is here: AddModelDependencyAction. This action uses AddSemanticResourceCommand through SemanticResourceAdditionOperation.

A code like below should do the job:
org.eclipse.sirius.business.api.session.Session session = ...;
org.eclipse.emf.common.util.URI semanticResourcesURI = ...;
session.getTransactionalEditingDomain().getCommandStack().execute(new AddSemanticResourceCommand(session, semanticResourcesURI, new NullProgressMonitor()));


Regards,

Laurent


Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Representations.aird - programmatically add model to Project Dependencies [message #1829704 is a reply to message #1829678] Thu, 09 July 2020 08:28 Go to previous message
Cynthia Diedrich is currently offline Cynthia DiedrichFriend
Messages: 2
Registered: July 2020
Junior Member
Hi Laurent,

Thank you for your quick answer, it worked!

Regards
Cynthia
Previous Topic:[SiriusCon 2020] Relive the conference: get access to the slides and videos
Next Topic:Grayed diagram name when reopening aird
Goto Forum:
  


Current Time: Thu Mar 28 08:22:47 GMT 2024

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

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

Back to the top