Preparing Visual Models for Publication

with Enterprise Architect 10

Webinar July 2013

Mr Ben Constable, Senior Analyst at Sparx Systems, shares helpful tips on preparing Enterprise Architect diagrams for presentation in your specification documents, technical standards, reports and other publications. In this webinar you'll learn:

  • Great tips on rapid visual modeling and creation of diagrams
  • An effective approach to tidying diagrams - including those imported from other tools or even machine-generated
  • How to choose the best diagram options and image formats to suit your needs

Explore the Model

We have provided a copy of the Enterprise Architect model that was used in the webinar.

Download: visual-modeling.eap

We have also provided a copy of the VBScript that was used in the webinar.


Questions from the Audience

Questions & Answers

Is there a way to lay out elements with a uniform separation?

Select multiple elements in the diagram, right-click and select from the context menu: Space Evenly | Across or Down

Do you have any tips for exporting diagrams to Word or PowerPoint?

  • Individual diagram images can be exported using the menu option: Diagram | Save as Image
  • All diagrams below a selected package can be exported to an RTF document using: Project | Documentation | Diagrams Only Report. (Diagrams will be exported in a raster graphics format.)
  • The sample model provided on this page also provides a custom RTF template for generating a Diagrams Only report. This report uses a vector graphics format for the diagrams.
  • Select Project | Publish Model. Tick "Generate Diagram Images" and select the desired format. This will export the package to XMI, but at the same time will also output all diagrams as images.
  • Write a script which loops all diagrams and calls the Project.PutDiagramImageToFile method.

You showed how to set the default line style for a generalisation but what about setting the default style for other line types, e.g. associations?

You can do this using the menu option: Tools | Options | Links | Default Style | Routing. This applies to all new connectors. Although not all line styles are currently available from this option, we hope to improve this in a future release.

Do you plan to support Flash or SVG diagram output?

Currently there is no plan to support a Flash output for diagrams. There is, however, a third-party add-in available from this post on the Community website which provides export to SVG.

Without scripting, can you select multiple connectors and change their connector style (e.g. Tree)?

No. As discussed in a previous webinar we invite you to share your typical use cases for this feature.

Is there an easy way to move connectors and snap them to where I want them to attach?

Yes. You can make a connector always draw to a specific feature on the element, such as an attribute or operation, by using the Link to Element Feature command.

You can also pin connector ends in a specific location. Right-click a connector and choose from the "Pin End(s)" options.

When aligning to the top, what element is chosen to be the top reference?

The last element in the selection that was clicked, as indicated by the hatched border. This is also true of the other align and resize functions.

Alternatively, you can left-click any one of your selected elements to make that the reference element for the align/resize function. An example of this is shown in the presentation, where the in-place format bar was used to resize two Enumeration elements.

I've noticed you don't have all the layout options as inline, so I need to go to the menu for some of those. Can you please make them as inline (toolbar) options?

Thanks for the request. We will raise this with the development team.

What is a quick way to include other images, such as a company logo?

Drag and drop an external image from a file explorer window directly onto your Enterprise Architect diagram and choose "Insert". Once you have inserted the image into the diagram, you can copy it within your diagram view and paste it onto other diagrams as required.

When you insert related elements, is it possible to restrict the types of elements that are displayed on screen? For example: show all requirements, but not display any Classes.

Yes. In the presentation we showed only filtering of connectors, as there were multiple types of connectors that matched the criteria. The same can be done for elements - see the controls in the top-right of the Insert Related Elements dialog.

If creating diagrams for a web site, is it possible to create a 'hot-spot' to another diagram?

Yes. You can use Enterprise Architect's Diagram Hyperlink element to link to other diagrams. When generating HTML documentation from your model, these will link to the relevant diagram, provided that the target diagram is also included in the generated report.

How would one automate the export of an entire model to easily publish to a remote web server?

The RunHTMLReport API is available from the Project interface and allows you to generate the model in HTML format via a script. You can identify a starting Package via the first parameter.

How was the script created to format the connectors? Can you make it available please?

