Understanding the code behind viewpoint creation

Hi,

I followed the tutorials about VP (Viewpoint) creation and I think I understand the different steps.

Links :
Viewpoint Creation for Capella with Capella Studio : https://www.youtube.com/watch?v=NWCyKsPfc2Y&t=187s
Creation of VP with Capella Studio 1.1 : https://www.youtube.com/watch?v=zvIzyDxAj1c

If I understood correctly, you can deconstruct the process in different steps:
-write the metamodel description in the .data with the classes, the attributes, the associations, etc.
-write the ui implementation in the .ui with the containers, the fields, etc.
-write the diagram description in the .diagram with the containers, the nodes, the edges, etc.
-write in the .services, .activityexplorer and .build but I consider it optional given what I want to do
-generate and package everything
-put the generated VP in Capella files
-activate the VP in a Capella project
-use the VP

However, I can’t manage to write a functional VP that does what I want because I can’t quite grasp which code is necessary to make it work.
Just for learning purposes, I’d like to create a VP able to:
-create an object (let’s call it “A”) and place it in the Logical Architecture Blank at the same level as the Logical System / Logical Actors (directly on the white background). I want to represent “A” as a rectangle with its attribute “name” in it.
-create and place “B”, the same object as “A”.
-create and visualize a link between “A” and “B”. A -> B or B -> A, it doesn’t matter because it’s just to learn.
-create and visualize a link between “A” (or “B”) and a Logical Function (but it could be any already existing Capella element).

If my description is not clear, I’d like to mimic the following image :

It’s from the VP Requirement but I don’t want to go that far, meaning and complexity will come later. I just want to put two rectangles, a link between them and a link with an already existing Capella element.

I tried to create a VP doing the first step of what I said, without success (cf dataFile and diagramFile) :

When using it in a project, I see the tool to create my element. I see I can put it on the white background and not inside a logical component but it doesn’t appear after I click.

Can someone tell me what’s wrong ?
What should I write to make it work ?
Is there a place that better explains the code behind VPs ?
What should I write to implement the other features I mentioned ?

I know my VP would be useless but for me, the few basic VPs are not enough to fully understand the code behind so I need to go through the basics.

dataFile.PNG
diagramFile.PNG

Hi,

I stepped onto your question (a bit late probably). From what I see on your code, your new Data “A” should extend “LogicalComponent”. SO instead of adding “superClass external emde.Element” you should have extends la.LogicalComponent and so your “A” elements will be put in the “ownedExtensions” collection of LogicalComponent elements.

Then in order to link to “LogicalFunction” element you should add an Association linking to the correct type. You should take a look at the BasicVP (https://wiki.eclipse.org/Capella/Viewpoints/Practice) which explains this.

Regards,
Arnaud

Copyright © Eclipse Capella, the Eclipse Capella logo, Eclipse and the Eclipse logo are Trademarks of The Eclipse Foundation.