Book a Demo

Author Topic: MDG Techno: Add Custom Compartments to Element - BUG?!  (Read 2981 times)

Mesple

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
MDG Techno: Add Custom Compartments to Element - BUG?!
« on: January 16, 2019, 04:13:09 am »
Hi all,

I tried to write a shape script containing a "custom compartment" named "Toto" to display the name of child elements.

"
shape ChildElement
{
   SetCompartmentName("Toto");
   AppendCompartmentText("#NAME#");
}
"
is-it right?

and then, as mentioned in the help (https://sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/add_custom_compartments_to_ele.html), I've attached a linked Note to manage the compartment visibility (Method 2) but my compartment named "Toto" doesn't appear in the "Feature type" list?  :-[
Why? Any idea?

Thanks a lot
Olivier

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8090
  • Karma: +118/-20
    • View Profile
Re: MDG Techno: Add Custom Compartments to Element - BUG?!
« Reply #1 on: January 16, 2019, 09:38:10 am »
Just gave it a try. It does show up for me. The only thing I can think of is that you need to have the compartment show up before it will be available as a feature type. That means you have to have at least one child that isn't on the diagram.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8617
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: MDG Techno: Add Custom Compartments to Element - BUG?!
« Reply #2 on: January 16, 2019, 05:32:25 pm »
Just gave it a try. It does show up for me. The only thing I can think of is that you need to have the compartment show up before it will be available as a feature type. That means you have to have at least one child that isn't on the diagram.
This is definitely a requirement (IIRC).

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Mesple

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: MDG Techno: Add Custom Compartments to Element - BUG?!
« Reply #3 on: January 16, 2019, 06:29:08 pm »
Thanks a lot! It works  :) Great

"
decoration Classe
{
 orientation="NE";
 image("Classe.png",0,0,100,100);
}

//Shape ChildElement adds Child Compartments to the parent.

shape ChildElement
{
   if(HasProperty("stereotype", "Besoin"))
   {
      SetCompartmentName("Besoins");
      AppendCompartmentText("#NAME#");
   }
}
"
Olivier