Author Topic: User Defined Compartments not visible  (Read 3154 times)

Michael Proske

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
User Defined Compartments not visible
« on: February 07, 2012, 01:29:44 am »
Hello

I try to add user defined compartments to my class. This is my code

        public String EA_QueryAvailableCompartments(EA.Repository Repository)
        {
            String sReturn;
            sReturn = "first";
            return sReturn;
        }

        public String EA_GetCompartmentData(EA.Repository Repository, String sCompartment, String sGUID, EA.ObjectType oType)
        {

            String sCompartmentData = "";
            String sData = "";
            EA.Element elem = Repository.GetElementByGuid(sGUID);

            sCompartmentData = sCompartmentData + "Name=" + sCompartment + ";";
            sCompartmentData = sCompartmentData + "OwnerGUID=" + sGUID + ";";
            sCompartmentData = sCompartmentData + "Options=SkipIfOnDiagram&_eq_^1&_sc_^";

            return sCompartmentData;
        }

It should do nothing except adding a new compartment to my class. I know how to add data but that is not the problem. When i debug my application it goes through the code for the object on my diagram. However the compartment is not visible. Is there any option i have to enable ?
Regards Michael

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: User Defined Compartments not visible
« Reply #1 on: February 07, 2012, 12:08:28 pm »
Your "sCompartmentData" variable does not seem to contain any actual data to be written in the compartment.  After Name, OwnerGUID and Options, there should be CompartmentData.  Pretty sure it's required in order to display the compartment.

For a working example, please see the C# code attached to the following example on the EA Community site:
http://community.sparxsystems.com/resources/scripts/showing-classifier-notes-custom-compartment

Michael Proske

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Re: User Defined Compartments not visible
« Reply #2 on: February 13, 2012, 06:41:49 pm »
Thank you. I manged to see something.