Author Topic: Trace operations' usage  (Read 1130 times)

Hardy

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Trace operations' usage
« on: February 08, 2013, 07:48:55 am »
I defined a class with operations in it, the operations are further used by many other classes (in sequence diagram).

Is there a way I can find out all the sequence diagrams which use a particular operation?
« Last Edit: February 08, 2013, 07:49:26 am by hardywang »

qwerty

  • EA Guru
  • *****
  • Posts: 9697
  • Karma: +176/-151
  • I'm no guru at all
    • View Profile
Re: Trace operations' usage
« Reply #1 on: February 08, 2013, 09:40:16 am »
Try ctrl-u after selecting the operation.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8484
  • Karma: +207/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Trace operations' usage
« Reply #2 on: February 08, 2013, 06:22:24 pm »
Or use my EA Navigator add-in.

Geert

Hardy

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: Trace operations' usage
« Reply #3 on: February 09, 2013, 12:53:25 am »
Quote
Try ctrl-u after selecting the operation.

q.

In he project explorer, Ctrl-U bring the usage of entire class. If I bring up class's operation window, Ctrl-U does not work.

Hardy

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: Trace operations' usage
« Reply #4 on: February 09, 2013, 12:59:38 am »
Quote
Or use my EA Navigator add-in.

Geert

I am still running 8.3, and wait for my company to upgrade me.

qwerty

  • EA Guru
  • *****
  • Posts: 9697
  • Karma: +176/-151
  • I'm no guru at all
    • View Profile
Re: Trace operations' usage
« Reply #5 on: February 09, 2013, 01:20:00 am »
Quote
Quote
Try ctrl-u after selecting the operation.

q.

In he project explorer, Ctrl-U bring the usage of entire class. If I bring up class's operation window, Ctrl-U does not work.
In that case you're lost. Ctrl-u works from 9.3 (and definitely in 10.0).

Alternatively you can use a SQL search:
Code: [Select]
SELECT
o.ea_guid As CLASSGUID, o.Object_type As CLASSTYPE,
'Behaviour' As Usage, o.name As ElementName,
o.Object_Type As ElementType, o.stereotype As ElementStereotype, '' As Diagram, o.ea_guid
FROM t_operation op, t_object o WHERE
op.EA_GUID = '<Search Term>' AND
#DB=JET# op.Behaviour = o.EA_GUID #DB=JET#
#DB=ORACLE# Cast(op.Behaviour As Varchar2(38)) = o.EA_GUID #DB=ORACLE#
#DB=ORACLE#
/* --- Find State Operation from Class operation (do,entry,exit) --- */ #DB=ORACLE#
UNION
SELECT
op.ea_guid, 'Operation', 'Operation Class<--> State', op.name,
Type, op.stereotype, '', op.ea_guid
FROM t_operation op
WHERE
#DB=JET# op.Behaviour = '<Search Term>' #DB=JET# #DB=ORACLE#
Cast(op.Behaviour As Varchar2(38)) = '<Search Term>' #DB=ORACLE#
#DB=ORACLE#
/* --- Find Class Operation from State operation (do,entry,exit) --- */ #DB=ORACLE#
UNION
SELECT
  op.ea_guid, 'Operation', 'Operation Class<--> State', op.name,
op.Type, op.stereotype,'', op.ea_guid FROM t_operation opState, t_operation op WHERE
opState.ea_guid = '<Search Term>' AND
#DB=JET# opState.Behaviour = op.ea_guid #DB=JET#
#DB=ORACLE# Cast(op.Behaviour As Varchar2(38)) = op.ea_guid #DB=ORACLE#
#DB=SQLSVR#
/* --- Find Call Action -------------------------------------------- */ #DB=SQLSVR#
UNION SELECT
  o.ea_guid, o.Object_Type, 'Call Action', o.name,
o.Object_Type, o.stereotype,'', o.ea_guid FROM t_operation op, t_object o
WHERE
o.Classifier_GUID = '<Search Term>' AND o.Classifier_GUID = op.ea_GUID
#DB=SQLSVR#
/* --- Find return type of method----------------------------------- */ #DB=SQLSVR#
UNION
SELECT
  o.ea_guid, o.Object_Type, 'ReturnType', o.name,
o.Object_Type, o.stereotype,'', o.ea_guid FROM t_operation op, t_object o, t_object o1 WHERE
op.EA_GUID = '<Search Term>' AND
#DB=JET# Format(o.Object_ID) = op.Classifier #DB=JET#
#DB=ORACLE# o.Object_ID = op.Classifier #DB=ORACLE# #DB=SQLSRV# Usage in Sequence Diagram #DB=SQLSRV# AND op.object_id = o1.object_id
UNION SELECT
c.ea_guid, c.connector_type, 'Sequence', c.name, 'Operation',
o.stereotype,d.name, c.ea_guid FROM
t_connector c, t_object o, t_operation op,
  t_diagram d, t_diagramlinks dl
WHERE
c.end_object_id = o.object_id AND o.object_id = op.object_id AND '<Search Term>' = op.ea_guid AND dl.diagramID = d.diagram_ID AND dl.connectorID = c.connector_id
UNION SELECT
c.ea_guid, c.connector_type, 'Sequence', c.name,
'Operation', o.stereotype, d.name, c.ea_guid FROM
t_connector c, t_object o1, t_object o, t_operation op,
  t_diagram d, t_diagramlinks dl
WHERE
c.end_object_id = o1.object_id AND o1.object_id = o.object_id AND o.object_id = op.object_id AND '<Search Term>' = op.ea_guid AND dl.diagramID = d.diagram_ID AND dl.connectorID = c.connector_id
Order By 3,4
From my book Inside EA. Note that pasting the above into EA is a bit tricky. You should type SELECT manually and paste the rest. You also might need to "tune" the above depending on the used DB.

I'm also not sure whether comments worked back in 8.3 so you might need to delete them.

q.
« Last Edit: February 09, 2013, 01:21:49 am by qwerty »

Hardy

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: Trace operations' usage
« Reply #6 on: February 09, 2013, 01:33:54 am »
From where I can enter SQL query in EA?

qwerty

  • EA Guru
  • *****
  • Posts: 9697
  • Karma: +176/-151
  • I'm no guru at all
    • View Profile
Re: Trace operations' usage
« Reply #7 on: February 09, 2013, 02:43:18 am »
Try ctrl-F / Search builder / New search / SQL Editor (should be the same in 8.3, I hope). There you can give it a name and save it for further use.

q.