Diagram styler not working

Dear community,

I try to use Diagram styler in Capella 5.1 to improve my PAB diagrams.
basically I want to change the background color of Physical Components depending on:

  • They are Node or Behaviour
  • Their Nature (Software Deployment Unit, Software Execution Unit, …)

I followed a video on Youtube (Easily enrich Capella models with your domain extensions (by Thales) | Webinar Capella - YouTube) and everything went fine:

On a simple first example (same color for all Physical Components):

  • Model created with Scope=[ALL], Eclass Rule=PhysicalComponent, identification of the style to be used.
  • In the PAB diagram, I select Diagram Styler in the top menu
  • I drag and drop the icon Diagram Styler / Choose properties and selected the one property that was defined

But nothing happens :frowning:
I tried to refresh, close then open the diagram again: no color update.
I check the Diagram styler viewpoint on the .aird: it is selected.

So ? Any idea please ?

Well, as I got no feedback, I tried to understand the behaviour of this diagram styler add-on, which is poorly document.

Here is the PV configuration:
PV configuration

Opening the diagram, I have:
PAB diagram

Nothing is colored according to my configuration though PC1 is “Node Physical Component” and PC2 is “Behavior Physical Component”.

But then I discover that if I click on a Component, I have a window from which I can select the style …

… and then I can select the style I want, and it “works”:
It works

But … I don’t understand as the default value was “Behavior style”.

So I would need to select each and every component to set the style, while the main interest was really to set the style automatically according to criteria (Nature = Node, Natue = Behavior) ?

Thanks for you feedback.

What PVMT enables you to do is to add Property Values to elements. When you have defined a PV, you can enter the value on the element you defined it. But it does not add default values to all the elements. There was an option to create the values on all components automatically, but I think this option has been removed. You may ask the Thales team that manages this add-on. Or maybe there is an option somewhere, I am not sure.
Stephane

Thanks Stéphane for your feedback.
There is however something I don’t fully understand: in the context where I defined a general rule based on class scope (here eClass = PhysicalComponent) and attribute class criteria (here Nature = BEHAVIOUR) why should each element be explicitely impacted ? I would understand that each element, being instance of PhysicalComponent should be associated to the values defined at this class scope.
I understand that in my case, all instances would contain the same PV, which makes it redundant and burdens the model.
Analogy with C++: it is a bit the same as if static class members on class X would be instantiated in each X instance.

Indeed: the property-value concept in Arcadia/Capella (and UML/SysML) means that each instance (object element) can have its own “value” attached to a property.
Example: you define a property “Voltage” on Physical Components of type “Nodes”, and you assign different voltage values to your properties on each PC you want.

Going back to your initial message on this thread: I don’t think Diagram Styler can be used to change the background of a component based on existing properties. It works only on extended property-values. That’s what you did when you defined “behaviour style” in your PVMT configuration example: you are creating a new PV for each PC.

So going back to your need: " I want to change the background color of Physical Components depending on:

    • They are Node or Behaviour*
    • Their Nature (Software Deployment Unit, Software Execution Unit, …)*"
      I am not sure there is a way to do this easily in Capella as is. I would probably write a Python4Capella script that changes the background color of physical components based on your rule. Unfortunately, the Python4Capella API for changing the background color is not there yet. Meaning that there is a way to do it, but it is not going that easy to find the right API - you can have a look at this thread and ask more questions if you go down that path:
      Editing Requirements format with P4C

All the best,
Stephane

Thanks Stéphane for your feedback.
I understand I would have two possibilities:

  • Use extended value properties that I manually set, and benefit from diagram styler features
  • Use P4C to set background color according to my criteria

But the second one does not work yet in P4C… So basically I have only the first possibility !
Third possibility manipulate the model through Java API ? I did this a long time ago.

To clarify: I am not saying the second possibility will not work; I meant that: as there is no Python API for it, you will have to use Java via Python for the specific calls related to changing the color, but that will work.
Stephane

OK, thanks Stéphane.