Book a Demo

Author Topic: Messages between elements that are not on diagram  (Read 5166 times)

satrman

  • EA User
  • **
  • Posts: 50
  • Karma: +2/-0
    • View Profile
Messages between elements that are not on diagram
« on: September 20, 2022, 04:44:07 am »
Hi all, expert opinion needed!
Intro:
- messges on sequence diagram are special types of connectors as they have reference to one particular diagram they should appear on
- if you connect message to operation, you can from operation in Browser via ctrl+U observe all diagrams, where is operation used

Problem:
- due to several EA errors, there are messages (connectors) in our repository belonging to particular diagram (via  t_connector.Diagram_ID) however one or both message ends are not present on the diagram - thus the message is not visible
- doing impact analysis via ctrl+U missleads to those diagrams even though you cannot see the message with operation there

Question:
Is it safe to delete such messages?
I'd say yes, but we have cca 43 000 occurences, so I better question this expert forum first...

Any thoughs would be appretiated.

Thanks in advance

Miloš Lang

wivel

  • EA User
  • **
  • Posts: 243
  • Karma: +12/-1
  • Driven by Models
    • View Profile
Re: Messages between elements that are not on diagram
« Reply #1 on: September 20, 2022, 05:42:17 am »
Hi

Before deleting anything, try an integrity check first. That might do the trick.

Henrik

satrman

  • EA User
  • **
  • Posts: 50
  • Karma: +2/-0
    • View Profile
Re: Messages between elements that are not on diagram
« Reply #2 on: September 20, 2022, 06:20:39 pm »
Thx, that was first thing, I tried. Unfortunatelly, this action is not included yet (EA15.2).
But I am following EA Logic:
- if I delete one (or both) message end from sequence diagram (and save the diagram), message is deleted from t_connector
- so if I later place both ends of former message on that diagram, no messages appear

Therefore (I think) there is no reason for existence of such connector in DB.
BTW here is one way how this happens in our DB (registered bug since EA14): https://sparxsystems.com/forums/smf/index.php/topic,43667.msg258363.html#msg258363

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Messages between elements that are not on diagram
« Reply #3 on: September 20, 2022, 07:20:02 pm »
Without thorough investigation I would not do anything. So either you hire someone to do that or you contact Sparx support to help you with finding the culprit. Obviously something went the wrong way.

q.

satrman

  • EA User
  • **
  • Posts: 50
  • Karma: +2/-0
    • View Profile
Re: Messages between elements that are not on diagram
« Reply #4 on: September 20, 2022, 10:52:59 pm »
Well, technically I am the one who is hired to do so :D
I am about 95 % sure I can delete, and doing further investigation.
I cannot leave it there as it ruins impact analysis (ctrl+U, relationships window, relationship matrix, traceability).
To me, it is good candidate to be included in Integrity check.

BTW I have found out another corresponding issue (by accident, I admit). If you follow test script stated here https://sparxsystems.com/forums/smf/index.php/topic,43667.msg258363.html#msg258363 you are left with messge with incorrect diagram ID thus the message isn´t visible on copied diagram. However if you baseline afterwards and restore from baseline, message appears on diagram. However if you investigate data, EA puts 0 in diagram_id reference - that means, there is no display constraint related to diagram_id and wherever there is a diagram with both ends of such message, the message will appear on it... No big deal, if you use instances on sequentila diagrams, however for those who use links instead it might be a potential problem...

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Messages between elements that are not on diagram
« Reply #5 on: September 21, 2022, 02:37:09 am »
Pretty sure you can just delete them. The messages will then also (double) vanish.  Anyhow, you should make a copy of the repo and run the deletion there. Then find out whether the rest is still fine.

Personally I have not run any test on delting messages (maybe these days).

q.

satrman

  • EA User
  • **
  • Posts: 50
  • Karma: +2/-0
    • View Profile
Re: Messages between elements that are not on diagram
« Reply #6 on: September 21, 2022, 08:31:03 pm »
Thanx for your opinion, helps me to be more confident about this.
Yes, I will definitely give it a try on our test environment first, however I have to somehow choose representative sample out of those 43 K connectors.
Anyway, if you ever want to give it a try, bellow is the SQL Check (MS SQL syntax).
I don't have to explain it to you, as you are expert on data model, but for others - there are columns with information about previous version diagram creted by time aware modeling feature (using xref), as well as there is a info about connected operation (using connectortag).
If you get any results for this query, just search for operation involved and as you select in in Browser use ctrl+U to see how duplicities affect your impact analysis...

