Extending Enterprise Architect

Webinar January 2013

Questions from the Audience

Questions & Answers

Q: Can I use the Profile Helpers to edit and enhance a profile or MDG Technology created with version 9 or earlier?

A: Yes.

Q: Is there full help for each of these new MDG facilities (Profile Helpers)?

A: Yes. You can search for "Profile Helpers" in the Enterprise Architect User Guide. The online documentation for this topic is currently unavailable.

Q: If my technology name is wrong, can I change it without restarting from scratch?

A: Yes you can - there is no need to remodel everything. You will, however, need to make some manual updates to reflect the name change:
  • If you have included model patterns in a toolbox profile, these will include the MDG Technology name. So you'll need to update the corresponding toolbox page entries. Simply edit them using the Profile Helper dialog.
  • If you change the name of a profile (not the MDG Tech name), you must update the toolbox pages that include stereotypes from that profile - again you may use the Profile Helper dialog to do this. The fully qualified name will appear incorrect until you change it.
Note: The MDG Technology name (ID) is only defined when generating your MDG Technology file and is stored with the MTS file. This is distinct from the name you assign to the top-level package when creating an MDG Technology model using the Profile Helper Model Pattern, which can be any arbitrary name.

Q: How do the diagrams display in Enterprise Architect, if the MDG Technology is not installed?

A: Any Shape Scripts that have been defined for stereotypes in the MDG Technology will not be rendered.
Instead, the standard UML presentation for the metaclass will be used.
As soon as the MDG Technology file is referred to, however, the custom Shapes will be drawn as defined by the Shape Script.
To refer to an MDG Technology use the main menu: Settings > MDG Technologies > Advanced > Add Path/URL

Q: Can I import a symbol instead of using the shape script for the stereotypes in my profile?

A: Yes it is possible to render an alternate image by defining a Shape Script and using the image() command. You specify the image to be drawn by passing a reference to the imdageId, defined in Enterprise Architect's Image Manager. See the Drawing Methods help topic for further information.

Q: Where can I get further detailed information on Workflow scripts? The online help is not very verbose.

A: This could form the basis of a future webinar topic.

Q: The Profile Helper dialog for custom diagram types supports options for setting Hand-drawn mode for example, is there any reason why the 'Show Namespace' option is not availabe?

A: Currently this option cannot be set as part of a diagram profile, so it is not available in the Profile Helper dialog either. This option will be considered for a future release however.

Q:Can I put the Learning Center RTF files in the profile path?

A: No, currently this is not possible. You would need to deploy the Learning Center files to Enterprise Architect's installation directory - for example a subfolder of the following location:

C:\Program Files (x86)\Sparx Systems\EA\Books

Note: These files would then not be removed when updating Enterprise Architect to a new version.

Q:Is it possible to version Model Scripts? Import/export is somewhat awkward and change management is difficult.

A: Currently, versioning of model scripts is not supported inside Enterprise Architect. They need to be saved to a file first to be version controlled.

Q: Do Model Scripts support the VB MsgBox?

A: Yes. If you create a Model Script based on VBScript you can use the MsgBox command that is built into VBscript.
For example: MsgBox "Hello World"

Alternatively, you can use the Session object to achieve something similar. The Model Script used in the webinar demonstration has such an example at line 64:

Session.Prompt "This script does not support items of this type.", promptOK

Q: Has the Quicklinker feature changed/improved since version 9?

A: There have been some minor enhancements since version 9.3.

Q: What's the best source of help on the Enterprise Architect object model for writing scripts?

A: The most comprehensive documentation is the User Guide itself. See the "Automation and Scripting" topic, in particular the "Enterprise Architect Object Model" subtopic. You can also access this documentation online.

There are code samples included in the documentation. There are also some complete examples available on our automation interface resources web page. Third-party contributed samples are also available on the Sparx Systems Enterprise Architect Community website.

Q: What's the best source of help on the scripting language used by EA (syntax and semantics)?

A: Enterprise Architect's Model Scripts can be defined using one of the following popular scripting languages: VBScript, JScript and JavaScript. There are numerous third-party resources available for learning these languages. Information specifically relating to Enterprise Architect's Model Scripts is available from the User Guide under the topic: Automation and Scripting > Scripting.

Q: Getting users to write validation rules in code seems a bit techie - any chance this could be made available to non-programmers?

A: One future possibility would be based on defining and evaluating OCL constraints. While Enterprise Architect supports OCL definitions and validation of OCL syntax, it does not yet evaluate and enforce OCL constraints. So the only feasible approach currently is to use some programming logic to validate models.

Q: Does the Model Script debugging capability scale beyond the trivial example you showed in this webinar?

A: Yes. Staff at Sparx Systems make use of this capability and have successfully debugged Model Scripts containing 2,500+ lines of code, operating on large-scale information models.