Discussion:
How to create a CDM/LDM diagram with one entity and all other entities related to it through relationships
(too old to reply)
gtss
2011-04-15 14:22:03 UTC
Permalink
Hello all,

How can one create, in as few steps as possible, exclusively through
the PD UI (no scripting), a CDM or LDM diagram that includes:
- one ("start") entity, being the current selection (either in the
model broswer or in a diagram)
- all other entities in the model (or package?) that are directly
related to the "start" entity through all relationships in which the
"start" entity is involved (as either Entity1 or Entity2)
- all the relationships that have the "start" entity is involved (as
either Entity1 or Entity2)

All relationships need to be considered, whatever the cardinality:
1;1, 1:M, M:1, or M:M.


In other words, sort of an impact analysis, but:
- to only one degree of relatedness
- relatedness is only through relationships and no other means, and
- generating a CDM or LDM diagram, not a dependency diagram

In a PDM the relatedness would rely on references instead of
relationships.


Alternatively, is there any way to customize the browser to show all
relationships that an entity is involved, as an additional sub-tree,
below the Attributes and Identifiers sub-trees?

Thanks a lot in advance for any suggestions!
Sean Sexton
2011-04-18 18:03:40 UTC
Permalink
If I understand you correctly, you'd like to create a new CDM or LDM
diagram with a particular table and all other tables that relate
directly to that table. If that's incorrect, you might want to stop
reading now. :-)

1) Pull up a list of references by selecting Model --> References...
2) Sort the resulting List of References by Parent Table or Child
Table. Alternatively, you could set a filter by one of these two
columns. Or, if you name your References using the names of the
tables involved with the Reference, you could filter by that column
using asterisks in the Expression of the Filter. If you want to
explore that option and need help doing so, post a follow-up and I'll
delve deeper. The method you use really depends on the table you're
working with.
3) Having filtered or sorted the list, you should be able to more
easily select all the References involving the desired primary table.
Select all of the table's References using normal Windows Ctrl-click
or Shift-click functionality.
4) Drag the selected list of references onto the diagram. PD will
draw all of the selected references and their respective tables on the
diagram. By selecting and dragging all of the References at once, you
stop PD from drawing your main target table each time you add a
Reference to the diagram.

Hope that helps.

Sean
Post by gtss
Hello all,
How can one create, in as few steps as possible, exclusively through
- one ("start") entity, being the current selection (either in the
model broswer or in a diagram)
- all other entities in the model (or package?) that are directly
related to the "start" entity through all relationships in which the
"start" entity is involved (as either Entity1 or Entity2)
- all the relationships that have the "start" entity is involved (as
either Entity1 or Entity2)
1;1, 1:M, M:1, or M:M.
- to only one degree of relatedness
- relatedness is only through relationships and no other means, and
- generating a CDM or LDM diagram, not a dependency diagram
In a PDM the relatedness would rely on references instead of
relationships.
Alternatively, is there any way to customize the browser to show all
relationships that an entity is involved, as an additional sub-tree,
below the Attributes and Identifiers sub-trees?
Thanks a lot in advance for any suggestions!
Metadata Junkie
2011-05-16 09:32:59 UTC
Permalink
This post might be inappropriate. Click to display it.
rkkier
2011-04-22 13:22:50 UTC
Permalink
Or from the original diagram right click on the starting symbol and choose Edit | Select Connected Symbols. Now go to PowerDesigner menu and choose View | Diagram | New Diagram | New Physical Diagram.

You'll get a new diagram with the selected objects.

Or (and I know you said no scripting but you only have to write this once), you can create a method and a context menu so you can just right click on a table and get the related tables. Parent tables are out references and children are in references. Change the "in" to "out" below and you've got a method for each. Add a custom menu to the table metaclass and you're done.

This should be built-in. I'm away from my 15.3 test box, but I seem to recall someone telling me it was in the newest version.

Sub %Method%(obj)

Dim References
Dim Reference
Dim simple
dim find

set References=obj.InReferences
for each Reference in References
set find = activediagram.FindSymbol(Reference, false)
if find is nothing then
set simple = activediagram.AttachLinkObject(Reference)
end if
next

End Sub
gtss
2011-04-22 18:30:12 UTC
Permalink
Hi Richard,

I am aware of "Select Connected Symbols".
However, "Select Connected Symbols" only selects entities and
relationships connected to the starting symbol that *are* present in
the current diagram.
This would guarantee giving me *all* entities that are related to the
starting one _if and only if_ I perform this "Select Connected
Symbols" operation in a diagram that includes *all* entities and *all*
relationships from the model.
In my current model there is no such diagram; it would be waay too
large.

I will look into your script, may be the way to go. Thanks!
Or from the original diagram right click on the starting symbol and choose Edit | Select Connected Symbols.  Now go to PowerDesigner menu and choose View | Diagram | New Diagram | New Physical Diagram.
You'll get a new diagram with the selected objects.
[...]
Metadata Junkie
2011-05-16 09:08:15 UTC
Permalink
Rich

There is a slightly quicker way of creating a new diagram, from
selected symbols, assuming you've selected at least two symbols.
Right-click one of the selected symbols, then choose 'Create Diagram
from Selection'. This feature is in 15.3, but I don't know when it
was introduced.

George
Or from the original diagram right click on the starting symbol and choose Edit | Select Connected Symbols.  Now go to PowerDesigner menu and choose View | Diagram | New Diagram | New Physical Diagram.
You'll get a new diagram with the selected objects.
Or (and I know you said no scripting but you only have to write this once), you can create a method and a context menu so you can just right click on a table and get the related tables.  Parent tables are out references and children are in references.  Change the "in" to "out" below and you've got a method for each.  Add a custom menu to the table metaclass and you're done.
This should be built-in.  I'm away from my 15.3 test box, but I seem to recall someone telling me it was in the newest version.
Sub %Method%(obj)
Dim References
Dim Reference
Dim simple
dim find
   set References=obj.InReferences
   for each Reference in References
      set find =  activediagram.FindSymbol(Reference, false)
      if find is nothing then
         set simple = activediagram.AttachLinkObject(Reference)
      end if
   next
End Sub
Sean Sexton
2011-05-17 18:09:06 UTC
Permalink
Neat feature. I have 15.2.0.3087 EBF3 and it is not there. Perhaps I
should upgrade and see what else I am missing...

On May 16, 4:08 am, Metadata Junkie
Post by Metadata Junkie
Rich
There is a slightly quicker way of creating a new diagram, from
selected symbols, assuming you've selected at least two symbols.
Right-click one of the selected symbols, then choose 'Create Diagram
from Selection'.  This feature is in 15.3, but I don't know when it
was introduced.
George
Or from the original diagram right click on the starting symbol and choose Edit | Select Connected Symbols.  Now go to PowerDesigner menu and choose View | Diagram | New Diagram | New Physical Diagram.
You'll get a new diagram with the selected objects.
Or (and I know you said no scripting but you only have to write this once), you can create a method and a context menu so you can just right click on a table and get the related tables.  Parent tables are out references and children are in references.  Change the "in" to "out" below and you've got a method for each.  Add a custom menu to the table metaclass and you're done.
This should be built-in.  I'm away from my 15.3 test box, but I seem to recall someone telling me it was in the newest version.
Sub %Method%(obj)
Dim References
Dim Reference
Dim simple
dim find
   set References=obj.InReferences
   for each Reference in References
      set find =  activediagram.FindSymbol(Reference, false)
      if find is nothing then
         set simple = activediagram.AttachLinkObject(Reference)
      end if
   next
End Sub
Loading...