SELECT
--top 100
 t_diagram.Name as DiagramName
, ver_diagram.Name as PreviousVersionDiagram
, t_diagramobjects.Diagram_ID as StartOnDiagNull
, t_diagramobjects2.Diagram_ID as EndOnDiagNull
, xref.[Description] as XrefDesc
, CASE
WHEN StartObj.Classifier_guid is not null and StartObj.Name is null THEN ':'+StartClassifier.name
WHEN StartObj.Classifier_guid is not null and StartObj.Name is not null THEN StartObj.name+':'+StartClassifier.name
ELSE StartObj.name
END as StartLifeLineName
,t_connector.Name MessageLabel
,t_operation.Name as OperationName
, CASE
WHEN t_object.Classifier_guid is not null and t_object.Name is null THEN ':'+classifier.name
WHEN t_object.Classifier_guid is not null and t_object.Name is not null THEN t_object.name+':'+classifier.name
ELSE t_object.name
END as EndLifeLineName
, t_connector.Connector_ID
, t_connector.SeqNo
, t_connector.Connector_Type
, t_connector.StyleEx
,t_connector.PDATA1
,t_connector.PDATA2
,t_connector.PDATA3
,t_connector.PDATA4
,t_connector.Start_Object_ID
,t_operation.ea_guid as OperationGuid
,t_connector.End_Object_ID
,t_diagram.Diagram_ID 
,ver_diagram.Diagram_ID as PDiagram_ID
,t_diagram.Author as DiagramAuthor
,ver_diagram.Author as PDiagramAuthor
,t_diagram.Version
,ver_diagram.[Version] as PVersion
,t_diagram.CreatedDate as DiagramCreatedDate
,ver_diagram.CreatedDate as PDiagramCretedDate
,t_diagram.ModifiedDate as DiagramModifiedDate
FROM t_diagram
LEFT JOIN (select * from t_xref where t_xref.[Type]='reference' and t_xref.Name='Version') as xref on xref.Client=t_diagram.ea_guid
LEFT JOIN t_diagram as ver_diagram on ver_diagram.ea_guid=xref.Supplier
inner join t_connector on t_connector.DiagramID=t_diagram.Diagram_ID
INNER JOIN t_object ON t_object.Object_ID = t_connector.End_Object_ID
INNER JOIN t_object as StartObj on StartObj.Object_ID = t_connector.Start_Object_ID
LEFT JOIN t_object as classifier on t_object.Classifier_guid=classifier.ea_guid
LEFT JOIN t_object as StartClassifier on StartObj.Classifier_guid=StartClassifier.ea_guid
LEFT JOIN t_diagramobjects on t_diagramobjects.Diagram_ID=t_diagram.Diagram_ID and t_diagramobjects.Object_ID=t_connector.Start_Object_ID
LEFT JOIN t_diagramobjects as t_diagramobjects2 on t_diagramobjects2.Diagram_ID=t_diagram.Diagram_ID and t_diagramobjects2.Object_ID=t_connector.End_Object_ID
LEFT JOIN t_connectortag on (t_connector.Connector_ID=t_connectortag.ElementID and t_connectortag.Property='operation_guid')
LEFT JOIN t_operation on t_operation.ea_guid=t_connectortag.value
where 1=1
and t_diagram.diagram_type = 'Sequence'
and (t_diagramobjects.Diagram_ID is null or t_diagramobjects2.Diagram_ID is null)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Messages between elements that are not on diagram
« Reply #7 on: September 22, 2022, 06:38:26 pm »
I have run a few tests. There's one caveat: if you have stereotyped operations they will lead to entries in t_connectortag as well.

q.

satrman

  • EA User
  • **
  • Posts: 50
  • Karma: +2/-0
    • View Profile
Re: Messages between elements that are not on diagram
« Reply #8 on: September 22, 2022, 09:30:48 pm »
Yep, you are right - there are references in several tables and t_connectortag is the most significant (mainly because of ea_guid tag for connecting operation). I'd say stereotype assignment would affect t_xref as well.
However all those cases should not affect anything on gui as well as all should be fixed by integrity check (as I am writing this, I am just trying integrity check on the background, will let this forum know;-).
Thanx for your support (still a bit nervous about it)