It is a Model Script, which was created in Enterprise Architect and written in VBScript. It was created within the Diagram Script Group - meaning it will become available in the context menu when you right-click on the diagram canvas. You can learn more from the Enterprise Architect User Guide's Model Scripts topic and our previous webinar that featured Model Script debugging.

The script used in this presentation is available in the resources section above.
To include it in your own models:
  1. Add a new Diagram Group using the Scripting window: Tools | Scripting
  2. Add a new VBScript into the Script Group created above
  3. Edit the script and overwrite its contents with the contents of the supplied file.
  4. Save your new script and check that you can see it in the context menu when you right-click a diagram's background.

Is it possible to export an RTF template from one project to another? Also, is it possible to set style defaults across multiple templates (i.e. without needing to redefine the style in each template)?

RTF templates can be exported via the menu: Project | Model Import/Export | Export Reference Data.

The Enterprise Architect Enterprise Architect User Guide explains how to set default styles via the Normal.rtf file.

When importing elements into Enterprise Architect, like requirements and features, is there a way to import the hierarchy with connectors from a .csv file?

As described in the Enterprise Architect Enterprise Architect User Guide, element hierarchy can be defined in CSV.

Connectors are not supported using the built-in CSV Import/Export Specifications, however there are scripting libraries available which can assist with defining your own customized CSV Import/Export processes. In Enterprise Architect, these libraries can be accessed via the menu: View | Scripting | EAScriptLib | JScript-CSV.

On the process map there is an illegal gateway (Car Rental) - only one branch. Does Enterprise Architect verify logic in process diagram?

You can validate a BPEL process diagram with Enterprise Architect.

For generic BPMN diagrams, however, model validation is currently not built-in. There are some commercial third-party plug-ins for Enterprise Architect to do this though. For example see:

A lot of standards (*XSD) based models have, say, 20 subclasses in a tree diagram and need multiple levels or a direct diagram with, say, a horse shoe pattern. Is there an automated way to do that for publication on A4/Letter pages?

The Circle, Ellipse and Spring layouts may get part of the way toward a horse shoe pattern. Try it by selecting clusters of elements rather than operating on every element on a complex diagram.

You should also look at the "Lateral Tree Style - Vertical" routing. We've found this can give a suitable result when you have a class with a very large set of child elements. Especially for an A4 page with a portrait layout, you can align the child elements vertically down the page, as shown below. Remember the Align tools and the "Space Evenly Down" command from the context menu.

How do the different layouts work? In other words what are the algorithms that they use (in overview)?

The Enterprise Architect Enterprise Architect User Guide provides a brief description of each diagram layout.

How can you limit shading (rather than the darker on the right examples)?

Use the display option available from: Tools | Options | Diagram | Appearance | Gradient Fill Direction for an Element.

You can change the direction of the gradient or turn it off completely.

"What does the Limit to Namespace option do on the Insert Related Elements dialog?"

Enterprise Architect allows you to flag a package as a Namespace Root. If you select such a package in the Insert Related Elements dialog, only elements that reside below it in the model hierarchy are listed for inclusion in the diagram.

Is it possible to use conditional clauses to filter the elements that will be included in an RTF output? For example, include a linked element only if the target is requirement only.

