Book a Demo

Author Topic: Showing the link between an instance and its classifier  (Read 4135 times)

ducatiross

  • EA User
  • **
  • Posts: 114
  • Karma: +1/-0
    • View Profile
Showing the link between an instance and its classifier
« on: May 17, 2023, 01:06:34 am »
For various reasons, I want to have the multiple 'copies' of a data object on the same BPMN diagram, so that I can show how different activities in the process update the data object (and I don't want relations all over the place). I know I can't do this as an object can only exist once on any given diagram. However, I can create multiple 'instances' of the data object, where the name of the instance will be suffixed with the name of the classifier.

This almost does what I want, but I would have expected things like the Traceability window and the Inspector to show some sort of relationship between the classifier and the instance. It doesn't. The only way you know the two are related is :
- the instance has the ':classifer_name' as the suffix
- if you right-click the instance, you can click 'Features/Find Classifier' and it takes you to the Classifier in the Project Browser
- you can also right-click the Classifier and do 'Advanced/Classifier Properties' which show the properties of the source object

Right-clicking the instance and do 'Advanced/Parent' allows you to select the parent object of which it is an instance, and this then creates a sub-type/super-type relation that can now be seen in the Traceability Window, but shouldn't it have done this automatically when you choose to create an instance of the original object - why should I have to specifically state what object is the parent of the instance, when I used the object to create the instance in the first place  :-\ ?

So, EA is maintaining a link between the two objects, but why can't we see that link as a traceable relation ?

Are there any other ways of knowing and showing which objects are the classifiers of which instances ?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile

BobM

  • EA User
  • **
  • Posts: 144
  • Karma: +9/-0
    • View Profile
Re: Showing the link between an instance and its classifier
« Reply #2 on: May 17, 2023, 04:08:44 pm »
We have a simple base query for it, you might be able to adjust it to display what you would like to see

Code: [Select]
SELECT
CLASSGUID = o.ea_guid
,CLASSTYPE = o.object_type
,[RowNumber] = ROW_NUMBER() OVER (ORDER BY
ISNULL(p9.Name + ' / ', '')
+ ISNULL(p8.Name + ' / ', '')
+ ISNULL(p7.Name + ' / ', '')
+ ISNULL(p6.Name + ' / ', '')
+ ISNULL(p5.Name + ' / ', '')
+ ISNULL(p4.Name + ' / ', '')
+ ISNULL(p3.Name + ' / ', '')
+ ISNULL(p2.Name + ' / ', '')
+ ISNULL(p1.Name, ''))
,[Classifier] = c.Name
,[Classifier Type] = c.Stereotype
,[Classifier In Package] = ISNULL(p1.name, '')
,[Path To classifier] = ISNULL(p9.Name + ' / ', '')
+ ISNULL(p8.Name + ' / ', '')
+ ISNULL(p7.Name + ' / ', '')
+ ISNULL(p6.Name + ' / ', '')
+ ISNULL(p5.Name + ' / ', '')
+ ISNULL(p4.Name + ' / ', '')
+ ISNULL(p3.Name + ' / ', '')
+ ISNULL(p2.Name + ' / ', '')
+ ISNULL(p1.Name + ' / ', '')
+ ISNULL(p0.Name, '')
,[Object_Type] = o.Object_Type
,[Stereotype] = o.stereotype
,[Author] = o.author
,[CreatedDate] = o.createdDate
,[ModifiedDate] = o.modifiedDate
,[Diagram Name] = dia.name
,[Diagram in Package] = ISNULL(p10.name, '')
,[Path To Diagram] = ISNULL(p19.Name + ' / ', '')
+ ISNULL(p18.Name + ' / ', '')
+ ISNULL(p17.Name + ' / ', '')
+ ISNULL(p16.Name + ' / ', '')
+ ISNULL(p15.Name + ' / ', '')
+ ISNULL(p14.Name + ' / ', '')
+ ISNULL(p13.Name + ' / ', '')
+ ISNULL(p12.Name + ' / ', '')
+ ISNULL(p11.Name + ' / ', '')
+ ISNULL(p10.Name, '')
FROM t_Object o
LEFT JOIN t_diagramobjects dobj ON o.Object_ID = dobj.object_ID
LEFT JOIN t_Diagram dia ON dobj.Diagram_ID = dia.Diagram_ID
LEFT JOIN t_object c ON o.Classifier = c.Object_ID
LEFT JOIN t_package p0 ON c.package_ID = p0.Package_ID
    LEFT JOIN t_package p1 ON p0.Parent_ID = p1.Package_ID
    LEFT JOIN t_package p2 ON p1.Parent_ID = p2.Package_ID
    LEFT JOIN t_package p3 ON p2.Parent_ID = p3.Package_ID
    LEFT JOIN t_package p4 ON p3.Parent_ID = p4.Package_ID
    LEFT JOIN t_package p5 ON p4.Parent_ID = p5.Package_ID
    LEFT JOIN t_package p6 ON p5.Parent_ID = p6.Package_ID
    LEFT JOIN t_package p7 ON p6.Parent_ID = p7.Package_ID
    LEFT JOIN t_package p8 ON p7.Parent_ID = p8.Package_ID
    LEFT JOIN t_package p9 ON p8.Parent_ID = p9.Package_ID
LEFT JOIN t_package p10 ON dia.package_ID = p10.Package_ID
    LEFT JOIN t_package p11 ON p10.Parent_ID = p11.Package_ID
    LEFT JOIN t_package p12 ON p11.Parent_ID = p12.Package_ID
    LEFT JOIN t_package p13 ON p12.Parent_ID = p13.Package_ID
    LEFT JOIN t_package p14 ON p13.Parent_ID = p14.Package_ID
    LEFT JOIN t_package p15 ON p14.Parent_ID = p14.Package_ID
    LEFT JOIN t_package p16 ON p15.Parent_ID = p16.Package_ID
    LEFT JOIN t_package p17 ON p16.Parent_ID = p17.Package_ID
    LEFT JOIN t_package p18 ON p17.Parent_ID = p18.Package_ID
    LEFT JOIN t_package p19 ON p18.Parent_ID = p19.Package_ID
WHERE 1=1
AND o.Classifier <> 0

edit: made the code a bit more readable
« Last Edit: May 17, 2023, 06:52:31 pm by BobM »