Book a Demo

Author Topic: get classifierGUID of swimlane.  (Read 4686 times)

pgoes

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
get classifierGUID of swimlane.
« on: October 24, 2016, 07:41:41 pm »
Hi all,

i'm try-ing to get the classifierGUID of an element related to a swimlane, but the API always returns 'Undifined' Can one of you tell me what goes wrong or is this a bug in EA.

Script:

   var currentDiagram as EA.Diagram;
   currentDiagram = Repository.GetCurrentDiagram();

   if ( currentDiagram != null )
   {
      //##################### do diagram things

         if (currentDiagram.SwimlaneDef != null)
         {
            Session.Output("Simlane def is not null");

         }
         
         Session.Output("Number of swimlanes = " +  currentDiagram.SwimlaneDef.Swimlanes.count);
         for (i = 0; i < currentDiagram.SwimlaneDef.Swimlanes.count; i++)
         {
            CurrentSwimelane = currentDiagram.SwimlaneDef.Swimlanes.Items(i);
            Session.Output("Properties Swimlane " + i);
            Session.Output("--------------------------");
            Session.Output("Name : " + CurrentSwimelane.Title);
            Session.Output("Classified GUID : " + CurrentSwimelane.ClassifiedGUID); // this returns always Undefined.
            ClassifierObject = Repository.GetElementByGuid(CurrentSwimelane.ClassifiedGUID);
            if (ClassifierObject != null)
            {
               Session.Output( "Name of Classifier :" + ClassifierObject.Name);
            }
            else
            {
               Session.Output( "classifier object not defined. :");               
            }
            Session.Output("Width : " + CurrentSwimelane.Width);
            Session.Output("" );
            
         }
      }
   }

Thanks in advance,

peter.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: get classifierGUID of swimlane.
« Reply #1 on: October 24, 2016, 08:45:55 pm »
ClassifiedGUID seems like a typo to me in the help file.
When trying in C# the intellisense indicates the name is ClassifierGUID.

Geert

pgoes

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: get classifierGUID of swimlane.
« Reply #2 on: October 25, 2016, 12:07:19 am »
Thanks Geert,

in scripting inside EA there is no intellicense available and the documentation on the site of EA contains an mentions clasifiedGUID.

http://www.sparxsystems.com/enterprise_architect_user_guide/10/automation_and_scripting/swimlane.html

now it works correct.

peter.


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: get classifierGUID of swimlane.
« Reply #3 on: October 25, 2016, 12:14:42 am »
in scripting inside EA there is no intellicense available
There is some kind of intellisense, but then you have to declare your variable as a certain type
Similar to
Code: [Select]
var currentDiagram as EA.Diagram;you have to define the variable CurrentSwimelane
Code: [Select]
var CurrentSwimelane as EA.SwimLane;Only then the code editor knows what type of variable you are using and it will show the appropriate features.

Geert