Book a Demo

Author Topic: get element from scenario  (Read 3182 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
get element from scenario
« on: April 06, 2012, 09:44:27 pm »
For some reason they "forgot" to add the elementID to the scenario class in the API.
So I had to make a workaround to get the actual element.
For anyone else trying to figure this out:
Code: [Select]
       public UMLUsecase useCase
        {
            get
            {
                string sqlQuery = @"select o.ea_guid as CLASSGUID, o.Object_Type as CLASSTYPE,o.Name from (t_object o
inner join t_objectscenarios os on os.Object_ID = o.Object_ID)
where os.ea_guid = '<Search Term>'";
                List<object> results = this.model.SearchSQL(sqlQuery,this.wrappedScenario.ScenarioGUID);
                if (results.Count > 0)
                {
                    return results[0] as UMLUsecase;
                }
                else
                {
                    return null;
                }

            }

        }

Geert