Yes. There are numerous ways to do this. Here's one of them:
  1. Select the package of interest in the Project Browser.
  2. Invoke the RTF Generator (Right-click | Documentation | Rich Text Format Report.)
  3. Create a new template under the "Templates" tab. (Copy one of the built-in templates, such as "basic template".)
  4. In the Template Editor, invoke the Properties dialog (top-left of the editor window via "hand" icon.)
  5. In the "Elements Filters" tab, use the "Add Filter" button to create a new Filter.
  6. Leave the "Search On" field as "Element" and check the ObjectType row.
  7. Set the appropriate conditions, such as "One of...", with a value of "Requirement".
  8. Check the Required column.
  9. Generate the document and confirm you only have Requirement elements included in the report. (The "Generate" and "View" buttons are also in the RTF Template Editor's toolbar.)

Are the layout functions available from the scripting interface?

Not currently, but this will be raised with the development team.

I have a Component element that is used on two different diagrams. I want to set the element to a different color in each diagram. Is there a way to do that?

Yes. The Format toolbar shown in the presentation lets you do this. It only changes the appearance of elements on the current diagram.

I've noticed that the keyboard keys (arrows) can't be used to move the selected element a bit. Am I just missing this feature? I was only able to move elements by the mouse.

To move the selected element(s), hold the Shift key, then use the left or right arrow. Otherwise, the left and right keyboard arrows will change the selected element on the diagram.

Can you please explain how you compared two diagrams side-by-side?

As of Enterprise Architect version 10, you can 'tear off' diagrams from the main tab view. So just click the diagram label at the bottom of screen and drag it wherever you like. You can also dock the diagram to any of the positions that are highlighted as you drag the diagram around the screen.

If you are interested in comparing changes to a diagram over time, the Enterprise Architect Enterprise Architect User Guide describes a useful diagram compare utility.

Is there a way to turn off frames with a diagram? For example - making a UI mockup - I drag 3 UI form diagrams onto a UI page diagram and I want to turn off the frames on the page diagram to make it cleaner.

This has been implemented for a future release of Enterprise Architect. You will have various options to control what is displayed for a Diagram Frame (border, no border, label, no label etc.)

Note: As brought out in the presentation, you can already hide Diagram Frames from saved, printed and clipboard images via the menu: Tools | Options | Diagram

Can we change all connector types at a diagram level?

Currently, this would require a script, such as the one used in the presentation to change the connector styles for all elements on the diagram.

Are there any upcoming webinars going more into detail re: building templates for generating *.rtf?

Thanks for the suggestion. We are considering further webinars on this topic. In the meantime, you may be interested in our recent presentation on RTF template customization.

For BPMN 2.0, how do we find a list of objects that have not been used - possibly deleted from the diagram?

Enterprise Architect's Model Search capability can locate "orphaned" elements for you - whether they are BPMN or other element types:
  1. Open the Model Search view via the menu: Edit | Find in Project
  2. Select the built-in search named "Find Orphans", then click the Run button.

Is there a way to get State Chart connectors shown as 'rectilinear' (the same style as you show for the business process diagram)? Default is straight lines between the involved states.

Yes. Right-click the connector and choose from the context menu: Line Style | Orthogonal Round.

You could adapt the script provided in the resources section of this page to change the connector styles en masse. There is currently no option to make this the default style for all State Chart connectors though.

The automatic 'legend' that you added, which identified the element type and colour: can this also be done for connectors?

Enterprise Architect's Legend element can define colors for connectors - when you open the Legend properties there are two tabs beside the Up/Down ('hand') icons. If you choose the Line tab, you can define symbols for your connectors. Note: the Legend is not automatically added by Enterprise Architect. For brevity, we omitted the steps to create each symbol of the legend in the demonstration. Automating that process - at least extracting the colors and assigning some default labels - is a nice suggestion though.

You have shown how to align objects - is there a way to set a standard size?

Yes. One way to do this is to define an Elements Template Package in your model, in which you can define the default size and appearance for each type of element.

When copying a diagram to the clipboard (using Ctrl-B shortcut) is there any way to paste it into a word document in vector format?

Yes. Use the Metafile option available from the menu: Tools | Options | General | Clipboard.

How did you make the Connectors appear curved rather than angular in the BPMN example?

This connector style - Orthogonal Round - is the default for BPMN 2 diagrams as used in the presentation. As mentioned for State Machine diagrams, you can apply this style in other diagrams. Right-click a connector and select from the context menu option: Line Style | Orthogonal Round.

When applying a style, is it also possible to modify the font?

Yes. The simple example used in the presentation only adjusted the background fill color for elements using the Diagram Format toolbar. If you adjust the font size and color of an element, then save its style, the font settings will be included when you apply that style to other elements.

Register for our Next Webinar!