Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: jdavid on March 20, 2013, 05:05:52 am

Title: Instance Count
Post by: jdavid on March 20, 2013, 05:05:52 am
When you drop an object on a diagram and create an instance of that object is there any way that you can get a count of the number of instances.

Example: I have an component: MicroSoft Server 2012 R2, that I can create multiple instances of on my deployment diagrams. Can I get a count of the number of instances of MicroSoft Server 2012 R2 I have in the project.
Title: Re: Instance Count
Post by: qwerty on March 20, 2013, 07:51:16 am
Select the element and press Ctrl-u. That will show the diagrams in which it is used.

q.
Title: Re: Instance Count
Post by: Geert Bellekens on March 20, 2013, 06:36:47 pm
The easiest is probably with an sql search.
I have an SQL search called "Instances by ClassifierName"
Code: [Select]
select instance.ea_guid as CLASSGUID,instance.Object_Type as CLASSTYPE,instance.name as Name,
classifier.name as ClassifierName ,package.name as PackageName ,package_p1.name as PackageLevel1,
package_p2.name as PackageLevel2,package_p3.name as PackageLevel3
from (((((t_object instance
inner join t_object classifier on instance.classifier = classifier.object_id )
inner join t_package package on instance.package_id = package.package_id)
left join t_package package_p1 on package_p1.package_id = package.parent_id)
left join t_package package_p2 on package_p2.package_id = package_p1.parent_id)
left join t_package package_p3 on package_p3.package_id = package_p2.parent_id)
where classifier.name like '<Search Term>'

Geert
Title: Re: Instance Count
Post by: jdavid on March 21, 2013, 06:09:52 am
Thanks Geert, that was just what I was looking for