//
you're reading...
PowerDesigner, XEM

Advanced Display Options and an End to Custom Shapes

Okay, so it’s been a LONG time since I’ve posted, but two small kids and a job (okay, mostly the kids) will do that.  Anyway …

We’re preparing to upgrade to PowerDesigner 15.3 (sadly from 15.0) and one of the new features I’m very excited to get my hands on is the new advanced display controls available.  Previously, you were fairly limited to the information you could display on a diagram.  Each symbol gave you the ability to select among the most common attributes.  You could add the Stereotype which gave you access to a bit of free-form text you could add to the display, but each object only had one stereotype and it lead to a lot of abuse of the stereotype concept.  If you wanted to show additional information, you were often stuck with color-coding, changing the borders or adding other bits of graphical “flair” to the diagram.  Not the most elegant solution and it requires the addition of a legend to all you diagrams in order to be meaningful.  Forget the legend, and you’ve lost the meaning.

Well, 15.3 fixes that for us.  Let’s look at a quick sample.

Let’s suppose we’d like to add some additional information to the model.  I’ll add two attributes, one is the standard attribute “Annotated” which I’ll add so that our modelers know when someone else on the team has left them some useful information.  The other is subject area, which we currently indicate using color coding (still handy for quickly visualizing a large model).  Let’s walk through how it’s done.  For this sample, I’ve already created a simple model with an extended attribute SubjectArea on the table metaclass.  If you want to play along at home, I’ll leave it to you to create that.  Using a criteria and custom format, I have color coded them according to standards.  If I want to indicate whether there’s an annotation, I could change the width or style of the border or add a graphical tag somewhere on the object (and hope it doesn’t cover something else).

Here’s the “before” picture with the red and blue colors indicating the subject areas.

Before

Now, let’s look at how we can do it better.

First, right click on the desktop and choose “Display Preferences…”

Now, select table on the left of the dialog and then “Advanced…” on the right.

From this dialog, you can add ANY attribute available in the model, including extended attributes you’ve added and any available in the model from another source such as the XDB file.  To add SubjectArea, choose “Add Attribute” from the toolbar at the top of the dialog.  Scroll down until you see “Annotated”.  Since annotated is a boolean, you’ll have the ability to set a few options.  Label, will actually be the label you’ll see next to the attribute on the Display Preferences dialog, NOT what you’ll see next to the value on the diagram.  If you leave it blank, you’ll get the attribute name.  For a boolean you have to provide a value to display when true, and a value for false.  In my example, I’ve left the value for False blank, which means you won’t see anything on the diagram if the Annotated value is false.

Now, let’s add SubjectArea.  Go back to “Add Attribute” and choose the “Extended Attributes” tab this time.  Select SubjectArea and click “OK”.  Subject area is a text string, so you’ll have a slightly different set of options.  Since I created a label on the extended attribute, I can leave the label property blank here, or I can change it.  Prefix and Suffix are the values that will appear before and after the actual subject area (think “<<” and “>>” for a Stereotype).

In Prefix, type a nice label such as “Subject Area:  “.  Don’t forget the colon and a space or two, it won’t add them in for you.  Click “OK”.  Now you’ll be back at the display preferences dialog and you’ll see two new options you can choose.

Make sure they’re both selected and click “OK” again.  Apply your new format to all symbols and here’s the new diagram (I’ve removed the color coding, although it might be useful to keep it for a larger diagram).

Now, on any diagram, I can easily see if there’s an annotation that I might want to read and the subject area.  If I print a subset of the diagram or forget to include the legend, I can still interpret it.  Most importantly, I can present a LOT more information on the diagram in a format that’s much more easily understood.  If you want to get really information dense, you can create extended attributes that compute a result and add that.  Here’s an example.  Suppose you want all your tables to have a subject area and definition set.  Create a custom computed attribute.

Function %Get%(obj)  
  %Get% = true      
  if obj.Comment = "" then
    %Get% = false
  elseif obj.GetExtendedAttribute("Local Extensions.SubjectArea") = "" then
    %Get% = false  
  end if   
End Function

Now add that extended attribute to the table.  In this case, we’ll add it to the top of the table and set the value for False to “Model Incomplete!”.  Here’s what our sample model looks like now.  While this won’t replace custom checks, it’s a way to provide  immediate visual feedback to all our modelers as they’re completing the models.

So, if you haven’t upgraded to 15.3 yet, here’s another great reason to keep current.

