Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Integrating sirius into xtext(Issues regarding creating a graphical view/diagram (using Sirius) for my xtext DSL.)
Integrating sirius into xtext [message #1804324] Fri, 22 March 2019 12:33 Go to next message
Emir Sircic is currently offline Emir SircicFriend
Messages: 1
Registered: March 2019
Junior Member
Hello Eclipse Community,

I'm currently working on my Graduate thesis regarding extending a DSL written in xtext with a graphical representation (and if possible a graphical editor as well) and have been trying to integrate Sirius for this purpose.

So far I've had some success such as having Sirius draw basic Nodes and relations (see index.php/fa/35113/0/) but I'm quite unsure if my integration is done correctly at all.

Whenever I use the "Validate Model" on my .odesign I get the following errors (see index.php/fa/35114/0/):

The Class badGraph::AttackNode does not exist
The Class badGraph::DefenseNode does not exist
The Class badGraph::CountermeasureNode does not exist
The Class badGraph::ORRelation does not exist

Despite getting these errors on validation Sirius is still able to recognize some parts of my DSL/AST and draw them. I've tried having a look at other example projects regarding this integration and validation gives the same errors as here but for those projects every part of the DSL is stil drawn. I've also noticed other projects use the "dot-notation" when referencing a Domain Class for an element in the .odesign but this gives the same error. (see index.php/fa/35115/0/)

As I have understood Sirius uses the .ecore model generated by xtext for my DSL and I have loaded it as a resource/metamodel for my diagram representation in the .odesign file.

I guess my first question is: have I loaded the .ecore file/AST generated by xtext into Sirius correctly? I haven't been able to find an answer on forums for this as of yet.

My second question will be how to access fields from my DSL in the .odesign properly?

To elaborate a bit more on my second question, I have tried to create an Element Based Edge for an edge in my DSL called ORRelation, and here is a snippet of my .xtext regarding this:

Edges: {Edges}
	'begin' 'attack' 'diagram'
	(edges += EdgeType)*
	'end' 'attack' 'diagram'


	parent = [Node] (('-' 'OR' '->') | ('->')) childrenSet=SetOfChildren

	'{' children+=[Node] (',' children+=[Node])* '}'

In my .odesign I've created an Element Based Edge and filled the fields as can be seen in index.php/fa/35116/0/

For some reason Sirius will not draw these ORRelations and I have not been able to figure out why. So how would I properly fill out the "Target Find Expression" for my ORRelation and tell it to look at the "childrenSet" field in an ORRelation?

I'm currently running Eclipse SDK Oxygen.3a (4.7.3a), Xtext version 2.17.0 and Sirius version 6.0.2
My OS is Debian Stretch 9.6.0.

I hope my questions are somewhat clear and feel free to comment if I need to elaborate further on some things in my setup or if I have left out some vital information.
Re: Integrating sirius into xtext [message #1804388 is a reply to message #1804324] Mon, 25 March 2019 09:49 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 507
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Emir,

For the validation error:
- Did you add the plugins which define your meta-model or Xtext syntax to the dependencies of your modeler's project ? (see
- If you did, you might have to look to your Xtext plugins to check how it declares the Ecore model to the platform.
- Is you DSL deployed when you launch the validation ? This might be required to retrieve the metamodel definition in the EPackage registry. You might also develop and validate your modeler in a runtime, this will simulate the deployment of your DSL.

For you not drawn ORRRelations, it seems that your syntax contains an intermediate concept which is the type of the childrenSet feature. The evaluation of your mapping target finder expression return SetOfChildren elments, and then Sirius cannot match it with the target mappings AttackĀ£Node and DefenseNode.
You have to complete your target finder expression in order to find the nodes from the ORRRelation: something like aql:self.childrenSet.children should work.


Maxime Porhel - Obeo

Need training or professional services for Sirius?
Previous Topic:Diagramm for XText-Model: Load Model too slow
Next Topic:Show only parent nodes.
Goto Forum:

Current Time: Wed Jun 16 03:05:22 GMT 2021

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

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

Back to the top