Advertisements

Discussion

9 thoughts on “Advanced Display Options and an End to Custom Shapes

  1. Hi,
    I want to define some additional attributes in conceptual such as Examples, Subject area etc and have these flow across various models. For example… add some additional attributes to the entity properties in the logical model and have these available as column properties in the corresponding physical model. I tried different option in Power Designer 15.1 but i couldn’t find out. Can you help me on this

    Thanks
    Raj

    Posted by mgrajkumar | January 28, 2011, 3:20 am
    • If you have an XEM file with extended attributes with the same name on entities that map to each other (e.g. entity table), it will copy the values across. Assuming you have those, here’s how you can add extensions to your target model (some of the terminology changes slightly between 15.0 and 15.3 – I don’t have 15.1 to see which that is but it’s close enough). From the PDM Generation Options dialog, go to the “Detail” table and push the “Enable transformations” dialog. It will add an “Extended Model Definitions” tab. Select the one’s you’d like to add, and you’re done. If you’ve made an XEM file “Auto-Attach” it will already be selected and enabling transformations will be sufficient.

      Posted by Rich Kier | January 28, 2011, 8:22 am
  2. The problem that iam facing is that, I have created the extended model in the Conceptual model(By extending the metaclass Entity) but that is not available to either Logical/Physical models so i couldn’t add that using “Enable transformations” dialog box.

    Posted by mgrajkumar | January 30, 2011, 8:59 pm
  3. You’ll need to create a new XEM file for the target model and add the attribute to the equivalent entity. So, a CDM entity corresponds to a PDM table. So, if your CDM attribute is SubjectArea, create an extended attribute on the table metaclass called SubjectArea. It will copy the value down. If you’ve previously created you extended attributes as part of individual models, you’ll need to start saving them as extended attribute (.XEM) files so they’re accessible.

    Posted by Rich Kier | January 30, 2011, 9:14 pm
  4. Hi Rich

    Great article and resource (this site). There is not much out there in terms of how-to examples, so it’s nice to see that someone is taking it on. I was hoping that you might be able to provide me with some direction on creating a custom symbol formatting script.

    I am building a CDM and have created several ExtendedObject stereotypes, namely “Subject Area”. I have also extended the standard “Entity” class to include an extended attribute that is based on my Subject Area stereotype. What I would like to do, is get the fillcolor of the referenced Subject Area symbol and apply it to the Entity Symbol (after one makes the association in the Entity extended attribute).

    I saw a technique that uses predefined formats and ciriterions, but I would like to define a dynamic solution …

    I am however not able to find the correct syntax to get/set the fillcolor of a symbol object, whether it be an ExtendedObject or standard Entity class.

    Any ideas or help is much appreciated.

    Alex

    Posted by alex soltesz | May 8, 2012, 12:22 pm
  5. Pretty awesome and so close to what we need.
    For discussing data models (i.e. LDM) with the daily business I need to display the attribute comment of an entity.
    Here is a picture of what I mean http://i43.tinypic.com/30ll37n.png

    Example: In an international project I need to review and discuss data models with the user of the system we are developing. Usually there is not enough time to explain the data model to everyone. Therefor I added addtional information about the purpose or an explanation of the attribute inside the attribute comment field of the attribute.
    It would be awesome to display the comment field of an entity attribute on the diagram. Everyone could read and understand the diagrams better.

    This would be very helpful for all project members who can only read a produced pdf Version of the diagrams.
    I spend quite some time reading books about powerdesigner and searched the internet for a solution.
    Is it even possible to display the comments of an entity attribute?

    Thank you very much for feedback. You will help everyone who needs to discuss data models with the daily business.

    Kind regards
    Peter

    Using Powerdesigner v 16.5

    Posted by Peter | November 7, 2013, 1:05 pm
    • Would be pretty helpful but I don´t think that Powerdesigner supports this feature. You can use the text symbol to comment every attribute but in this case the description/not is not associated with the model…
      Or try Excel 😉

      Posted by John | November 11, 2013, 10:00 am

Trackbacks/Pingbacks

  1. Pingback: Advanced Display Options and an End to Custom Shapes (via Power Designing) « Metadata Junkie - March 24, 2011

  2. Pingback: Advanced Display Options and an End to Custom Shapes (via Power Designing) « Simple Data Solutions - May 17, 2011

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Advertisements
%d bloggers like this: