UModel Basic
UModel Basic
All rights reserved. No parts of this work may be reproduced in any form or by any
means - graphic, electronic, or mechanical, including photocopying, recording, taping, or
information storage and retrieval systems - without the written permission of the
publisher.
Products that are referred to in this document may be either trademarks and/or
registered trademarks of the respective owners. The publisher and the author make no
claim to these trademarks.
While every precaution has been taken in the preparation of this document, the
publisher and the author assume no responsibility for errors or omissions, or for
damages resulting from the use of information contained in this document or from the
use of programs and source code that may accompany it. In no event shall the publisher
and the author be liable for any loss of profit or any other commercial damage caused or
alleged to have been caused directly or indirectly by this document.
Published: 2024
1 Introduction 10
1.1 Support Notes
.......................................................................................................................................................... 11
2 UModel Tutorial 14
2.1 Getting Started
.......................................................................................................................................................... 15
2.2 Use Cases
.......................................................................................................................................................... 18
2.3 Class..........................................................................................................................................................
Diagrams 27
2.3.1 Creating......................................................................................................................................
Derived Classes 36
2.4 Object..........................................................................................................................................................
Diagrams 42
2.5 Component Diagrams
.......................................................................................................................................................... 49
2.6 Deployment Diagrams
.......................................................................................................................................................... 55
2.7 Forward Engineering (from Model to Code)
.......................................................................................................................................................... 60
2.8 Reverse Engineering (from Code to Model)
.......................................................................................................................................................... 69
Index 544
1 Introduction
Altova UModel 2024 Basic Edition is a UML modeling application with a rich visual interface and superior
usability features to help level the UML learning curve. UModel includes many high-end functions to empower
users with the most practical aspects of the UML 2.5 specification. UModel is a 32/64-bit Windows application
that runs on Windows 10, Windows 11, and Windows Server 2016 or newer. 64-bit support is available for the
Enterprise and Professional editions. For an overview of UModel capabilities, see Support Notes 11 .
UML®, OMG™, Object Management Group™, and Unified Modeling Language™ are either registered
trademarks or trademarks of Object Management Group, Inc. in the United States and/or other countries.
UML diagrams
UModel supports all fourteen diagrams of the UML 2.5.1 specification, and additional specialized diagram
types.
Composite Structure Diagram Interaction Overview Diagram SysML 1.2, 1.3, 1.4, 1.5, 1.6
Diagrams (UModel Enterprise and
Professional editions)
UModel has been designed to allow complete flexibility during the modeling process:
· UModel diagrams can be created in any order, and at any time; there is no need to follow a prescribed
sequence during modeling.
· The syntax coloring in diagrams is customizable. For example, you can customize modeling elements
and their properties (font, color, borders, etc.) in a hierarchical fashion at the project, node/line,
117
element family and element level, see Changing the Style of Elements .
· The unlimited levels of Undo/Redo track not only content changes, but also all style changes made to
any model element.
113
· Modeling elements support hyperlinks, see Hyperlinking Elements .
C# 1.2, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 7.1, 7.2, Same language versions as for code
7.3, 8.0, 9.01, 10 engineering2
C++ (UModel Enterprise C++98, C++11 and C++14, C++17, C+ Not applicable
Edition) +20
Java 1.4, 5.0 (1.5), 6 (1.6), 7 (1.7), 8 (1.8), 9 Same language versions as for code
(1.9), 10, 11, 12, 13, 14, 15, 16, 17, 18, engineering3
19
Visual Basic .NET 7.1 or newer Same language versions as for code
engineering
Table footnotes:
1. If you import binary files compiled from C# 9.0 code, note that any records will be imported as classes.
This limitation is due to the fact that records are marked as classes in the assembly, which makes it
impossible to distinguish them from classes.
2. C# code engineering and import of binaries include support for .NET Framework, .NET Core, .NET 5,
and .NET 6. Note that .NET Framework, .NET Core, .NET 5 or .NET 6 must be installed, as applicable.
Binaries of other .NET implementations which are not mentioned are likely to be imported as well. See
also Importing Java, C# and VB.NET Binaries 198 .
3. It is also possible to import binaries targeting Java Virtual Machines other than Oracle JDK, such as
OpenJDK, SapMachine, Liberica JDK, and others, see Adding Custom Java Runtimes 199 .
4. In the case of XML Schemas, code engineering means that you can import a schema (or multiple
schemas from a directory) into UModel, view or modify the model, and write the changes back to the
schema file. When you synchronize data from the model to a schema file, the schema file is always
overwritten by the model. See also XML Schema Diagrams 416 .
5. In the case of databases, code engineering means that you can (i) model a database in UModel with
the option to update the database through a script generated from the model, or (ii) import an existing
database structure into a model, make changes to it, and then deploy a script generated from the
model to the database. Some database object types are not supported for modeling.
General notes:
· You can synchronize the code and model at the project, package, or even class level. UModel does
not require that pseudo-code, or comments in the generated code be present, in order to accomplish
round-trip engineering.
· A single project can support Java, C#, or VB.NET code simultaneously.
· UModel supports the use of UML templates and their mapping to or from Java, C# and Visual Basic
generics.
· While importing source code, you can optionally generate Class 391 and Package 400 diagrams. Once
the source code is imported into the model, you can also generate Sequence 358 diagrams.
· You can generate program code from Sequence diagrams 364 and from State Machine diagrams 318
· UModel projects can be split up into multiple sub-projects allowing several developers to
simultaneously edit different parts of a single project. You can then reintegrate the changes back into a
common model. You can also merge UModel projects, as a 2-way or as a 3-way merge, see Merging
UModel Projects 268 .
· Code generation in UModel is based on Spy Programming Language (SPL) templates and is
customizable.
Interoperability
UModel also provides support for importing or exporting projects to or from XML Metadata Interchange (XMI)
format, see XMI - XML Metadata Interchange 434 .
2 UModel Tutorial
This tutorial shows you how to create various UML diagrams with UModel, while acquainting you with the
graphical user interface. You will also learn how to generate code from a UML model (forward engineering) as
well as how to import existing code into a UML model (reverse engineering). With respect to code engineering,
you will also learn how to perform full round-trip engineering (either model->code->model or code->model-
>code). This tutorial assumes basic knowledge of the UML.
The tutorial is organized into sections as shown below. In the initial sections of this tutorial you will be working
with a sample project pre-installed with UModel. If you would like to quickly create a new modelling project from
scratch with UModel, you can skip directly to Forward Engineering (from Model to Code) 60 .
· Getting Started 15
· Use Cases 18
· Class Diagrams 27
· Creating Derived Classes 36
· Object Diagrams 42
· Component Diagrams 49
· Deployment Diagrams 55
· Forward Engineering (from Model to Code) 60
This tutorial makes use of the following sample UModel project files available in the directory C:
\Users\<username>\Documents\Altova\UModel2024\UModelExamples\Tutorial:
BankView-start.ump This is the UModel project file that constitutes the initial state of the tutorial
sample. Several model diagrams as well as classes, objects, and other model
elements exist in this project. By working through the tutorial, you will be adding
new elements or diagrams, or editing existing ones, using UModel.
BankView-finish.ump This is the UModel project file that constitutes final state of the tutorial sample.
Note: All UModel example files are initially available in the directory C:\ProgramData\Altova\UModel2024.
When any user starts the application for the first time, the example files are copied to C:
\Users\<username>\Documents\Altova\UModel2024\UModelExamples. Therefore, do not move,
edit, or delete the example files in the initial directory.
Note the major parts of the user interface: multiple helper windows on the left hand side and the main diagram
window to the right. Two default packages are visible in the Model Tree window, "Root" and "Component View".
These two packages cannot be deleted or renamed in a project.
· The Model Tree window contains and displays all modeling elements of your UModel project.
Elements can be directly manipulated in this window using the standard editing keys as well as drag
and drop.
· The Diagram Tree window allows your quick access to the modeling diagrams of you project wherever
they may be in the project structure. Diagrams are grouped according to their diagram type.
· The Favorites window is a user-definable repository of modeling elements. Any type of modeling
element can be placed in this window using the "Add to Favorites" command of the context menu.
· The Properties window displays the properties of the currently selected element in the Model Tree
window or in the Diagram window. Element properties can defined or updated in this window.
· The Styles window displays attributes of diagrams, or elements that are displayed in the Diagram view.
These style attributes fall into two general groups: Formatting and display settings.
· The Hierarchy window displays all relations of the currently selected modeling item, in two different
views. The modeling element can be selected in a modeling diagram, the Model Tree, or in the
Favorites window.
· The Overview window which displays an outline view of the currently active diagram.
· The Documentation window which allows you to document your classes on a per-class basis.
In this tutorial, you will be working mostly within the Model Tree and Diagram Tree windows, as well as the
main diagram window. For further information about the graphical user interface elements, see UModel User
Interface 77 .
1. Select the menu option File | Open and navigate to the ...\UModelExamples\Tutorial folder of
UModel. Note that you can also open a *.ump file through a URL, please see Switch to URL 485 for
more information.
2. Open the BankView-start.ump project file. The project file is now loaded into UModel. Several
predefined packages are now visible under the Root package. Note that the main window is empty at
the moment.
15
To proceed, run UModel and open the BankView-start.ump project (see also Opening the Tutorial Project ).
1. Right-click the Root package in the Model Tree window, and select New Element | Package.
2. Enter the name of the new package (in this example, "Use Case View"), and press Enter.
A Use Case diagram has now been added to the package in the Model Tree window, and a new
Diagram window has been created as well. A default name has been provided automatically.
3. Double-click the diagram name in the Model Tree window, change it to "Overview Account Balance",
and press Enter to confirm.
2. Click the Use Case toolbar button and then click inside the diagram window to insert the
element. A "UseCase1" element is inserted. Note that the element, and its name, are currently
selected, and that its properties are visible in the Properties window.
3. Change the title to "get account balance", press Enter to confirm. Double-click the title if it is
deselected. Note that the use case is automatically resized to adjust to the text length.
Note: To create a multi-line use case name, press Enter while holding the Ctrl key pressed.
1. Double-click the "Actor1" text of the Actor element, change the name to "Standard User" and press
Enter to confirm.
2. Place the mouse cursor over the handle to the right of the actor. A tooltip containing "Association"
appears.
3. Click the handle, drag the Association line to the right, and drop it on the "get account balance" use
case. An association has now been created between the actor and the use case. The association
properties are also visible in the Properties window. The new association has been added to Model
Tree under the Relations item of the Use Case View package.
4. Click the use case and drag it to the right to reposition it. The association properties are visible on the
association object.
5. Click the use case to select it, then click the collapse icon on the left edge of the ellipse.
A blue dot next to an element in the Model Tree window signifies that the element is visible in the
current diagram. For example, in the image below, three elements are currently visible in the diagram
and thus have a blue dot in the Model Tree:
Resizing the actor adjusts the text field, which can also be multi-line. To insert a line break into the
text, press Enter while holding the Ctrl key pressed.
1. Click the Use Case toolbar button and simultaneously hold down the Ctrl key.
2. Click at two different vertical positions in the diagram to add two more use cases, then release the Ctrl
key.
3. Name the first use case "get account balance sum" and the second, "generate monthly revenue
report".
4. Click the collapse icon of each use case to hide the extensions compartment.
5. Click the actor and use the association handle to create an association between "Standard User" and
"get account balance sum".
· Click the Include handle of the "get account balance sum" use case, at the bottom of the ellipse, and
drop the dependency on "get account balance". An "include" dependency is created, and the include
stereotype is displayed on the dotted arrow.
5. Click OK to confirm the settings and insert the new actor. Move the new "Bank" actor to the right of the
lowest use case.
6. Click the Association toolbar button and drag from the "Bank" actor to the "generate monthly
revenue report" use case. This is an alternative method of creating an association.
Note: The background color used to make the bitmap transparent has the RGB values 82.82.82.
You can also align and adjust the size of multiple elements, as follows:
1. Create a selection marquee by dragging on the diagram background, making sure that you encompass
all three use cases starting from the top. Alternatively, to select multiple elements, click elements
while holding the Ctrl key pressed. Note that the last use case to be marked, is shown in a dashed
outline in the diagram, as well as in the Overview window.
All use cases are selected, with the lowest being the basis for the following adjustments.
3. To line up all the ovals, click the Center Horizontally toolbar button.
· Change the setting Diag. Show Grid from "true" to "false". (Alternatively, if a diagram is currently
open, click the Show Grid toolbar button.)
15
To proceed, run UModel and open the BankView-start.ump project (see also Opening the Tutorial Project
).
1. In the Diagram Tree window, expand the "Class Diagrams" package to display all class diagrams
contained in the project.
Note: It is also possible to open the diagram from the Model Tree window. First, locate the diagram under
the package "Root | Design-phase | BankView | com | altova | bankview", and then use either of the
methods above to open it.
Two concrete classes with a composite association between them are visible in the class diagram.
1. Click the Class toolbar button, and then click to the right of the Bank class to insert the new
class.
2. Double-click the name of the new class and change it to Account.
3. In the Properties window, select the abstract check box to make the class abstract. The class title is
now displayed in italic, which is the identifying characteristic of abstract classes.
4. In the code file name text box, enter "Account.java" to define the Java class.
2. Change the property name to balance, and then enter a colon ( : ) character. A drop-down list
containing all valid types is displayed.
3. Type "f", and press Enter to insert the return type "float". Note that drop-down lists are case sensitive.
4. Continue on the same line by appending "=0" to define the default value.
5. Using the same method as above, create a new property id of type String.
3. Using the same method as above, add two more operations, namely, getBalance():float and
getId():String.
Let's now add a new operation which takes a parameter. We will also specify the parameter direction and type.
3. Select "in" from the drop-down list, enter a space, and continue editing on the same line.
4. Enter "bankAPI" as parameter name and then a colon ( : ). A drop-down list opens, allowing you to
select the parameter type.
1. Place the mouse cursor after the close parenthesis character ")" and enter a colon ( : ). A drop-down
list opens, allowing you to select a return type.
2. Press the "b" key and select boolean as data type.
To specify an operation's visibility (for example, "private", "protected", "public"), click the icon preceding the
operation name, and select the required value, for example:
The visibility "package" is applicable for Java. In C#, use "package" to specify visibility as "internal". For
information about how UModel elements map to constructs in each language, see UModel Element
Mappings 218 .
1. In the Styles window, select Project Styles from the top drop-down list.
2. Scroll down to the Show Visibility setting, and select UML Style.
Deleting and hiding class properties and operations from a Class diagram
Press F8 to add a dummy operation Operation1 to the Account class.
To delete the dummy operation, select it and then press Delete. (Alternatively, right-click it and select Delete
from the context menu). A message box appears asking if you want to delete the element from the project.
Click Yes to delete Operation1 from the class diagram as well as from the project.
To delete the operation from the class in the diagram, but not from the project, press the Ctrl+Delete. This
hides the operation from the diagram, although it continues to exist in the project. Classes with hidden
members are displayed with an ellipsis ( ... ) character, as shown below:
To unhide the operation, double-click the ellipsis at the bottom of the class. A dialog box appears where you
can choose the elements that should be visible on the diagram, for example:
It is possible to configure UModel not to display a message box when you attempt to delete an object from the
diagram, as follows:
1. Click the Composition toolbar button, and then drag from the Bank class to the Account class.
The class is highlighted when the association can be made. A new property (Property1:Account) is
created in the Bank class, and a composite association arrow joins the two classes.
2. Double click the new Property1 property in the Bank class and change it to "accounts", being sure
not to delete the Account type definition (displayed in teal/green).
3. Press the End keyboard key to place the text cursor at the end of the line.
4. Enter the open square bracket character ( [ ) and select asterisk ( * ) from the dropdown list. This
defines the multiplicity, namely, the fact that a bank can have many accounts.
Notice that the multiplicity range previously added to the diagram is also visible in the Properties
window:
27
Note: It is assumed you have already followed the previous tutorial section, Class Diagrams , to create the
abstract class Account.
2. Click the CheckingAccount class (of the same package) and drag it into the diagram. Place the class
below and to the left of the Account class.
3. Use the same method to insert the CreditCardAccount class. Place it to the right of the
CheckingAccount class.
1. Right-click the diagram and select New | Class. A new class is automatically added to the correct
package (bankview) which contains the current class diagram "Account Hierarchy".
2. Double-click the class name and change it to SavingsAccount.
3. Create the class structure as illustrated below. To add properties and operations, use the methods
27
illustrated in the previous tutorial section, Class Diagrams .
3. In the Properties window, in the "code file name" text box, enter "SavingsAccount.java" to define the
Java code class.
Properties and operations can be directly copied or moved from one class to another:
This can be achieved using drag and drop, as well as the standard Copy/Paste keyboard shortcuts (Ctrl + C,
Ctrl + V), see also Renaming, Moving, and Copying Elements 107 . For the scope of this example, you can
quickly copy the collectAccountInfo() operation from the Account class to the new SavingsAccount class,
as follows:
The operation is copied into the SavingsAccount class, which is automatically expanded to display the new
operation.
The new operation is now also visible in the SavingsAccount class in the class diagram.
We will now create a generalization/specialization relationship between Account and the specific classes (that
is, create three derived concrete classes).
1. Click the Generalization toolbar button and hold down the Ctrl key.
2. Drag from CreditCardAccount class and drop on the Account class.
3. Drag from the CheckingAccount class and drop on the arrowhead of the previously created
generalization.
4. Drag from the SavingsAccount class and drop on the arrowhead of the previously created
generalization: release the Ctrl key at this point.
Generalization arrows are created between the three subclasses and the Account superclass.
To proceed, run UModel and open the BankView-start.ump project (see also Opening the Tutorial Project 15 ).
The project includes a predefined object diagram "Sample Accounts", which will be used to illustrate the tasks
above.
This object diagram combines both classes and instances of them (objects). Specifically, AltovaBank:Bank is
the object/instance of the Bank class, while John's checking: CheckingAccount is an instance of the class
CheckingAccount class (not yet added to the diagram).
Let's now add the missing Account class to the diagram, by dragging it from the Model Tree into the diagram.
Notice that the composite association between Bank and Account is displayed automatically (this association
was defined in one of the previous tutorial sections, see Class Diagrams 27 ).
1. Click the InstanceSpecification toolbar button, and then click inside the diagram, below the
object John's Checking: Checking Account.
2. Change the name of the new instance to John's Credit, and press Enter.
3. Select the new instance to display its properties in the Properties window.
4. In the Properties window, next to "classifier", select CreditCardAccount from the drop-down list.
The instance has now changed appearance to display all properties of the class. Double-click any
property to enter a value, for example:
To show or hide specific nodes, right-click the instance and select Show/hide node content (Ctrl+Shift+H)
from the context menu.
1. In the Model Tree window, right-click the bankview package, and select New element |
InstanceSpecification.
2. Rename the new instance to John's Saving, and press Enter to confirm. The new object is added to
the package and sorted accordingly.
3. While the object is still selected in the Model Tree window, select SavingsAccount next to
"classifier" in the Properties window.
4. Drag the object John's Saving from the Model Tree window into the diagram, placing it below the
object John's Credit.
1. Click the existing link (association) between the object AltovaBank: Bank and the object John's
Checking: CheckingAccount.
2. In the Properties window, next to "classifier", select the entry Account - Bank. The link now changes
to a composite association, in accordance with the class definitions.
3. Click the InstanceSpecification toolbar button, and position the cursor over the object John's
Credit: CreditAccount. The cursor now appears as a + sign.
4. Drag from the object John's Credit: CreditAccount to AltovaBank: Bank to create a link between
the two.
5. In the Properties window, next to "classifier", select the entry Account - Bank.
6. Finally, using the methods outlined above, create a link between the object AltovaBank: Bank and the
object John's Saving: SavingsAccount.
Note that changes made to the association type in any class diagram are automatically updated in the object
diagram.
Object slots can also be filled from the Properties window, by selecting the object and entering the appropriate
text next to "value", for example:
To proceed, run UModel and open the BankView-start.ump project (see also Opening the Tutorial Project 15 ).
The project includes several predefined object diagrams which will be used to illustrate the tasks above. It is
assumed you have already followed the tutorial section Creating Derived Classes 36 to create the class
SavingsAccount.
Let's now add a new class to the diagram and also create a realization dependency between the new class and
the BankView component.
1. In the Model Tree window, locate the SavingsAccount class in the bankview package. If this class is
missing, follow the tutorial section Creating Derived Classes 36 to create it first.
2. Drag the SavingsAccount class from the Model Tree into the diagram.
By default, the class is displayed with all compartments expanded. Click the collapse/expand icons to the left
of the class to show or hide properties and operations.
To create a realization dependency between the class and the component, do one of the following:
· Click the Realization toolbar button and drag from the SavingsAccount class to the BankView
component.
· Move the cursor over the "ComponentRealization" handle of the class and drag to the BankView
component.
The realization dependency between SavingsAccount and BankView has now been created.
To give a name to the new dependency line (for example, "Realization5"), first select the line, and then start
typing its name directly. Alternatively, select the line, and then edit the Name property in the Properties
window.
1. Select the line created previously (that is, the one between SavingsAccount and BankView).
2. In the Model Tree window, navigate to Root | Component View | BankView and drag the BankView
GUI package into the diagram.
3. Also drag the BankView package into the diagram.
4. Click the Usage toolbar button and drag from the BankView GUI package to the IBankAPI
Interface.
As illustrated below, both packages now have a usage dependency to the interface. Namely, the IBankAPI
interface is required by the packages BankView and BankView GUI. As for the package Bank API Client, it
provides the interface.
· Select the interface, and then click the Toggle Interface Notation button in its lower-right corner.
To switch back to the previous notation style, select the interface, and then click the Toggle interface
notation button again.
15
To proceed, run UModel and open the BankView-start.ump project (see also Opening the Tutorial Project
).
"Artifacts" diagram
These manifestations were created using a technique similar to other relationships previously illustrated in this
tutorial, as follows:
Using the same technique, let's also add a dependency between the two .jar files, as follows:
"Deployment" diagram
Assuming that the goal is to illustrate a TCP/IP connection between the home PC and a bank, let's add the
required elements:
1. Click the Node toolbar button, and click right of the Home PC node to insert it.
2. Rename the node to "Bank", and drag one of its edges to enlarge it.
3. Click the Dependency toolbar button, and then drag from the "Home PC" node to the "Bank"
node. This creates a dependency between the two nodes.
4. Select the dependency line and enter "TCP/IP" as name of the new dependency. (Alternatively, edit the
Name property in the Properties window).
Embedding artifacts
In the Model Tree window, expand the "Deployment View" package, and then drag all of the following artifacts
into the diagram: BankAddresses.ini, BankAPI.jar, and BankView.jar. The project is preconfigured to
include deploy dependencies between these artifacts and the "Home PC" node, so all these dependencies are
now visible in the diagram:
You can also embed the artifacts into the "Home PC" node, by dragging each of the artifacts into it. Notice that
the deploy dependencies are no longer visible on the diagram, although they continue to exist logically.
Artifacts embedded into the node can also have dependencies between them. To illustrate this:
1. Click the Dependency toolbar button and, holding the Ctrl key pressed, drag from the
"BankView.jar" artifact into the "BankAddresses.ini".
2. While holding the Ctrl key pressed, drag from the "BankView.jar" artifact into the "BankAPI.jar"
artifact.
Note: Dragging an artifact out of a node onto the diagram always creates a deployment dependency
automatically.
The code generation language used in this tutorial is Java; however, similar instructions are applicable for other
code generation languages.
· On the File menu, click New. (Alternatively, press Ctrl+N, or click the New toolbar button.)
At this stage, the project contains only the default "Root" and "Component View" packages. These two
packages cannot be deleted or renamed. "Root" is the top grouping level for all other packages and elements in
the project. "Component View" is required for code engineering; it typically stores one or more UML
components that will be realized by the classes or interfaces of your project; however, we didn't create any
classes yet. Therefore, let's first design the structure of our program, as follows:
1. Right-click the "Root" package in the Model Tree window and select New Element | Package from
the context menu. Rename the new package to "src".
2. Right-click "src" and select New Element | Package from the context menu. Rename the new
package to "com"
3. Right-click "com" and select New Element | Package from the context menu. Rename the new
package to "nanonull".
4. Right-click "nanonull" and select New Element | Class from the context menu. Rename the new class
to "MyClass".
All of these requirements are explained in more detail below. Note that you can always check if the project
meets all code generation requirements, by validating it:
· On the Project menu, click Check Project Syntax. (Alternatively, press F11.)
If you validate the project at this stage, the Messages window displays a validation error ("No Namespace Root
found! Please use the context menu in the Model Tree to define a Package as Namespace Root"). To resolve
this, let's assign the package "src" to be the namespace root:
· Right-click the "src" package and select Code Engineering | Set As Java Namespace Root from
the context menu.
· When prompted that the UModel Java Profile will be included, click OK.
Notice the package icon has now changed to , which signifies that this package is a Java namespace root.
Additionally, a Java Profile has been added to the project.
Notice that the icon of both "com" and "nanonull" packages has now changed to , which indicates these are
now namespaces.
Another requirement for code generation is that a component must be realized by at least a class or an
interface. In UML, a component is a piece of the system. In UModel, the component lets you specify the code
generation directory and other settings; otherwise, code generation would not be possible. If you validate the
project at this stage, a warning message is displayed in the Messages window: "MyClass has no
ComponentRealization to a Component - no code will be generated". To solve this, a component must be
added to the project, as follows:
1. Right-click "Component View" in the Model Tree window, and select New Element | Component from
the context menu.
2. Rename the new Component to "nanonull".
3. In the Properties window, change the directory property to a directory where code should be
generated (in this example, "src\com\nanonull"). Notice that the property use for code engineering
is enabled, which is another prerequisite for code generation.
4. Save the UModel project to a directory and give it a descriptive name (in this example, C:
\UModelDemo\Tutorial.ump).
Note: The code generation path can be absolute or relative to the .ump project. If it is relative as in this
example, a path such as src\com\nanonull would create all the directories in the same directory
where the UModel project was saved.
We have deliberately chosen to generate code to a path which includes the namespace name; otherwise,
warnings would occur. By default, UModel displays project validation warnings if the component is configured to
generate Java code to a directory which does not have the same name as the namespace name. In this
example, the component "nanonull" has the path "C:\UModelDemo\src\com\nanonull", so no validation
warnings will occur. If you want to enforce a similar check for C# or VB.NET, or if you want to disable the
namespace validation check for Java, do the following:
· In the Model Tree window, drag from the MyClass created previously and drop onto component
nanonull.
The component is now realized by the project's only class MyClass. Note that the approach above is just one of
the ways to create the component realization. Another way is to create it from a component diagram, as
illustrated in the tutorial section Component Diagrams 49 .
Next, it is recommended that the classes or interfaces which take part in code generation have a file name.
Otherwise, UModel will generate the corresponding file with a default file name and the Messages window will
display a warning ("code file name not set - a default name will be generated"). To remove this warning:
create the classes or interfaces. This can be done as follows (the instructions are similar for C# and VB.NET):
Generating code
Now that all prerequisites have been met, code can be generated as follows:
1. On the Project menu, click Merge Program Code from UModel Project. (Alternatively, press F12.)
Note that this command will be called Overwrite Program Code from UModel Project if the
Overwrite Code according to Model option was selected previously on the "Synchronization
Settings" dialog box illustrated below.
2. Leave the default synchronization settings as is, and click OK. A project syntax check takes place
automatically, and the Messages window informs you of the result:
package com.nanonull;
MyClass.j ava
1. On the Project menu, click Merge UModel Project from Program Code (Alternatively, press Ctrl +
F12).
2. Leave the default synchronization settings as is, and click OK. A code syntax check takes place
automatically, and the Messages window informs you of the result:
The operation sum (which has been reverse engineered from code) is now visible in the Model Tree window.
Note: The sample Java code used in this tutorial is available as a ZIP archive at the following path: C:
\Users\<username>\Documents\Altova\UModel2024\UModelExamples\OrgChart.zip. Please
unzip the archive to the same directory before starting the tutorial.
5. Select the Generate diagram per package option. This instructs UModel to create a new diagram
for each package. The diagram styling options can be changed later if necessary.
6. Click Next to continue. This dialog box allows you to define the package dependency generation
settings.
7. Click Finish. When prompted, save the new model to a directory on your system. The data is parsed,
and a new package called "OrgChart" is created.
8. Expand the new package and keep expanding the sub packages until you get to the OrgChart
package (com | OrgChart). Double-click the "Content of OrgChart" diagram icon:
1. Right-click inside the "Content of OrgChart" diagram, and then select New | Class from the context
menu.
2. Click the header of the new class, and enter CompanyType as the name of the new class.
3. Add new operations to the class using the F8 shortcut key. For the purpose of this example, add the
following operations: CompanyType(), getCompanyType():String, setCompanyType():String.
Note: Since the class name is CompanyType, the operation CompanyType() is automatically assigned the
<<constructor>> stereotype.
1. While the CompanyType class is selected in the diagram, locate the property "code file name" in the
Properties window and enter "CompanyType.java" as file name.
2. Click the new CompanyType class in the Model Tree, drag upwards and drop onto the OrgChart
component below the Component View package. A notification appears when the mouse pointer is over
a component.
This method creates a relation of type "ComponentRealization" between a class and a component. An
alternative way to do this is to draw the relation in a component diagram, see Component Diagrams 49
. Expand the Relations item below OrgChart to see the newly created relation.
1. In the Model Tree window, locate the OrgChart component in the "Component View".
2. Right-click the OrgChart component, and select Code Engineering | Merge Program code from
UModel Component from the context menu.
The messages window displays the syntax checks being performed and status of the synchronization
process.
When the process completes, the new CompanyType.java class has been added to the folder ...
\OrgChart\com\OrgChart\.
All method bodies and changes to the code will either be commented out or deleted depending on
the setting in the "When deleting code" group, in the Synchronization settings dialog box.
You have now completed a full round-trip code engineering cycle with UModel.
By default, the helper windows on the left side are docked in groups of three, and the Messages window
appears below the diagram pane. You can, however, move and dock or undock any window as necessary. All
windows can be searched using the Find combo box in the Main toolbar, or by pressing Ctrl+F. See also
Finding and Replacing Text 109 .
· Right-click its title bar, and select Docking (or Floating, respectively) from the context menu.
To move a window:
1. Click the window's title bar and drag to a new position. Several docking helpers appear.
2. Drag the window over a top, right, left, or bottom handle to dock it to the new position.
This chapter provides reference information about the parts that make up the UModel graphical user interface,
as follows:
When you create a new UModel project, two packages are available by default, the "Root" and "Component
View" packages. These two packages are the only ones that cannot be renamed or deleted. The "Root"
package serves as starting point for modeling all other elements, while the "Component View" package is
required for code engineering.
You can create additional packages, classes, diagrams, and their hierarchy either from this window or directly
from a diagram, see Creating Elements 104 . For additional operations that you can take against items in the
Model Tree, see the How to Model... 103 chapter.
Note: UModel includes several example projects that you can explore in order to learn the modeling basics
and the graphical user interface. These can be found at the following path: C:
\Users\<username>\Documents\Altova\UModel2024\UModelExamples.
· Press the * (asterisk) key to expand the current item and all child items
· Press the + (plus) key to expand the current item only.
To collapse the packages, press the - (dash) keyboard key. To collapse all items, click the "Root" package
and press - (dash). Note that you can use both the standard keyboard keys and the numeric keypad keys to
achieve this.
Icon reference
The Model Tree window may display a large number of icons which correspond to elements and diagrams in
your project, the code engineering packages, as well as the imported profiles or subprojects. Specifically, it
may display the following package types:
Icon Description
Java namespace root package. Used to generate or reverse engineer Java code
Visual Basic namespace root package. Used to generate or reverse engineer VB.NET code
XML Schema namespace root package. Used to generate XML schemas from the model, or import
416
them into the model, see XML Schema Diagrams .
A UML profile
The diagrams that can appear in the Model Tree window are listed below.
Icon Description
Activity Diagram
Class Diagram
Communication Diagram
Component Diagram
Deployment Diagram
Object Diagram
Package Diagram
Profile Diagram
Sequence Diagram
Timing Diagram
Below are some examples of UML modeling elements that can appear in the Model Tree window. For more
288
information about UML elements and the diagram types where they occur, see the UML Diagrams chapter.
Icon Description
Class
Property
Operation
Parameter
Actor
Use Case
Component
Icon Description
Node
Artifact
Interface
Relations
Constraints
Diagrams in this window can be shown either as an alphabetical list, or grouped by type. To change the display
option, right-click in the window, and select or clear the Group by Diagram type option.
For instructions about creating, opening, and generating diagrams, including how to model their content, refer
to the How to Model... 103 chapter. For specific information about each diagram type, refer to the UML
Diagrams 288 chapter.
Favorites window
By default, the contents of the Favorites window are automatically saved when you save the project. You can
change this option from the Tools | Options menu, File tab. The relevant option name is Load and save with
project file | Favorites.
Items in the Favorites window are not copies or clones; they represent the actual elements or diagrams. Most
actions that you take in the Model Tree window are also applicable in the Favorites window, including adding or
deleting elements. For more information, see the How to Model... 103 chapter.
The Properties window also enables you to change the properties of the currently selected element or
relationship. The available properties depend on the kind of the element that is selected. There are properties
which are read-only and grayed out (such as "element kind") and properties that you can modify (for example,
"name").
If an operation or property takes a parameter, you can quickly jump to the respective parameter type in the
Model Tree window, directly from the Properties window. To do this, right-click the "type" property of the
parameter in the Properties window and select Select in Model Tree from the context menu. The same is
applicable for return parameters.
Properties window
Changing a property of an element from the Properties window is immediately reflected in the diagram.
Likewise, making a change in the diagram (for example, changing the visibility of an operation from public to
private) affects the applicable property in the Properties window.
Properties that are enclosed within guillemets represent stereotypes (for example, «final»). You can add
custom stereotypes to the project, in which case they would appear as properties in the Properties window, in
addition to the default ones. For more information, see Example: Creating and Applying Stereotypes 408 .
Styles window
Changing a property from the Styles window is immediately reflected in the user interface. Likewise, making a
style change in another place (for example, setting the visibility of the diagram grid using the Show Grid
toolbar button) affects the applicable property in the Styles window.
The Styles window has a dropdown list in the upper part, which enables you to select the level at which the
style change is to be applied (for example, at individual element level, or at project level). For more information,
see:
· Tree view
· Graph view
To switch between views, click the Show tree view or Show graph view buttons in the upper-left
corner of the window.
The tree view shows multiple relations of the currently selected element, as a tree. Click the buttons at the top
of the window to select types of relations that are to be shown. In the image below, only generalizations
and associations are selected to be shown.
The graph view shows a single set of relations in a hierarchical overview, as a diagram. In this view, only one of
the relation buttons can be active at any one time. In the image below, the Show Generalizations button
is currently active.
In the graph view, you can generate diagrams that include the elements visible in the window. To do this, right-
click inside the window, and select Create diagram as this graph from the context menu.
Settings pertaining to Hierarchy window can be changed using the menu option Tools | Options | View, in the
Hierarchy group in the lower section of the dialog box.
The Hierarchy window is navigable: double-click one of the element icons, inside the window, to display the
relations of that element. This applies both in the tree view and in the graph view.
Overview window
Documentation window
Text inside the Documentation window can be spell-checked. To do this, right-click inside the window, and
select Documentation Spelling from the context menu.
Documentation text can also be exported as comments in the generated source code, or imported from source
code comments during reverse engineering. For more information, see Documenting Elements 116 .
Messages window
The table below lists possible message types and their icons.
Icon Description
Indicates a warning message. Warnings are less critical than errors, but they may still
prevent code from being imported or generated.
Indicates an error message. When an error occurs, code generation or import fails.
The buttons available at the top of the Messages window enable you to take the following actions:
Icon Description
Filter messages by severity: information messages, and warnings. Select Check All to
include all severity levels (this is the default behavior). Select Uncheck All to remove all
severity levels from the filter.
Icon Description
Copy the selected line to the clipboard, including any lines nested under it.
Importantly, the toolbar buttons and the context menu commands in UModel change based on the type of
diagram that is currently active (in focus). For example, if you click inside a Class diagram, the toolbar buttons
will include only elements applicable to class diagrams. To view the diagram type, click inside an empty area in
the diagram, and observe the "element kind" property displayed in the Properties window 85 . The diagram type
can also be distinguished by the icon accompanying the diagram, see Creating Diagrams 119 .
Diagram window
For information about creating new diagrams, opening existing ones, and manipulating elements inside the
diagram, see the How to Model... 103 chapter.
The image below illustrates the diagram pane with four diagram windows open and positioned using the
Window | Cascade menu command.
Diagram pane
Several commands applicable to the current diagram window are available when you right-click the
corresponding window tab at the lower area of the diagram pane.
To apply miscellaneous commands to windows inside the diagram pane, use the commands available in the
Window menu. Several window manipulation commands are also available on the Window dialog box (to open
this dialog box, select the menu command Window | Windows).
To select multiple windows on the dialog box above, hold down the Ctrl key pressed and click the
corresponding entries.
The command line parameter syntax is shown below, and can be displayed in the command prompt window by
entering: umodelbatch /?
Note: If the path or file name contains spaces, enclose it in quotes, for example: "C:\Program Files\...
\MyProject.ump".
/new Specifies that the newly-created project file should be called "Fred.ump" in C:\My Projects
/set Specifies that any options used in the command line tool will be saved in the registry
(When subsequently starting UModel, these settings become the default settings).
/gui Display the UModel graphical user interface during batch processing.
/ipsd=1 Recursively process all subdirectories of the root directory specified in the /isd parameter.
The meaning of all options is the same as in the previous examples, plus:
/ibt Instructs UModel to import binary types. The asterisk before the path indicates that all
binary types at that path must be imported.
/ibrt Specifies the runtime environment ("JDK1.8.0_144" in this example). This is the same value
that appears on the "Import Binary Types" dialog box in the "Runtime" drop-down list, see
Importing Java, C# and VB.NET Binaries 198 . You can also use a value like "jdk-10.0.1" as
set in the JAVA_HOME environment variable.
For C#, you can use the value /ibrt:any or otherwise values as they appear in the GUI in
the "Runtime" drop-down list, making sure to omit any spaces. Examples:
/ibrt:any
/ibrt:.NET5
/ibrt:.NETFramework4.8(v4.8.3752)
The option "any" is the same as selecting "any (use disassembler)" from the "Runtime"
drop-down list and is the recommended option.
/new This parameter defines the path and file name of the new UModel project file (*.ump) to create.
It can also be used to load an existing project and save it under a different name, for example:
/set This parameter overwrites the current default settings in the registry with the options you
specify.
/gui This parameter displays the UModel graphical user interface (GUI) during the batch process.
The examples below illustrate how to create, load, or save projects in full batch mode (in other words, the /gui
parameter is not set).
new
UModelBatch /new=xxx.ump (options)
creates a new project, executes options, xxx.ump is always saved (regardless of options)
auto save
UModelBatch xxx.ump (options)
loads project xxx.ump, executes options, xxx.ump is saved only if document has changed (like /ibt)
save
UModelBatch xxx.ump (options) /new
loads project xxx.ump, executes options, xxx.ump is always saved (regardless of options)
save as
UModelBatch xxx.ump (options) /new=yyy.ump
loads project xxx.ump, executes options, always saves xxx.ump as yyy.ump (regardless of options)
The examples below illustrate how to create, load, or save projects in batch mode with UModel user interface
visible (the /gui parameter is set).
new
UModelBatch /gui /new (options)
creates a new project, executes options, nothing saved, the GUI is left open
save new
UModelBatch /gui /new=xxx.ump (options)
creates a new project, executes options, xxx.ump saved, the GUI is left open
user mode
UModelBatch /gui xxx.ump (options)
loads project xxx.ump, executes options, nothing saved, the GUI is left open
save
save as
UModelBatch /gui xxx.ump (options) /new=yyy.ump
loads project xxx.ump, executes options, xxx.ump is saved as yyy.ump, the GUI is left open
The project will be saved successfully provided that no critical errors occur while executing the options.
5 How to Model...
Altova website: UML modeling
This chapter provides instructions for creating and manipulating UML elements, diagrams, and relationships
from the UModel graphical user interface. It is intended as a "how to" guide to modeling with UModel. The
enclosed instructions are generic across UModel and not specific to a particular element or diagram type,
unless explicitly mentioned. For information applicable to (and grouped by) each diagram type, refer to the UML
Diagrams 288 chapter.
The information in this chapter is organized into the following categories: Elements, Diagrams, Relationships,
and Stereotypes.
Hyperlinking
Elements 113
Documenting
Elements 116
Note: UModel includes several example projects that you can explore in order to learn the modeling basics
and the graphical user interface. These can be found at the following path: C:
\Users\<username>\Documents\Altova\UModel2024\UModelExamples.
5.1 Elements
· From the Model Tree 79 window. With this approach, elements are added to the model only, and you
can insert them later into diagrams if necessary.
· From any diagram window. Any elements added to a diagram are also automatically added to the
model as well. Should you need to delete an element later, you can choose whether it should be
removed from the diagram only, or deleted from the model as well.
· In the Model Tree 79 window (or Favorites 84 window), right-click the element (for example, package)
under which you want the new element to appear, and select New Element | <Element Name> from
the context menu. For example, to add a new package under the "Root" package, right-click the
"Root" package, and select New Element | Package.
1. Create a new diagram (see Creating Diagrams 119 ) or open an existing one (see Opening Diagrams 122
).
2. Do one of the following:
a. Right-click inside the diagram and select New | <Element Name> from the context menu.
b. Click the toolbar button of the element you wish to add, and then click inside the diagram. To
insert multiple elements of the same type, hold down the Ctrl key before clicking inside the
diagram.
Packages
As you model elements, you will likely need to work with packages more often than with other elements. Each
entry marked with a folder symbol in the Model Tree window represents a UML package. Packages in
UModel serve as containers for all other UML modeling elements (including diagrams, classes, and so on) and
have the following behavior:
When you create a new UModel project, two packages are available by default, the "Root" and "Component
View" packages. These two packages are the only ones that cannot be renamed or deleted. The "Root"
package serves as starting point for modeling all other elements, while the "Component View" package is
required for code engineering.
· Drag left (holding down the left mouse button and releasing it in the diagram) inserts elements
immediately at the cursor position. In this case, any associations, dependencies etc. that exist
between the currently inserted elements and the new one, are automatically displayed.
· Drag right (holding down the right mouse button and releasing it in the diagram) opens a context
menu from which you can select the specific associations, generalizations you want to display.
For example, let's suppose that you want to create a new class diagram from a class that already exists in the
model. To illustrate this scenario, open the sample project Bank_MultiLanguage.ump available at the
following path: C:\Users\<username>\Documents\Altova\UModel2024\UModelExamples. Assuming that
you want to replicate the "Account Hierarchy" diagram in a new class diagram, do the following:
1. Right-click the bankview package and select New Diagram | Class Diagram.
2. Locate the abstract Account class in the model tree, and use drag right to place it in the new
diagram. For this example, we would like to display the class together with its derived classes. To
achieve this, select Insert with Generalization Hierarchy (specific) from the context menu.
3. Select or clear the check boxes for specific items you want to appear in the diagram.
4. Click OK. The Account class, together with its three subclasses, is inserted into the diagram. The
Generalization arrows are also automatically displayed. To automatically arrange the classes inside
the diagram, run the menu command Layout | Autolayout All | Hierarchic.
If you had selected the Insert command instead of Insert with Generalization Hierarchy (specific), the
class would have been added to the diagram without any derived classes. Note that you can still display the
generalization hierarchy later, as follows:
· Right-click the Account class in the diagram and select Show | Generalization hierarchy from the
context menu. As a result, the derived classes are inserted into the diagram as well.
To rename an element:
The procedures above apply regardless of the window in which the element is displayed, including the Model
Tree window, Properties window, and the Diagram window.
The "Root" and "Component View" packages are displayed at all times in the Model Tree window and
cannot be renamed or deleted.
· Use the standard Windows commands Cut, Copy, or Paste. These commands can be triggered from
keyboard shortcuts (Ctrl+X, Ctrl+C, Ctrl+V, respectively), from the corresponding toolbar buttons, as
well as from the Edit menu.
· Alternatively, drag an element to a destination package (or element). Dragging an element moves it.
Holding down the Ctrl key and dragging an element creates a copy of it.
For example, in a diagram, you can move a class member to another class by dragging it from the source
class to the destination class. To copy the class member rather than moving it, first select it, and then drag it
to the destination class while holding down the Ctrl key.
If you paste a class into the same package, the new class is created with a sequential number appended to
the end, for example, "MyClass1". Likewise, if you paste a property inside the same class, the new property is
created with a sequential number appended to the end, for example, "MyProperty1". The same applies for other
class members, such as operations and enumerations. The same logic is also applicable when you paste
elements in the same diagram, provided that the diagram belongs to the same package as the elements that
are being pasted.
If you paste a class into a different package, the new class will have the same name as the original class. The
same logic applies when you copy class members (such as properties, operations, and so on) to a different
class.
By default, any element that is pasted into a diagram is automatically added to the model as well (and thus is
visible in the Model Tree window). However, you can also copy and paste an element into the current diagram
only, without adding it to the model. To do this, first copy the element, right-click on the diagram, and then
select Paste in Diagram only from the context menu. The Paste in Diagram only command also appears
when you drag an existing item into the same diagram while holding the Ctrl key pressed.
In the example above, Paste will create the new class in the diagram and add it to the model as well, while
Paste in Diagram only will only display a second view of it on the diagram. Note that copies created using the
second approach are merely additional views of the original element and link to it; they are not standalone
copies. (For example, renaming a property in the duplicated class will automatically apply the same change to
the original class.)
· From the Model Tree window. Use this approach if the element should be deleted from the project as
well as any diagrams where it is present.
· Directly from diagrams where they occur. In this case, you can choose whether the element should be
removed from the diagram only, or deleted from the model (project) as well.
To delete elements from the project and all related diagrams (approach 1):
1. In the Model Tree window, click the element you want to delete. Hold the Ctrl key down to select
multiple elements.
2. Press Delete.
To delete elements from the project and all related diagrams (approach 2):
1. Open a diagram and click the element you want to delete. Hold the Ctrl key down to select multiple
elements.
2. Press Delete. A dialog box appears asking to confirm that you want to delete the element both from
the project and the diagram.
3. Click Yes. The element is deleted both from the diagram and the project.
To delete elements from the diagram but not from the project:
1. Open a diagram and click the element(s) you want to remove. Hold the Ctrl key down to select
multiple elements.
2. Hold down the Ctrl key and press Delete. The elements are deleted from the diagram but still kept in
the project.
Before you delete elements from a project, you may want to check if they are used in any diagrams.
· Right-click an element in the Model Tree, and then select Show element in all diagrams from the
context menu.
Likewise, when a diagram is open, you can quickly select an element in the Model Tree, as follows:
· Right-click the element on the diagram, and select Select in Model Tree from the context menu.
· Alternatively, click the element on the diagram and press F4.
· Class
· Interface
· Enumeration
· PrimitiveType
· DataType
83 79
You can convert the element kinds listed above either from the Diagram window or from the Model Tree .
To convert elements:
1. Open a diagram that includes classes, interfaces, enumerations, primitive types or data types (for
example, a class diagram). Alternatively, locate any of these element kinds in the Model Tree.
2. Right-click the element of interest (for example, a class) and select Convert To | <element kind>
from the context menu.
After conversion, the name of the element is preserved. If possible, the data associated with the element is also
preserved. For example, a conversion from interface to class or from class to interface preserves data such as
properties or operations. However, a conversion from a class or interface to an enumeration will result in data
loss. In such cases, if necessary, you can restore the previous state of the element by running the Undo
(Ctrl+Z) command.
· Diagram window
· Model Tree window
· Diagram Tree window
· Favorites window
· Documentation window
· Messages window
The search scope is applicable to the window where the cursor is currently placed. Therefore, if you want to
search for text inside a diagram, for example, click inside the diagram first. Likewise, if you want to search for
an item in the UModel project, click inside the Model Tree window first.
· Diagram window
· Model Tree window
· Diagram Tree window
· Favorites window
· Documentation window
· Right-click the element in the Model Tree window, and select Show element in all diagrams (or, if a
diagram is currently open, Show element in active diagram).
You can also find elements not used in any diagram either for the entire project, or for individual packages.
· On the Project menu, click List elements not used in any diagram.
· Right-click the package you would like to inspect, and select List elements not used in any
diagram.
A list of unused elements appears in the Messages window. Note that the unused elements are displayed for
the currently selected package and its subpackages. Items inside parentheses are elements which have been
configured to appear in the unused list, from Tools | Options | View tab.
Click the element name in the Messages window to locate it in the Model Tree.
1. Right-click the element you want to constrain, and select New Element | Constraints | Constraint.
2. Enter the name of constraint and press Enter.
3. Type the constraint text in the "specification" field of the Properties window (for example, name length
> 10).
3. Select the specific element you want to assign the current constraint to. Hold down the Ctrl key to
select multiple elements.
The "constrained elements" field contains the names of the modeling elements it has been assigned to. For
example, in the image above, Constraint1 has been assigned to the following properties: interestRate,
interestRateOnBalance, interestRateOnCashAdvance.
A single element can have one or more hyperlinks of any of the kinds mentioned above. In a diagram, elements
that contain hyperlinks can be easily recognized by the hyperlink icon that is visible next to them (either in
the right or left corner). To open the hyperlink target, right-click the hyperlink icon on the element and select
the target. If there is only one hyperlink defined, you can also click and access the target directly.
Tip: As you navigate through the UModel graphical user interface, either with or without hyperlinks, you can
easily go back and forward between views by clicking the Back or Forward toolbar
buttons, respectively.
You can automatically generate hyperlinks between dependent packages and diagrams when importing source
code or binary files into a model, provided that you selected the specific settings on the import dialog box. For
more information, see Importing Source Code 186 and Importing Java, C# and VB.NET Binaries 198 . Also, when
you generate UML documentation from the project, you can choose whether to include hyperlinks in the
generated output, see Generating UML documentation 277 .
You can create hyperlinks not only from elements that appear in the diagram or in the Model Tree window, but
also from text within notes, as well as text in the Documentation window, as shown in the instructions below.
1. Right-click an element on a diagram or in the Model Tree window, and select Hyperlinks | Insert/Edit
Hyperlinks from the context menu.
2. Click Add, and select a hyperlink kind (element, diagram, file, or a Web link).
· To create a Web link, type the target address in the "Address" column of the dialog box, for
example:
4. Optionally, enter a custom link name in the "User defined name" column. If defined, this custom name
will be displayed in the UModel's graphical interface instead of the target path (or address).
· Select some text inside the note, right-click it and then select Insert/Edit Hyperlinks from the context
menu. The same instructions apply for text in the Documentation window.
· Right-click the hyperlink icon on the element (or the hyperlinked text), and use the appropriate
command in the "Edit Hyperlinks" dialog box.
· Click the element (either in the diagram or in the Model Tree window).
· Enter text in the Documentation window.
When an element is selected, its documentation is visible at all times in the Documentation window, if
available. You can also display documentation as a comment on the diagram, as follows:
· Right-click the element on the diagram, and select Show | Annotating Comments from the context
menu.
Documentation hyperlinks
To create a hyperlink inside the Documentation window, select some text inside the window, right-click it and
then select Insert/Edit Hyperlinks from the context menu. The hyperlink target can be a Web site, a diagram,
a file, or another element, see also Hyperlinking Elements 113 .
Documentation window
Likewise, if you reverse engineer program code into a model, the code comments can be imported into the
model. To do this, select the check box JavaDocs as Documentation (for Java) or DocComments as
188
Documentation (for C#, VB.NET) before reverse engineering program code, see also Code Import Options .
For information about how comments in program code (or XML schemas) map to UModel comments, refer to
the mapping tables for each language:
· C# Mappings 218
· VB.NET Mappings 238
· Java Mappings 252
· XML Schema Mappings 258
If you would like to use custom images instead of conventional element representations in diagrams, this is
possible by extending your project with custom profiles and stereotypes. For more information, see Example:
Customizing Icons and Styles 413 .
b. To edit the properties of all elements of the same kind (for example, classes), select "Element
Family Styles" from the list.
c. To edit the properties of all elements globally at the project level, select "Project Styles".
d. To edit the properties of all lines in the project, including association, dependency, and realization
lines, select "Line Styles". (This value is only visible if the currently selected element is a line.)
e. To edit the properties of all elements that are not lines (the so-called "nodes") across the project,
select "Node Styles". (This value is only visible if the currently selected element is not a line.)
3. Change the value of the required property (for example, "Fill Color").
A more specific style overrides a more generic style. That is, styles applied at individual element level
override those applied at element family level. Likewise, styles applied at element family level override
those applied at project level.
When a style is overridden, a small red triangle appears in the upper-right corner of the overridden property.
Move the cursor over the triangle to display a tooltip with information about style precedence.
5.2 Diagrams
When the diagram window is active, the toolbars display only modeling elements applicable to the current
diagram kind. The diagram kind is displayed in the Properties window after you click an empty area of the
diagram. In addition to this, the following icons depict the diagram kind.
Icon Description
Activity Diagram
Class Diagram
Communication Diagram
Component Diagram
Deployment Diagram
Object Diagram
Package Diagram
Profile Diagram
Sequence Diagram
Icon Description
Timing Diagram
To generate diagrams from existing elements, right-click an element (for example, package) in the Model Tree,
and then select Show in new diagram | <option> from the context menu. Below are some examples:
· Right-click a package in the Model Tree window and select Show in new Diagram | Content from
the context menu.
· Right-click a package in the Model Tree window and select Show in new Diagram | Package
dependencies from the context menu.
1. In the Model Tree window, right-click a class which has generalization relationships to or from other
classes (for example, class Account from the sample project C:
\Users\<username>\Documents\Altova\UModel2024\UModelExamples\Bank_CSharp.ump).
2. Select Show in new diagram | Generalization hierarchy from the context menu. A dialog box
appears where you can adjust the preferences for the diagram to be created, including the diagram
type. Notice the text "N diagram-items", which displays the number of items that are to be added to
the diagram. In the example below, the chosen diagram type is "Class Diagram" and there will be four
diagram items (classes) on the diagram: the Account class and three classes derived from it.
3. Click OK. The diagram is generated according to the selected options and opens in the Diagram
window, for example:
Note: By default, diagrams are grouped by type in the Diagram Tree window. To display only diagrams
(without parent groups), right-click inside the window and clear the Group by diagram type context
menu option.
Diagrams are also displayed in the Model Tree window under the packages where they belong, for example:
· Double-click the diagram icon in the Model Tree window (or in the Diagram Tree window, or in the
Favorites window).
· Right-click the diagram, and select Open diagram from the context menu.
· In the Model Tree window (or Diagram Tree window, or Favorites window), right-click the diagram, and
then select Delete from the context menu.
· Click the diagram in any of the windows mentioned above, and then press Delete.
Deleting a diagram does not remove any elements from the project except the diagram itself. To check if
elements are used in any diagrams, right-click the package you would like to inspect, and select List
elements not used in any diagram, see also Checking Where and If Elements Are Used 111 .
108
For information about deleting elements from a diagram or from a project, see Deleting Elements .
The size of diagrams is defined by elements and their placement. To enlarge the diagram size, drag an element
to one of the diagram edges and the size will adjust accordingly.
b. To apply changes to all diagrams in the project, select "Project Styles". In this case, scroll down
to the end of the Styles window until you find the styles applicable to diagrams (that is, the ones
that begin with "Diag.").
3. Change the value of the required property (for example, "Diagram Background Color").
When a style is overridden, a small red triangle appears in the upper-right corner of the overridden property.
Move the cursor over the triangle to display a tooltip with information about style precedence.
The following diagram-specific properties are available as toolbar buttons. Changing the property in the Styles
window will update the state of the toolbar button, and vice versa.
Snap to grid When enabled, this property makes all elements adhere to the grid. When
disabled, elements are positioned regardless of the grid pattern.
1. Click an element on the diagram. A set of black dots appear at the element's edges.
2. Drag any of the black dots into the direction where you want the element to grow.
To reset the element size to its default boundaries, do one of the following:
· Click the Enable Autosize icon at the lower-right corner of the element.
· Right-click an element on the diagram, and select Autosize from the context menu.
· Select one or more elements. On the Layout menu, click Autosize.
When at least two modeling elements are selected on the diagram, they can be aligned in relation to each
other (for example, both can be aligned to have the same horizontal or vertical position, or even size). The
commands which align or resize elements are available in the Layout menu and in the Layout toolbar.
Layout toolbar
When you select several elements, the element that was selected last serves as a template for the
subsequent align or resize commands. For example, if you select three class elements and run the Make
same width command, then all three will be made as wide as the last class you selected. The element
that was selected last always appears with a dashed border.
Align left
Align right
Align top
Align bottom
Center vertically
Center horizontally
Space across This command is available when three or more elements are
selected. It distributes the horizontal space evenly between
selected elements.
Space down This command is available when three or more elements are
selected. It distributes the vertical space evenly between selected
elements.
Line up horizontally This command repositions all selected elements on the diagram
so that they are arranged horizontally one after the other.
Line up vertically This command repositions all selected elements on the diagram
so that they are arranged vertically one after the other.
You can also automatically layout all elements in the diagram, as follows:
· On the Layout menu, click Autolayout All and choose one of the following options: Force Directed,
Hierarchic, or Block.
The hierarchical layout options can be customized from the Tools | Options
menu, View tab, Autolayout Hierarchic group.
1. Right-click a class, and select New | Operation from the context menu.
2. Type the name of the operation after the double angle brackets << >>, and then type the colon ( : )
character.
3. An autocompletion window is automatically opened.
Autocompletion window
· Clicking a column name sorts the window by that attribute in ascending or descending order.
· The window can resized by dragging the bottom-right corner.
· The window contents can be filtered by clicking the respective filters (categories) at the bottom of the
window: Class, Interface, PrimitiveType, DataType, Enumeration, Class Template, Interface Template,
DataType Template.
· Click the Single mode button . The image above shows the autocompletion window in "multi-
mode", that is, all filters are enabled. The single mode button is not enabled.
· Click the Set All Categories or Clear All Categories buttons, respectively.
To disable autocompletion:
1. On the Tools menu, click Options, and then click the Diagram Editing tab.
2. Clear the Enable automatic entry helper check box.
1. Make sure that the cursor is inside an attribute or operation of a class, after the colon ( : ) character.
2. Press Ctrl+Space.
· Run the menu command View | Zoom In (Ctrl+Shift+I) or View | Zoom out (Ctrl+Shift+O).
· Select a predefined percentage value from the Zoom toolbar.
· Hold down the Ctrl key while rotating the mouse wheel.
· Run the menu command View | Fit to window (or click the Fit to window toolbar button).
5.3 Relationships
1. By using a toolbar button that depicts the relationship you need (for example, Association ).
2. By using handles that appear when you click on any element on the diagram.
The instructions below illustrate how to create an association relationship between an actor and a use case.
Use the same approach for other relationships you might need.
1. Click an element on the diagram (actor "Standard User", in the image below).
2. Click the toolbar button corresponding to the relationship you need (Association , in this example).
3. Move the mouse over "Standard User" and drag onto a target element ("get account balance" use
case). Note that the target element is highlighted in green color and accepts the relationship only when
it is meaningful according to UML specifications.
· InterfaceRealization
· Generalization
· Association
· Collection Association
To view the relationship kind that each handle creates, move the mouse over the handle. For example, in the
image below, the selected top handle can be used to create a Generalization relationship.
To create the relationship, click the handle and drag the cursor over a destination element. This creates the
corresponding relationship (Generalization, in this case).
Note: In the instructions below, it is important to distinguish between "lines" (any line on the diagram) and
"relationships" such as association, generalization, composition, and so on. All relationships are lines,
but the opposite is not true. For example, a comment or note link is just a line, not a relationship.
The values available for the "Line Style" property are also available as commands under the Layout | Line
Style menu, and as toolbar buttons. If you change this property, the corresponding toolbar button will become
enabled, and vice versa.
Orthogonal line A line with this style will only bend at straight angles.
Direct line A line with this style will make a direct connection between two elements,
without any waypoints.
Custom line A line with this style can bend at any angle. To move the line, drag any
waypoint (small black dots) on the line. To create new waypoints, click in
between two existing waypoints, and drag the line. To delete waypoints,
drag a waypoint directly on the top of an existing one.
Line styles, just like other element styles, can be set for each individual line, or at a more generic level
(project level, for example). The more specific style overrides the generic one. When a style is overridden,
this is indicated by a red triangle next to the affected property in the Styles window, see also Changing the
Style of Elements 117 .
· Click the label, and the drag it to some other position on the diagram.
· To move the label back to the default position, right-click the relationship, and select Text Labels |
Reposition Text Labels from the context menu.
· To reposition multiple labels simultaneously, select one or more relationships on the diagram, and then
run the menu command Layout | Reposition Text Labels.
· Right-click the relationship, and select Text Labels | Show/Hide all Text Labels from the context
menu.
Note: To hide relationships from the Model Tree window, right-click inside the window and clear the Show
Relations in Tree option.
To show the relationships of an element on the diagram, right-click the element on the diagram, and select
Show | <relationship kind> from the context menu.
5.3.4 Associations
An association is a conceptual connection between two elements. You can create association relationships
like any other relationship in UModel, see Creating Relationships 130 .
When you create an association between two classes, a new attribute is automatically inserted in the
originating class. For example, creating an association between Car and Engine classes adds a property of
type Engine to the Car class.
When a class is added to a diagram, its associations are shown automatically on the diagram, provided that
the following conditions are met:
· The option Automatically create Associations is enabled from Tools | Options | Diagram Editing
tab.
· The attribute's type is set (in the image above, Property1 is of type Engine)
· The class of the referenced "type" is also present in the current diagram (in the image above, the class
Engine).
You can also explicitly show the class properties of any class as associations on the diagram. To do this,
right-click a class property, and select one of the following commands:
When you click an association on the diagram, its properties can be changed, if necessary, from the
Properties window.
It is important to note the properties listed below. Modifying these properties changes the appearance of the
association on the diagram, or adds various informative text labels. For information about showing or hiding text
labels, or changing the appearance of the relationship (such as color or line thickness), see Changing the Style
131
of Lines and Relationships .
Property Purpose
A: name The name of the member on end A of the relationship. In the car example above, it
is Property1.
A: aggregation Enables you to change the type of association on end A. Changing this property
will also change the representation of the association on the diagram. Valid
values:
A: multiplicity Multiplicity specifies the number of objects at this end of the relationship. For
example, if a car has four wheels, multiplicity would be 1 on one end and 4 on the
other end of the relationship.
The same set of attributes are available for end B of the relationship.
If enabled, the property Show Assoc. Ownership in the Styles window displays ownership dots for the
selected relationship. By default, this property is set to False. The following is an example of a class where
Show Assoc. Ownership is set to True:
To rename or delete association qualifiers, use the same steps as for all other elements, see Renaming,
Moving, and Copying Elements 107 and Deleting Elements 108 .
A collection association relationship is suitable to illustrate that a class property is a collection of some
kind. For example, in the diagram below, the property colors of the class ColorBox is a list of colors. This
type is defined in this case as an enumeration; however, it may also be another class or even an interface.
Before you can create collection associations, the UModel project must contain the collection templates for the
project language you want to use (such as Java, C#, or VB.NET). Otherwise, a tooltip with the text "No
collections defined for this language" appears when you attempt to create the collection association.
If your project is UML only (without support for a specific code engineering language), you can define collection
templates from the menu Tools | Options | Diagram Editing | Collection Templates | UML tab.
If your project already contains a language namespace (such as Java, C#, VB.NET), the collection templates
are predefined from the profile of that language. Additional templates can be added from the menu Tools |
Options | Diagram Editing | Collection Templates.
The collection associations are resolved by default based on a list of built-in collection templates. To view or
modify the built-in collection templates, click Collection Templates.
To insert custom collection types, use the Append, Insert, or Delete buttons available in the dialog box
below. The column Par.Pos. denotes the position of the parameter which contains the value type of the
collection.
To reset the collection templates to their default values, click Set default.
5.3.6 Containment
A containment line is used to show, for example, parent-child relationships between two classes or two
packages.
Note that the contained class, Engine in this case, is now visible in a compartment of Car. This also places
the contained class in the same namespace as the container class.
When you import source code or binaries into the model, UModel applies stereotypes to elements
automatically, based on the structure of the original code. For example, if annotations modifiers exist in the
imported Java source code, the corresponding elements in the model get the «annotations» stereotype. For
information about how various language constructs map to UModel elements and become stereotypes in the
model, see UModel Element Mappings 218 .
You can also apply stereotypes to elements manually, while modeling them. For example, you can apply the
«attributes» stereotype to a C# class, which would indicate that the class must be decorated with attributes
in generated code. To specify the attribute values in the generated code, you can add so-called "tagged values"
in UModel, as shown in Applying Stereotypes 142 . Stereotypes are also used extensively in XML schema
modeling, to model elements such as simple types, complex types, facets, and so on.
Across the UModel graphical interface, stereotypes are displayed enclosed within guillemets (for example,
«static»). All stereotypes included into the built-in UModel profiles appear in the Properties window when you
click an element. For example, clicking a Java class in the Model Tree would display in the Properties window
only class stereotypes applicable to the Java profile (in this example, «annotations», «static», «strictfp»).
In class diagrams, stereotypes are visible above the name of the class. For example, the class below has the
«attributes» stereotype applied to it.
In case of methods or properties, stereotypes are displayed inline, like the «constructor» stereotype applied
to the Account() method in the class above.
Tagged values
A stereotype may have multiple pairs of tagged values. Also, a value can be selected from a set of enumeration
values.
You can change how tagged values are displayed on the diagram, or hide them altogether, see Showing or
144
Hiding Tagged Values . For information about changing a stereotype's tagged values, see Applying
142
Stereotypes . For an example that illustrates how to create stereotypes with tagged values, see Example:
408
Creating and Applying Stereotypes .
Before you can apply stereotypes, the corresponding profile must be applied to your package(s) first. This
is done automatically by UModel if you right-click a package and select the Code Engineering | Set as
{language} namespace root command. For more information, see Applying UModel Profiles 154 .
If you created custom profiles, these must be applied manually to the package, see Creating and Applying
Custom Profiles 404 .
1. Click the element in the Model Tree window. If the element can be extended by any stereotypes, they
appear as properties in the Properties window, enclosed within guillemets ("«" and "»").
2. Select the stereotype's check box in the Properties window (for example, «static»).
You can also apply stereotypes while designing elements inside a class diagram. To do this, click a property of
a class and start typing text inside the "<< and ">>" characters.
Some stereotypes are associated with a list of name-value pairs referred in UML as "tagged values". To apply a
stereotype with tagged values to an element, select the stereotype's check box in the Properties window (in
this example, «attributes»). This adds an indented entry where you can select the required value from a
predefined list.
Tagged values
You can also add multiple values to the same key. To do this, right-click the idented entry, and select Add
Tagged Value | <name> from the context menu.
Alternatively, you can add tagged values directly from the diagram, by right-clicking a value, and selecting New
| Tagged Value from the context menu.
1. Select a tagged values box on the diagram (one that has both empty and non-empty values).
2. Click the Toggle compact mode handle in the bottom-right corner of the box.
When the handle is in expanded state , the empty values are shown as well. When the handle is in
collapsed state , the empty values are hidden.
1. Select Project Styles from the list at the top of the Styles Window 86 .
2. Scroll down until to the Show Tagged Values property and select the required option from the list (for
example, all, hide empty).
For information about changing styles at various levels, see Changing the Style of Elements 117 .
All, hide empty Displays only those tagged values where a value
exists.
In compartment, hide empty Displays only those tagged values where a value
exists, in a compartment.
The menu commands applicable to code engineering are available in the Project menu. For example, the menu
command Project | Import Source Project enables you to import C#, or VB.NET Visual Studio solutions, or
Java code, and generate UModel diagrams based on it. When no project solution is available, use the menu
command Project | Import Source Directory, see Importing Source Code (Reverse Engineering) 186 . Java,
C#, and VB.NET binaries can also be imported, provided that a few basic prerequisites are met, see Importing
Java, C# and VB.NET Binaries 198 .
The code engineering operations above are applicable not only to programming languages but also to
databases and XML Schema. For example, you could use the menu command Project | Import XML
Schema File to reverse engineer an existing XML schema and automatically generate a class diagram based
on it.
For the list of mappings between UModel elements and elements in each supported language profile (including
databases and XML Schema), see UModel Element Mappings 218 .
UModel does not force you to follow any predetermined modeling sequence. You can add any type of model
element: UML diagram, package, actor etc., to the project in any sequence (and in any position). All model
elements can be inserted, renamed, and deleted in the Model Tree window itself, you are not even forced to
create them as part of a diagram.
Note: UModel includes several example projects that you can explore in order to learn the modeling basics
and the graphical user interface. These can be found at the following path: C:
\Users\<username>\Documents\Altova\UModel2024\UModelExamples.
· On the File menu, click New (or click the New toolbar button).
A new project with the default name NewProject1 is created. Also, the following packages are automatically
added to the project and visible in the Model Tree window.
· Root
· Component View
These two packages have special use and are the only ones that cannot be renamed, or deleted, as explained
in the tutorial, see Forward Engineering (from Model to Code) 60 .
Once the project is created, you can add modeling elements to it, such as UML packages and diagrams, see
Creating Elements 104 and Creating Diagrams 119 .
1. Right-click the package under which you want the new package to appear (either Root or Component
View in a new project).
2. Select New Element | Package from the context menu.
Be aware that packages, as well as other modeling elements, can also be added from UML diagrams, in which
case they will appear in the Model Tree window automatically.
§ Right-click the diagram, and select New Element | <Element Kind> from the context menu.
§ Drag the desired element from the toolbar.
For a worked example of how to create a project and generate program code from it, see Forward Engineering
(from Model to Code) 60 .
· On the File menu, click Open, and browse for the .ump project file.
Note: By default, UModel registers any changes made externally to the .ump project file or included file(s),
and displays a dialog box asking you to reload the project. This functionality can be disabled from the
Tools | Options | File tab.
To save a project:
All project relevant data is stored in the UModel project file, which has the extension *.ump (UModel Project
File).
Note: The *.ump file is an XML file format which can be optionally "prettified" on saving. Pretty-printing can be
enabled from the Tools | Options | File tab.
2. Enter the URL of the file in the File URL text box, and click Open.
If the server requires password authentication, you will be prompted to enter the user name and password. If
you want the user name and password to be remembered next time you start UModel, enter them in the Open
dialog box and select the Remember password between application starts check box.
If the file you are loading is not likely to change, select the Use cache/proxy option to cache data and speed
up loading the file. Otherwise, if you want the file to be reloaded each time when you open UModel, select
Reload.
For servers with Web Distributed Authoring and Versioning (WebDAV) support, you can browse files after
entering the server URL in the Server URL text box and clicking Browse.
Note: The Browse function is only available on servers which support WebDAV and on Microsoft SharePoint
Servers.
If the server is a Microsoft® SharePoint® Server, select the This is a Microsoft® SharePoint® Server check
box. Doing so displays the check-in or check-out state of the file in the preview area.
To be able to modify the file in UModel, right-click the file and select Check Out. When a file is checked out
from Microsoft® SharePoint®, saving the file in UModel sends the changes back to the server. To check in the
file back to the server, right-click the file in the dialog box above, and select Check In from the context menu
(alternatively, log on to the server and perform this operation directly from the browser). To discard the changes
made to the file since it was checked out, right-click the file, and select Undo Check Out (or perform this
operation from the browser).
· When a file is already checked out by another user, it is not available for check out.
· If you check out a file in one Altova application, you cannot check it out in another Altova application.
The file is considered to be already checked out to you.
· Select the menu option File | Save As..., and click Yes when prompted to adjust the file paths to the
new project location.
· Copy the UModel project (*.ump) to a new location, and then adjust the code generation paths for each
component involved in code generation.
For an example of the second approach, open the following sample project: C:
\Users\<username>\Documents\Altova\UModel2024\UModelExamplesBank_Multilanguage.ump.
2. In the Properties window, locate the directory property and update it to the new path.
· Profiles built into UModel (these include C#, VB.NET, Java, and so on).
· Custom profiles that you can create to extend UML to your specific domain or needs.
You can add any of the built-in profiles to your project by selecting the menu command Project | Include
Subproject. In addition, UModel prompts you to apply a built-in profile whenever you take an action that
requires that specific profile. For example, when you right-click some new package and select the Code
engineering | Set as Java Namespace Root context menu option, you are prompted to apply the Java profile
to it.
To view the full list of UModel built-in profiles or add them to your model manually, select the menu command
Project | Include Subproject. See also Including Subprojects 158 .
For instructions about creating custom profiles in order to extend or adapt UML, see Creating and Applying
Custom Profiles 404 .
You can create a subproject from nearly any package in the main project. You can choose whether the
subproject should be editable from within the main project, or be read-only. In the latter case, the subproject is
editable only if you open it as a standalone project.
Subprojects can be structured in any way that you wish, in a flat or hierarchical structure, or a combination of
both. This makes it theoretically possible to split off every package of a main project into subproject files.
In the Model Tree Window 79 , subprojects appear with the respective .ump file name displayed to the right,
enclosed within square brackets. For example, the project illustrated below includes several subprojects (this is
the Bank_MultiLanguage.ump from the C:
\Users\<username>\Documents\Altova\UModel2024\UModelExamples directory).
During the code-engineering process, all subordinate components of a subproject are considered. There is no
difference between a single project file or one that consists of multiple editable subprojects. This also applies to
UML diagrams—they can also be edited at the main, or subproject, level.
Note: You can also share packages and UML diagrams they might contain, between different projects. For
more information, see Sharing Packages and Diagrams 160 .
Creating subprojects
To create a subproject, right-click a package, and select the command Subproject | Create new Subproject
from the context menu.
Next, click Browse and select the directory where the subproject should be saved.
Select Editable to be able to edit the subproject from the main project. (Selecting Read-only makes it
uneditable in the main project.)
Note: You can change the file path of the subproject at any time by right clicking the subproject and
selecting Subproject | Edit File Path.
To open a subproject as a standalone UModel project, right-click the subproject package in the main project
and select Subproject | Open as Project. This starts another instance of UModel and opens the subproject
as a "main" project. Any unresolved references are shown in the Messages window.
Reusing subprojects
Subprojects that have been split off from a main project can be used in any other main project(s).
1. Open a project and select the menu command Project | Include Subproject.
2. Click the Browse button and select the *.ump file that you want to include.
Saving projects
When you save the main project file, all editable subproject files are also saved. You should therefore not
create/add data (components) outside of the shared/subproject structure, if the subproject is defined as
"editable" in a main project file. If data exists outside of the subproject structure, a warning message will be
displayed in the Messages window.
If "sub1" was opened as a "main" project, then it is considered as a self contained project and can be edited
without any reference to the actual main project.
1. Right-click the subproject and select Subproject | Include as Copy. This opens the "Include
Subproject" dialog box, which allows you to define the diagrams styles you want to use when including
the subproject.
2. Select the style option that you want to use, and then click OK.
To include a UModel project as a subproject of another UModel project, select the menu command Project |
Include Subproject. As illustrated below, several .ump subprojects (language profiles required for code
engineering) are available on the Basic tab. In addition, several .ump subprojects containing C#, Java, and
VB.NET types, organized by version, are available in tabs with the same name.
In order for all types to be recognized correctly during code engineering, make sure to include both the
language profile (for example, the C# profile) and the types project of the corresponding language version
(for example, .NET 5 for C# 9.0). Otherwise, an "Unknown Externals" package will be created in the
project which will include all unrecognized types.
The tabs and UModel projects (.ump files) available on the "Include Subproject" dialog box are configurable.
Namely, UModel reads this information from the following path relative to the "Program Files" folder on your
operating system: \Altova\UModel2024\UModelInclude. Note that the project files available on the Basic tab
exist directly under the UModelInclude folder, while projects in each of the Java, VB, and C# tabs exist as
subfolders of the UModelInclude folder.
· Select the menu option Project | Open Subproject Individually. The context menu displays the
currently included subprojects.
· Create a text file using the same name as the *.ump file and place in the same folder. For example,
the MyModel.ump file requires a descriptive file called MyModel.txt. Please make sure that the
encoding of this text file is UTF-8.
1. Click the included package in the Model Tree view and press the Delete key.
2. When prompted, click OK to delete the included file from the project.
Also note that subproject files can be split off a main, or subproject, file at any time. The subproject files can be
included as editable or read-only from the main project; each package is shared and saved as a subproject file.
Subprojects can be added to a source control system, see Teamwork support for UModel projects 155 .
Notes
· In order to be shareable, a package must not contain links to external elements (elements outside
of the shared scope).
· When creating UModel project files, do not use one project file as a "template/copy" for another
project file into which you intend to share a package. This will cause conflicts due to the fact that
every element should be globally unique (see uuid 435 ) and this will not be the case, as two
projects will have elements that have identical uuids.
· Right-click a package in the Model Tree window and select Subproject | Share package. A "shared"
icon appears below the shared package in the Model Tree. This package can now be included in any
other UModel project.
1. Open the project which should contain the shared package (an empty project in this example).
4. Select the required option ("Include by reference", in this example) and click OK.
The "Deployment View" package is now visible in the new package. The packages' source project is displayed
in parenthesis (SharedPackage.ump, in this example).
Notes:
· When you include a source project which contains subprojects, all subprojects of the source project
will also be included into the target project.
· Shared folders that have been included by reference can be changed to "Include by copy" at any time,
by right-clicking the folder and selecting Subproject | Include as a Copy.
Click Yes to share the package despite of the errors; otherwise, click No. The Messages window provides
information about each of the external links.
Click an entry in the Messages window to display the relevant element in the Model Tree window.
· Make sure that you are using the latest driver for your specific graphics card (resolve this before
addressing the following tips)
· Disable syntax coloring (from the Styles window, set the property Use Syntax Coloring to false).
· Disable "gradient" as a background color for diagrams, use a solid color (from the Styles window, set
the property Diagram background color to a solid color, for example, white).
· Deactivate automatic completion (go to Tools | Options | Diagram Editing and clear the check box
Enable automatic entry helper).
Code generation is also applicable to XML schemas and databases*. For example, you could design an XML
schema or a database with UModel and then generate the corresponding file (or SQL script, in case of
databases) from the model. To achieve this, consult the mapping tables to find out which schema or database
elements map to UModel elements, see UModel Element Mappings 218 .
Prerequisites
In order for code generation to be possible, the UModel project must meet the following minimum requirements:
· One of the packages in your project must be designated as namespace root. The namespace root can
be a C#, Java, VB.NET, XSD, or Database namespace. This package must contain all classes and
interfaces from which code is to be generated. For more information, see Setting a Package as
Namespace Root 164 .
· A code engineering component must be added to the project. This component must be realized by all
the classes or interfaces from which code is to be generated. For more information, see Adding a Code
Engineering Component 165 . .
In addition to this, it is recommended that you include one of the built-in UModel subprojects corresponding to
the language (or the language version) you want to use, see Including Subprojects 158 . For example, if your
application must target a specific version of C#, Java, or VB.NET, this would enable you to use the
corresponding data types while designing your UML classes, interfaces, and so on.
For a worked example of how to create a project from scratch and generate code from it, see Example:
Generate Java Code 176 .
· Right-click a package in the Model Tree Window 79 and select Code Engineering | Set as <...>
Namespace Root from the context menu, where <...> is one of the following: C#, Java, VB.NET,
XSD.
When you set a package as namespace root, UModel informs you that the UML profile of the corresponding
language will also be added to the project and applied to the selected package. Click OK to confirm when
prompted by a dialog box such as the one below.
· The component must have a physical location (directory) assigned to it. Code will be generated in this
directory.
· The classes or interfaces that take part in code engineering must be realized by the component.
· The component must have the property use for code engineering enabled.
1. Right-click a package in the Model Tree and select New Element | Component from the context
menu. This adds a new Component to the model.
2. In the model tree, click the class or interface that must be realized by the component, and then drag
and drop the cursor onto the component (in this example, Class1 from Package1 was dragged onto
Component1). This automatically creates a ComponentRealization relation in the Model Tree.
There is also an alternative approach to do this, by creating a Component diagram and then drawing a
ComponentRealization relation between the component and the classes or interfaces. For more information,
see Component Diagrams 49 .
1. Select the component in the Model Tree (it is assumed that this component is already realized by at
least one class or interface, as explained above).
2. In the Properties window, locate the directory property and set it to the path where you want to
generate code.
3. In the Properties window, select the check box use for code engineering.
For example, in the image below, the component Component1 from package Component View is configured
to generate Java 8.0 code into the directory C:\codegen:
When a syntax check is performed, the project file is checked on multiple levels as detailed in the tables
below. Note the following:
· For information about solving common syntax errors, see the Code generation prerequisites 164 .
· For components, the checks below are performed only if the use for code engineering property is
enabled for the component in the Properties window.
· For classes, interfaces, and enumerations, the checks below are performed only if the class, interface,
enumeration is contained in a code language namespace. In other words, it must be under a package
which has been defined as namespace root.
· Constraints on model elements are not checked, as they are not part of the code generation process,
see Constraining Elements 112 .
Tab Options
Java Select the check box Write Documentation as JavaDocs to convert the
documentation of UModel elements to equivalent JavaDocs-style documentation in
generated code.
SPL Templates If you want to force UModel to read SPL templates from a custom path other than
the default one, the custom path must be entered here. See also SPL
Templates 184 .
In addition to the settings above, there are a few other settings which affect code generation. To access them,
run the menu command Tools | Options, and then click the Code Engineering tab. The settings applicable to
generating code from a model are grouped under Update Program Code from UModel Project. Note that
these settings are local (they will only affect the current installation of UModel and will not be saved with the
project).
In this example, the target platform is .NET Standard 2.0 for C# 7.1. This is possible thanks to a profile built
into UModel that defines all the types of .NET Standard 2.0 for C# 7.1. UModel also includes built-in profiles for
specific .NET Framework versions. For details, see Including Subprojects 158 .
In this example, the Design View package acts as a container for the design part of your model (e.g., classes
and class diagrams), while the SampleNamespace package acts as a namespace for all classes that are to be
created. In general, you can organize your packages differently.
Code engineering
The next step is to set C# for our package. Right-click the Design View package and select Code
Engineering | Set as C# Namespace Root from the context menu. UModel will inform you that the C# profile
will be applied to the package. Click OK. The C# profile built into UModel has just been included in the project
(see screenshot below).
The additional profile has been added to the project (see below).
Create C# classes
The next step is to create classes, which you can do directly in the Model Tree pane or from a class diagram.
For this example, we have chosen the second option. Follow the steps below:
This example assumes that all your classes must be generated under the SampleNamespace namespace.
Therefore, when prompted to select an owner for the diagram, select the SampleNamespace package. If you
choose a different package, any elements that you add to the diagram will belong to the same package as the
diagram (which may or may not be the intended goal).
1. Right-click inside the pkg SampleNamespace window and select New | Class.
2. Name this class Artist.
3. Right-click inside the Artist box and create two properties: ID of type int and Name of type string.
4. Create the second class called MusicStore.
5. Create a property called LastUpdated of type DateTime.
6. Create an operation and type its name and definition as shown below.
27
For more information about designing classes and their members, see the Class Diagrams and How to
Model 103 sections.
Note: In case you forget to create a ComponentRealization relationship for a class, UModel still
generates the corresponding code file, even though warnings will be issued in the Messages window.
This setting is configurable from Tools | Options | Code Engineering tab (the Generate missing
ComponentRealizations check box).
Generate C# code
The final step is to generate the actual C# code. Take the steps below:
1. Go to the Project menu and click Merge Program Code from UModel Project. A dialog box
appears where you can adjust whether changes in code should be merged with those in the code or
overwrite them (if applicable). For the scope of this example, you can select Overwrite since a new
project is getting generated.
2. To include the class documentation as comments in the generated code, click Project | Project
Settings and select the Write Documentation as DocComments check box. For more information,
see Code Generation Options 169 .
3. Click OK. The Messages window displays the code engineering result (see below).
If you have added any documentation to the MusicStore class, notice that it appears as code comments in the
generated code:
using System;
using System.Collections.Generic;
namespace SampleNamespace
{
/// This class models a music store. It contains methods to manage assets such as
music tracks or artists.
public class MusicStore
{
public DateTime LastUpdated;
public List<Artist> CreateTestArtists()
{
// TODO add implementation
}
}
The code generation language used in this tutorial is Java; however, similar instructions are applicable for other
code generation languages.
· On the File menu, click New. (Alternatively, press Ctrl+N, or click the New toolbar button.)
At this stage, the project contains only the default "Root" and "Component View" packages. These two
packages cannot be deleted or renamed. "Root" is the top grouping level for all other packages and elements in
the project. "Component View" is required for code engineering; it typically stores one or more UML
components that will be realized by the classes or interfaces of your project; however, we didn't create any
classes yet. Therefore, let's first design the structure of our program, as follows:
1. Right-click the "Root" package in the Model Tree window and select New Element | Package from
the context menu. Rename the new package to "src".
2. Right-click "src" and select New Element | Package from the context menu. Rename the new
package to "com"
3. Right-click "com" and select New Element | Package from the context menu. Rename the new
package to "nanonull".
4. Right-click "nanonull" and select New Element | Class from the context menu. Rename the new class
to "MyClass".
All of these requirements are explained in more detail below. Note that you can always check if the project
meets all code generation requirements, by validating it:
· On the Project menu, click Check Project Syntax. (Alternatively, press F11.)
If you validate the project at this stage, the Messages window displays a validation error ("No Namespace Root
found! Please use the context menu in the Model Tree to define a Package as Namespace Root"). To resolve
this, let's assign the package "src" to be the namespace root:
· Right-click the "src" package and select Code Engineering | Set As Java Namespace Root from
the context menu.
· When prompted that the UModel Java Profile will be included, click OK.
Notice the package icon has now changed to , which signifies that this package is a Java namespace root.
Additionally, a Java Profile has been added to the project.
Notice that the icon of both "com" and "nanonull" packages has now changed to , which indicates these are
now namespaces.
Another requirement for code generation is that a component must be realized by at least a class or an
interface. In UML, a component is a piece of the system. In UModel, the component lets you specify the code
generation directory and other settings; otherwise, code generation would not be possible. If you validate the
project at this stage, a warning message is displayed in the Messages window: "MyClass has no
ComponentRealization to a Component - no code will be generated". To solve this, a component must be
added to the project, as follows:
1. Right-click "Component View" in the Model Tree window, and select New Element | Component from
the context menu.
2. Rename the new Component to "nanonull".
3. In the Properties window, change the directory property to a directory where code should be
generated (in this example, "src\com\nanonull"). Notice that the property use for code engineering
is enabled, which is another prerequisite for code generation.
4. Save the UModel project to a directory and give it a descriptive name (in this example, C:
\UModelDemo\Tutorial.ump).
Note: The code generation path can be absolute or relative to the .ump project. If it is relative as in this
example, a path such as src\com\nanonull would create all the directories in the same directory
where the UModel project was saved.
We have deliberately chosen to generate code to a path which includes the namespace name; otherwise,
warnings would occur. By default, UModel displays project validation warnings if the component is configured to
generate Java code to a directory which does not have the same name as the namespace name. In this
example, the component "nanonull" has the path "C:\UModelDemo\src\com\nanonull", so no validation
warnings will occur. If you want to enforce a similar check for C# or VB.NET, or if you want to disable the
namespace validation check for Java, do the following:
· In the Model Tree window, drag from the MyClass created previously and drop onto component
nanonull.
The component is now realized by the project's only class MyClass. Note that the approach above is just one of
the ways to create the component realization. Another way is to create it from a component diagram, as
illustrated in the tutorial section Component Diagrams 49 .
Next, it is recommended that the classes or interfaces which take part in code generation have a file name.
Otherwise, UModel will generate the corresponding file with a default file name and the Messages window will
display a warning ("code file name not set - a default name will be generated"). To remove this warning:
create the classes or interfaces. This can be done as follows (the instructions are similar for C# and VB.NET):
Generating code
Now that all prerequisites have been met, code can be generated as follows:
1. On the Project menu, click Merge Program Code from UModel Project. (Alternatively, press F12.)
Note that this command will be called Overwrite Program Code from UModel Project if the
Overwrite Code according to Model option was selected previously on the "Synchronization
Settings" dialog box illustrated below.
2. Leave the default synchronization settings as is, and click OK. A project syntax check takes place
automatically, and the Messages window informs you of the result:
package com.nanonull;
MyClass.j ava
1. On the Project menu, click Merge UModel Project from Program Code (Alternatively, press Ctrl +
F12).
2. Leave the default synchronization settings as is, and click OK. A code syntax check takes place
automatically, and the Messages window informs you of the result:
The operation sum (which has been reverse engineered from code) is now visible in the Model Tree window.
The default SPL templates are available in the UModelSPL directory relative to the program installation
directory.
Do not modify the existing default SPL templates, since these directly affect the default code generation.
Should you need to customize code generation, create custom templates instead, as shown below.
SPL templates are only used when new code is generated (that is, when new classes, operations etc have
been added to the model, and then code generation takes place). Any existing code is not affected by the SPL
templates.
1. Locate the provided SPL templates in the UModel installation directory ("Program Files"), for
example: ...\UModel2024\UModelSPL\Java\Default.
2. Copy the SPL files you want to modify into the parent directory. For example, if you want to modify
the appearance of a Java class in generated code, copy the Class.spl file from ...
\UModel2024\UModelSPL\Java\Default to ...\UModel2024\UModelSPL\Java.
3. Make the changes to the .spl file(s) and save them.
· Java projects (Eclipse .project files, NetBeans project.xml files, and JBuilder .jpx files)
· C# and VB.NET projects (Visual Studio .sln, .csproj, .csdprj, .vbproj, .vbp as well as Borland .bdsproj
project files)
In addition to importing source code from a source project, it is also possible to import code from a source
directory. Importing from a source directory works in a similar way, and is particularly useful when your code
doesn't use any of the project types listed above. For an example of importing a source directory, see Reverse
Engineering (from Code to Model) 69 .
It is possible to import source code either into a new, empty UModel project or into an existing UModel project.
During the import, you can specify whether the imported elements should overwrite those in the model (if any),
or be merged into the model. Optionally, Class and Package diagrams can be generated automatically as you
import code.
The import wizard includes various import options specific to each platform (Java, .NET). For example, if the
imported Java/C#/VB.NET code contains comments, these can be optionally converted to UModel
documentation. For a complete list of options, see Code Import Options 188 .
Once your C#, VB.NET, or Java code has been imported into UModel, it is possible to modify the model (for
example, add new classes, or rename properties and operations), and optionally synchronize it back with the
original code, thus achieving full round-trip engineering, see Synchronizing the Model and Source Code 211 .
Prerequisites
UModel includes several built-in sub-projects that were created specifically for code engineering and which
include the data types applicable to each supported language and platform. Before attempting to import source
code into a UModel project, it is recommended to include the built-in UModel subproject applicable to the
corresponding programming language and platform, see Including Subprojects 158 . Otherwise, certain data
types will not be recognized and will be placed after import into a separate package called "Unknown
externals".
· When you include a data type subproject for a particular language, UModel also automatically adds the
profile of that language to your project. The profile subproject (.ump) contains only the most basic
types and is different from the data type subproject (also .ump) which contains more extensive type
definitions.
· If you perform the import without including a data type subproject, the import operation will take place
nonetheless, and UModel will also automatically include the profile of that language to the project.
However, any unknown types will be placed into the "Unknown externals" package. To solve this, make
sure to include the data types subproject for the required language and platform, as explained above.
Most of the options on the dialog box above can also be changed at any time later, see Code Synchronization
Settings 215 .
The following options are applicable to all project types, regardless of the language or platform:
Option Description
Import proj ect relative to UModel By default, this option is selected, which means that a relative path
proj ect file dependency will be established between the UModel project and
the imported source code project.
Option Description
Merge Code into Model / Overwrite If Merge... is selected, potential name conflicts (such as package
Model according to Code or class names) will be resolved by appending a number to the
element that is being imported.
Enable diagram generation Optionally, select this check box if you want to generate Class and
Package diagrams from the imported classes. When this check
box is selected, the import wizard includes additional steps which
enable you to customize the look of the generated diagrams.
Option Description
DocComments as Select this check box to convert comments found in the C# code into
Documentation UModel element documentation (see also Documentation 90 ).
Resolve aliases This check box is enabled by default. If your C# or VB.NET code contains
namespace or class aliases like in the code listing below, it is
recommended to keep this check box selected. Otherwise, associations
and dependencies involving aliased classes and namespaces in your code
may not be detected automatically by UModel during the import (and thus
would not be present in the model).
using Q = System.Collections.Generic.Queue<String>;
Q myQueue;
During the source code import, any potentially conflicting aliases are added
to the "Unknown externals" package of the UModel project if their use is
unclear.
When you update the code back from the model (round-trip engineering),
aliases will be retained as they exist in the generated code.
The Resolve aliases option can be changed at any time later, see Code
215
Synchronization Settings . If you enable this option after (not before) the
import operation, UModel prompts you to update the project from the code
again, since the option also has consequences for forward engineering.
Option Description
Defined symbols If your C# or VB.NET code includes symbols that are defined through
preprocessor directives such as #if, #endif, you can instruct UModel to
take them into account while reverse engineering code.
#if DEBUG
static void DisplayMessage()
{
Console.WriteLine("Please wait...");
}
#endif
For example, if you reverse engineer the code above, the method
DisplayMessage() will only be imported into the model if you specified the
DEBUG symbol.
During the reverse engineering process, UModel outputs all symbols used
in the source code in the Messages window.
Option Description
JavaDocs as Documentation Select this check box to convert JavaDocs-style comments found in the
code into UModel element documentation (see also Documentation 90 ).
Our goal in this example is to reverse engineer the C# solution and create a UModel project from it. As we
import code, we will opt to generate class and package diagrams automatically.
· On the File menu, click New (Alternatively, press Ctrl + N or click the New toolbar button).
3. Select the project Microsoft .NET 4.6 for C# 6.0 (types only).ump, and click OK.
4. When prompted to select the kind of include (by reference or as a copy), leave the default option as is.
As a result, both the C# language types and the C# language profile are included and visible in the Model Tree:
8. Select the diagram generation options as shown below, and click Finish. (These options are applicable
to Package diagrams generated automatically on code import.)
9. Enter a name and select a destination folder for the new UModel project, and click Save (by default,
this dialog box displays the same folder as the solution you are importing).
The progress of the reverse engineering operation is shown in the Messages window.
Also, when code import completes, all generated diagrams are opened automatically since this option was
selected before code generation. All generated diagrams are available in the Diagram Tree:
Since we opted to generate documentation from the source code, the imported documentation is visible in the
Documentation window if you click, for example, the Create operation of the Anagram class:
Note: The documentation is added only if the option DocComments as Documentation was selected while
importing the C# solution (see "Step 3: Import the C# Solution" above).
· To import Java binary files, a supported version 11 of the Java Runtime Environment (JRE) or
Development Kit (JDK) must be installed. Type import is supported for Java .class files or .jar class
archives adhering to the Java Virtual Machine Specification. This includes Java Virtual Machines such
as OpenJDK, SapMachine, Liberica JDK, and others, see Adding Custom Java Runtimes 199 .
· To import C# or VB.NET binary files, .NET Framework, .NET Core, .NET 5, or .NET 6 must be
installed, as applicable. For best results, select the any (use disassembler) option on the import
dialog box. After import, any unrecognized types will be placed in the "Unknown externals" package.
To prevent (or decrease the number of) unknown externals, apply the UModel profile specific to the
version of your code engineering language (for example, ".NET 5 for C# 9.0") before the import. See
also Applying UModel Profiles 154 .
· The import of obfuscated binaries is not supported.
The table below lists the available approaches for importing binary types into a UModel project.
Import assembly file (.dll, .exe) Import class file archive (.jar, .zip)
Import assembly from Global Assembly Cache Import class file (.class) from a package root folder
(GAC)
Import assembly from Visual Studio .NET Import class archives from class path
References
You can import binary files by running the Project | Import Binary Types menu command. Optionally, you
can have UModel generate class and package diagrams from the imported types. For examples, see Example:
Import .NET GAC Assemblies 203 and Example: Import Java .class Files 205 .
96
In addition, you can import binary files from the command line (see UModel Command Line Interface ).
When importing binary files into a UModel project, you can specify various import options, including:
· You can import any referencing types, in addition to the types defined in the binary file. In addition, you
can restrict importing referencing types to specific Java packages and .NET namespaces.
· You can skip type members while importing. For example, you can import classes and interfaces
without their properties and methods.
· You can import types according to their accessibility modifiers (such as private or public). For
example, you can import only public classes and skip private, protected, and internal classes.
199
For reference to all options, see Import Binary Options .
5. Click OK.
The selected runtime now appears in the Runtime list, and you can select it whenever you need to import
binary files targeting that runtime.
Note that these settings affect only the import of binary files. For information about adding a Java Virtual
Machine path to be used for JDBC connectivity and Java code generation and import, see Java Virtual Machine
Settings 511 .
To import referenced types only for specific Java packages or .NET namespaces, enter those packages or
namespaces in the adjacent text box. To separate multiple packages or namespaces, use the comma, semi-
colon, or space characters.
For example, let's assume that the source .NET .dll file references types from System.Reflection and
System.Data namespaces. If you would like to import types from the System.Reflection namespace but not
from the System.Data namespace, select the option add all referenced types, optionally restricted to the
following packages and enter "System.Reflection" in the text box.
Content restriction
Select the option import only types to skip members such as fields, operations, properties, and so on.
Select the option import only elements with visibility greater than or equal to to import types and type
members according to their visibility. The table below lists visibility of types, beginning with types with least
visibility. For example, selecting "private" will import all types, whereas selecting "public" will import only public
types and type members.
Note: If the check box is not selected, all types will be imported, regardless of their visibility.
.NET Java
private private
protected protected
public public
The option suppress attribute sections is applicable for .NET binaries. By default, UModel imports the C# or
VB.NET attributes detected in the binary. Select the suppress attribute sections option if you don't want to
import attributes. Otherwise, members that were decorated with attributes in the original source code will have
the <<attributes>> stereotype applied to them after you import the binary into the model. If attributes are
imported, you can display them on the diagram as tagged values, by right-clicking the class on the diagram
and selecting Tagged Values | All from the context menu. For more information, see Stereotypes and Tagged
Values 140 .
The option suppress annotation modifiers is applicable for Java binaries. By default, UModel imports Java
annotations detected in the binary, provided that their retention policy was defined as RUNTIME (not CLASS or
SOURCE). If you don't want to import annotations, select the suppress annotation modifiers option. If
annotations are imported, members that had annotations in the original source have the <<annotations>>
stereotype, and annotations appear as tagged values, as illustrated below.
The option create only one attribute per attribute section is best illustrated by an example. Let's assume
that the original C# source code defined a method with two attributes:
using System;
using System.Diagnostics;
namespace MyNamespace
{
class Program
{
[Conditional("VERBOSE"), Conditional("TERSE")]
static void reportHeader()
{
Console.WriteLine("This is the header");
}
If the option create only one attribute per attribute section is enabled upon importing from the binary file,
then each attribute would appear on a separate line inside the "Tagged Values" element :
Finally, the option suppress 'Attribute' suffix on attribute type names removes the 'Attribute' suffix of an
attribute type. For example, if this option is selected, an attribute type defined in the original code as
System.Xml.Serialization.XmlTypeAttribute would be imported as
System.Xml.Serialization.XmlType.
1. Go the Project menu and click Import Binary Types (see screenshot below).
2. Choose the target language of the UModel project (C#, VB.NET, Java). In this example, C# is selected,
since we are importing a .NET GAC assembly.
3. If you would like to set a specific language version for the imported UModel project, select it from the
adjacent text box. In this example, C# 7.3 is selected.
4. Optionally, select a .NET runtime version from the Runtime drop-down list. The default option is any
(use disassembler). In this case, UModel will choose a reflection API that is most appropriate for the
imported binary.
5. If you import binary types into a new project, select either Merge Code into Model or Overwrite
Model according to Code.
6. Optionally, to generate class diagrams and package diagrams from the imported binary types, select
the Enable diagram generation check box. If you select this option, more diagram generation
options will be available in the next steps. See Generating Class Diagrams 391 and Generating
Package Diagrams 400 .
7. Click Next.
8. Click Add | Assembly from Global Cache (GAC) (see screenshot below). Note that the option
Assembly from Global Cache (GAC) is only available for .NET Framework 2.x-4.x. The GAC is not
relevant to .NET Core, .NET 5 and later versions. For more information, see the Microsoft
documentation. In order to import assembly files for .NET Core, .NET 5 and .NET 6, you will need to
extract the required files from the GAC. Then click Add | Assembly File (DLL/EXE), select the
assembly files manually and add them to the project.
9. Select an assembly from the dialog box. In this example, the EventViewer assembly is selected (see
screenshot below).
10. Select the types you would like to import and click Next. For more information about other options of
the Import Binary Selection dialog box, see the notes below.
11. Select the import options as applicable. For more information, see Import Binary Options 199 .
12. If you enabled diagram generation in Step 6, click Next and configure the options applicable to diagram
generation. Otherwise, click Finish.
UModel performs the conversion and displays a progress log in the Messages window. If the conversion of
binary types is not possible, the error text may provide additional information. For example, the binary file you
are trying to import is targeting a runtime newer than the one selected in the Import Binary Types dialog box.
In this case, select a newer runtime version and try again.
Notes:
· The text box Override of PATH variable... in the Import Binary Selection dialog box is applicable
only to Java. Optionally, paste here any Java class paths that must be queried in addition to those read
from the CLASSPATH environment variable. Alternatively, click Add and browse for the required folders.
· The check box use 'reflection only' context... in the Import Binary Selection dialog box is
applicable only when you import a C# or VB.NET binary. This is useful when importing a library which
has dependencies that cannot be resolved or loaded. Selecting this check box will not execute any
static initializer code, which might cause errors when importing.
1. If you haven't done that already, create a simple Java project with UModel, as shown in Example:
Generate Java Code 176 . This is a very simple example consisting of a Java package with only one
class. When you complete the example, the directory C:\UModelDemo\src will contain the required
Java source code.
2. Run Eclipse. On the File menu, click Import.
5. Right-click the com.nanonull package in Eclipse's Package Explorer and select New | Class from
the context menu.
6. Enter a class name ("MainClass", in this example), and select the public static void main... check
box.
You have now finished compiling the UModel-generated Java project. The compiled .class files should now be
available in the bin sub-directory of your project's directory.
Finally, take note of the Java version used for compilation—this is important if you intend to import binary types
later. By default, if you did not modify your Eclipse project properties, it is likely that it was compiled with the
default Java version available to Eclipse. To view the default Java version, do the following in Eclipse:
1. Create a new UModel project, or open an existing one. In this example, we are importing binary types
into a new project.
2. If your project does not contain the Java JDK types already, do the following:
Note: This is an optional step which normally prevents the "Unknown externals" package from appearing in
the project after the import is complete.
Note: The Runtime drop-down list contains only Java JDKs and JREs detected automatically. If your JDK or
JRE is not listed, select the entry Edit user java runtime locations and browse for the directory
where the respective distribution is installed on your machine, see Adding Custom Java Runtimes 199 .
6. If you import binary types into a new project, select either Merge Code into Model or Overwrite
Model according to Code. Otherwise, select Merge code into Model.
7. Optionally, to generate class diagrams and package diagrams from the imported binary types, select
the Enable diagram generation check box. If you select this option, more diagram generation
options are available in subsequent steps, see also Generating Class Diagrams 391 and Generating
Package Diagrams 400 .
8. Click Next.
9. In this example, we are importing Java .class files from a package root. Select Add | Class File
Package Root Folder. and browse for the C:\UModelDemo\bin directory. If this directory does not
exist, make sure to compile the project first, as shown in the first part of this tutorial.
11. Select the import options as applicable, see Import Binary Options 199 .
12. If you enabled diagram generation in an earlier step, click Next and configure the options applicable to
diagram generation. Otherwise, click Finish.
UModel performs the conversion and displays a progress log in the Messages window. If the conversion of
binary types is not possible, the error text may provide additional information. For example, the binary file you
are trying to import is targeting a runtime newer than the one selected in the Import Binary Types dialog box.
In this case, select a newer runtime version and try again.
When UModel (Enterprise or Professional) runs as an Eclipse or Visual Studio plug-in, synchronization
between model and code takes place automatically. Manual synchronization is possible at the project
level; the option to update individual classes or packages is not available.
When you right-click an element in the Model Tree (for example, a class), the context menu displays the code
synchronization or merging commands under the Code Engineering menu item:
*** is a Project, Package, Component, Class, and so on, depending on your current selection.
Depending on the settings you have defined from Project | Synchronization Settings, the alternative name of
these two commands may be:
To update the entire project (but not classes, packages, or other local elements), you can also use the
following commands on the Project menu of UModel:
For convenience, any of the commands listed above will be generically referred to as "code synchronization
commands" further in this topic.
· Right-click the Root package in the Model Tree, and select the required code synchronization
command.
· On the Project menu, click the required code synchronization command.
1. Use Shift, or Ctrl + Click to select the package(s) you want to merge.
2. Right-click the selection, and select the required code synchronization command.
1. Use Shift, or Ctrl + Click to select the classes(s) you want to merge.
2. Right-click the selection, and click the required code synchronization command.
To avoid undesired results when synchronizing the model and code, consider the following scenarios:
On the Project menu, click Overwrite · This checks all directories (project files) of all different code
UModel Project from Program Code. languages you have defined in your project.
· New files are identified and added to the project.
· An entry "Collecting source files in (...)" appears in the
Messages window.
Right-click a class or interface in the Model · This updates only the selected class (interface) of your
Tree and select Code Engineering | project.
Overwrite UModel Class from Program · If the source code contains classes that are new or
Code. modified classes since the last synchronization, those
changes will not be added to the model.
Right-click a Component in the Model Tree · This updates the corresponding directory (or project file)
(within the Component View package) and only.
select Code Engineering | Overwrite · New files in the directory (project file) are identified and
UModel Component from Program Code. added to the project.
· An entry "Collecting source files in (...)" appears in the
Message window.
Note: When synchronizing code, you might be prompted to update your UModel project before
synchronization. This occurs when you open UModel projects created before the latest release. Click
Yes to update your project to the latest release format, and save your project file. The notification
message will not occur once this has been done.
Renaming a classifier in the code window of your programming application causes it to be deleted and re-
inserted as new classifier in the Model Tree.
The new classifier is only re-inserted in those modeling diagrams that are automatically created during the
reverse-engineering process, or when generating a diagram using the Show in new Diagram | Content
option. The new classifier is inserted at a default position on the diagram, that will likely differ from the previous
location.
· Only one Visual Studio project file exists in the .ump project.
· Multiple Visual Studio projects exist but their classes are completely separate in the model.
Automatic ComponentRealizations are created for a Classifier that can be assigned one (and only one)
Component
The way the Component is found differs for the two cases.
Notes:
Error/Warnings:
If a class was renamed, select the previous class name using the combo box in the "Name in model" column,
e.g. C1. This ensures that all related data are retained and the code engineering process remains accurate.
E.g. You decide that you want to change the class names before generating code the second time round. As
you previously assigned a file name to each class, in the "code file name" field of the Properties window, the
new class and file name would now be out of sync.
UModel prompts if you want the code file name to agree with the new class name, when you start the
synchronization process. Note that you also have the option to change the class constructors as well.
dialog box. Associations are displayed for those elements where the attributes type is set, and the referenced
"type" modeling element is in the same diagram.
InterfaceRealizations as well as Generalizations are all automatically shown in the diagram when
updating model from code.
· When program code is generated from the model (that is, when either the command Project | Merge
Program Code from UModel Project or the command Project | Overwrite Program code from
UModel Project is run)
· When source code is imported into the model (that is, when either the command Project | Merge
UModel Project from Program Code or the command Project | Overwrite UModel Project from
Program Code is run)
· When automatic synchronization takes place in either direction (this applies to UModel Enterprise and
Professional Editions when UModel runs as a Visual Studio or Eclipse plug-in).
By default, the Synchronization Settings dialog box will be displayed automatically every time when you initiate
any of the code synchronization commands. To disable this behaviour, clear the check box Always show
dialog when synchronizing.
· Code from Model (options in this tab are applicable when program code is generated from the model)
· Model from Code (options in this tab are applicable when program code is imported into the model).
Option Description
SPL templates This option is applicable only when generating program code. Select the check box
User-defined override default check box if you have created custom Spy
Programming Language (SPL) templates that should override the default ones
supplied with UModel (see also SPL Templates 184 ).
When deleting code This option is applicable only when generating program code. Select whether
program code should be deleted or commented out during synchronization
(assuming the relevant objects no longer exist in the model).
Synchronization This option is applicable both when generating and importing program code. It lets
you specify whether changes should be merged as opposed to being overwritten.
Assuming that code has been generated once from a model, and changes have
since been made to both model and code, for example:
· The newly added class Y in the external code is deleted (or commented
out, depending on the current settings)
· The newly added class X, from UModel, is added to the code.
Project settings Opens the Project Settings dialog box, where you can modify the code engineering
settings applicable to each language. For reference to all settings, see Code Import
188 169
Options and Code Generation Options , respectively.
Option Description
The Project Settings dialog box can also be triggered from the menu command
Project | Project Settings. Note that the project settings in this dialog box are
global (they are saved together with the project and are applicable on any
workstation where the UModel project is open) whereas the options you define from
Tools | Options are local (they are applicable only to the current installation of
UModel).
· C# Mappings 218
· VB.NET Mappings 238
· Java Mappings 252
· XML Schema Mappings 258
6.6.1 C# Mappings
The table below shows the one-to-one correspondence between:
C# Project
C# UModel
Project projectfile projectfile Component
directory directory
C# Namespace
C# UModel
Namespace name name Package <<namespace>>
C# Class
C# UModel
Class name name Class
public public
protected protected
private private
sealed leaf
C# UModel
abstract abstract
static <<static>>
unsafe <<unsafe>>
partial <<partial>>
public public
protected protected
private private
static static
readonly readonly
volatile <<volatile>>
unsafe <<unsafe>>
type type
nullable <<nullable>>
C# UModel
protected internal protected <<internal>>
public public
protected protected
private private
type type
nullable <<nullable>>
public public
protected protected
private private
static static
abstract abstract
sealed leaf
override <<override>>
partial <<partial>>
virtual <<virtual>>
unsafe <<unsafe>>
C# UModel
Parameter name name
out out
params varArgList
type type
this <<this>>
nullable <<nullable>>
new () <<ConstructorConstrain
t>>
public public
protected protected
private private
static static
unsafe <<unsafe>>
out out
C# UModel
params varArgList
type type
nullable <<nullable>>
unsafe <<unsafe>>
public public
protected protected
private private
static static
abstract abstract
sealed leaf
override <<override>>
virtual <<virtual>>
unsafe <<unsafe>>
nullable <<nullable>>
C# UModel
protected protected
internal internal
protected protected
private private
protected protected
private private
static static
unsafe <<unsafe>>
type type
nullable <<nullable>>
public public
protected protected
private private
static static
abstract abstract
sealed leaf
C# UModel
override <<override>>
virtual <<virtual>>
unsafe <<unsafe>>
type type
nullable <<nullable>>
protected protected
private private
protected protected
private private
public public
protected protected
private private
static static
abstract abstract
C# UModel
sealed leaf
override <<override>>
virtual <<virtual>>
unsafe <<unsafe>>
nullable <<nullable>>
Remove Accessor
new () <<ConstructorConstraint>>
C# Struct
C# UModel
Struct name name Class
<<struct>
modifiers internal visibility package >
public public
protected protected
private private
unsafe <<unsafe>>
partial <<partial>>
C# UModel
filename code file name
public public
protected protected
private private
static static
readonly readonly
volatile <<volatile>>
unsafe <<unsafe>>
type type
nullable <<nullable>>
public public
protected protected
private private
C# UModel
type type
nullable <<nullable>>
public public
protected protected
private private
unsafe <<unsafe>>
type type
nullable <<nullable>>
public public
protected protected
private private
static static
abstract abstract
sealed leaf
C# UModel
override <<override>>
partial <<partial>>
virtual <<virtual>>
unsafe <<unsafe>>
out out
params varArgList
type type
this <<this>>
nullable <<nullable>>
new () <<ConstructorConstrain
t>>
public public
C# UModel
protected protected
private private
static static
unsafe <<unsafe>>
out out
params varArgList
type type
nullable <<nullable>>
unsafe <<unsafe>>
public public
protected protected
private private
static static
abstract abstract
sealed leaf
override <<override>>
virtual <<virtual>>
C# UModel
new <<new >>
unsafe <<unsafe>>
nullable <<nullable>>
protected protected
private private
protected protected
private private
static static
unsafe <<unsafe>>
type type
nullable <<nullable>>
C# UModel
Indexer name (="this") name (="this") Operation
<<indexer
modifiers internal visibility package >>
public public
protected protected
private private
static static
abstract abstract
sealed leaf
override <<override>>
virtual <<virtual>>
unsafe <<unsafe>>
type type
nullable <<nullable>>
protected protected
private private
protected protected
C# UModel
private private
public public
protected protected
private private
static static
abstract abstract
sealed leaf
override <<override>>
virtual <<virtual>>
unsafe <<unsafe>>
nullable <<nullable>>
Remove Accessor
new () <<ConstructorConstraint>>
attribute <<attributes>>
sections
C# Interface
C# UModel
Interface name name Interface
public public
protected protected
private private
unsafe <<unsafe>>
partial <<partial>>
unsafe <<unsafe>>
out out
params varArgList
type type
C# UModel
this <<this>>
nullable <<nullable>>
new () <<ConstructorConstrain
t>>
unsafe <<unsafe>>
nullable <<nullable>>
protected protected
private private
protected protected
private private
C# UModel
new <<new >>
unsafe <<unsafe>>
type type
nullable <<nullable>>
protected protected
private private
protected protected
private private
unsafe <<unsafe>>
nullable <<nullable>>
C# UModel
Remove Accessor
new () <<ConstructorConstraint>>
C# Delegate
C# UModel
Delegate name name Class
<<delegat
modifiers internal visibility package e>>
public public
protected protected
private private
unsafe <<unsafe>>
out out
params varArgList
type type
C# UModel
nullable <<nullable>>
class <<ReferenceTypeConst
raint>>
new () <<ConstructorConstrain
t>>
attribute <<attribute
sections s>>
C# Enum
C# UModel
Enum name name Enumeration
public public
protected protected
private private
C# UModel
doc comments Comment(-
>Documentation)
C# Parameterized Type
C# UModel
Parameterized Type Anonymous Bound Element
· UModel elements and VB.NET code elements, when outputting model to code
· VB.NET code elements and UModel model elements, when inputting code into model
VB.NET UModel
Project projectfile projectfile Componen
t
directory directory
Public public
Protected protected
Private private
NotInheritable leaf
MustInherit abstract
Partial <<Partial>>
VB.NET UModel
attribute sections <<Attributes>>
Public public
Protected protected
Private private
Shared static
ReadOnly readonly
type type
nullable <<Nullable>>
Public public
Protected protected
Private private
type type
nullable <<Nullable>>
VB.NET UModel
Method name name Operation
Public public
Protected protected
Private private
Shared static
MustOverride abstract
NotOverridable leaf
Overrides <<Overrides>>
Overridable <<Overridable>>
Partial <<Partial>>
Overloads <<Overloads>>
ByVal in
ParamArr varArgList
ay
Optional default
type type
nullable <<Nullable>>
VB.NET UModel
constraint Class <<ReferenceTypeConst
raint>>
New <<ConstructorConstrain
t>>
Public public
Protected protected
Private private
Shared static
ByVal in
ParamArr varArgList
ay
Optional default
type type
nullable <<Nullable>>
Public public
Protected protected
Private private
Shared static
VB.NET UModel
MustOverride abstract
NotOverridable leaf
Overrides <<Overrides>>
Overridable <<Overridable>>
Overloads <<Overloads>>
nullable <<Nullable>>
Protected Protected
Private Private
Protected Protected
Private Private
Shared static
VB.NET UModel
type direction return Parameter
type type
nullable <<Nullable>>
Public public
Protected protected
Private private
Shared static
MustOverride abstract
NotOverridable leaf
Overrides <<Overrides>>
Overridable <<Overridable>>
Overloads <<Overloads>>
nullable <<Nullable>>
VB.NET UModel
predefine Structure <<ValueTypeConstraint>>
d
constraint Class <<ReferenceTypeConstraint>>
New <<ConstructorConstraint>>
Public public
Protected protected
Private private
Partial <<Partial>>
Public public
Private private
Shared static
ReadOnly readonly
type type
nullable <<Nullable>>
VB.NET UModel
Constant name name Property
<<Const>
modifiers Friend visibility package >
Public public
Private private
type type
nullable <<Nullable>>
Public public
Private private
Shared static
MustOverride abstract
NotOverridable leaf
Overrides <<Overrides>>
Overridable <<Overridable>>
Partial <<Partial>>
Overloads <<Overloads>>
ByVal in
VB.NET UModel
ParamArr varArgList
ay
Optional default
type type
nullable <<Nullable>>
New <<ConstructorConstrain
t>>
Public public
Private private
Shared static
ByVal in
ParamArr varArgList
ay
Optional default
type type
nullable <<Nullable>>
VB.NET UModel
modifiers Friend visibility package y>>
Public public
Private private
Shared static
MustOverride abstract
NotOverridable leaf
Overrides <<Overrides>>
Overridable <<Overridable>>
Overloads <<Overloads>>
nullable <<Nullable>>
Shared static
VB.NET UModel
type direction return Parameter
type type
nullable <<Nullable>>
Public public
Private private
Shared static
MustOverride abstract
NotOverridable leaf
Overrides <<Overrides>>
Overridable <<Overridable>>
Overloads <<Overloads>>
nullable <<Nullable>>
VB.NET UModel
New <<ConstructorConstraint>>
Public public
Protected protected
Private private
ByVal in
ParamArr varArgList
ay
Optional default
type type
nullable <<Nullable>>
VB.NET UModel
constraint constraining classifier
New <<ConstructorConstrain
t>>
nullable <<Nullable>>
nullable <<Nullable>>
VB.NET UModel
Type name name Template
Parameter Parameter
constraint constraining classifier
New <<ConstructorConstraint>>
Public public
Protected protected
Private private
ByVal in
type type
nullable <<Nullable>>
new () <<ConstructorConstraint>>
VB.NET UModel
Enum name name Enumerati
on
modifiers Friend visibility package
Public public
Protected protected
Private private
· UModel elements and Java code elements, when outputting model to code
· Java code elements and UModel model elements, when inputting code into model
Java UModel
Project projectfile projectfile Componen
t
directory directory
Java UModel
modifiers package visibility package
public public
protected protected
private private
abstract abstract
strictfp <<strictfp>>
final <<final>>
public public
protected protected
private private
static static
transient <<transient>>
volatile <<volatile>>
final <<final>>
type type
public public
protected protected
private private
Java UModel
static static
abstract abstract
final <<final>>
native <<native>>
strictfp <<strictfp>>
synchronized <<synchronized>>
... varArgList
type type
protected protected
private private
... varArgList
type type
Java UModel
Type name name Template
Parameter Parameter
bound constraining classifier
public public
protected protected
private private
abstract abstract
strictfp <<strictfp>>
static static
final <<final>>
type type
abstract abstract
... varArgList
Java UModel
type type
public public
protected protected
private private
public public
protected protected
private private
static static
transient <<transient>>
volatile <<volatile>>
final <<final>>
type type
Java UModel
modifiers package visibility package
public public
protected protected
private private
static static
abstract abstract
final <<final>>
native <<native>>
strictfp <<strictfp>>
synchronized <<synchronized>>
... varArgList
type type
protected protected
private private
... varArgList
type type
Java UModel
type dimensions multiplicity
· UModel elements and XML Schema elements, when outputting model to code
· XML Schema elements and UModel model elements, when inputting code into model
Legend:
XSD UModel
file path projectfile Componen
t
elementFormDefault elementFormDefault
finalDefault finalDefault
version version
xml:lang xml:lang
xmlns xmlns
appinfo Comment
<<appinfo
XSD UModel
>>
document Comment
ation <<docume
ntation>>
use use
ref type
type
default default
fixed fixed
use use
default default
fixed fixed
documentation Comment
<<docume
ntation>>
XSD UModel
simpleType name (= name of Class DataType
+ <<simpleT
"_anonymousType[n]") ype>>
block block
final final
form form
nillable nillable
default default
fixed fixed
document Comment
ation <<docume
ntation>>
document Comment
ation <<docume
ntation>>
XSD UModel
annotation appinfo Comment
<<appinfo
>>
document Comment
ation <<docume
ntation>>
type
document Comment
ation <<docume
ntation>>
type
group Property
<<group>
>
processC processC
ontents ontents
choice Property
Class
<<choice>
>
sequence Property
Class
<<sequen
ce>>
XSD UModel
name (= "mg"_ + Class
"sequence") <<sequen
ce>>
annotation appinfo Comment
<<appinfo
>>
document Comment
ation <<docume
ntation>>
type
group Property
<<group>
>
processC processC
ontents ontents
choice Property
Class
<<choice>
>
sequence Property
Class
<<sequen
ce>>
public public
document Comment
ation <<docume
ntation>>
block block
XSD UModel
final final
mixed mixed
appinfo Comment
<<appinfo
>>
maxOccurs multiplicity
minOccurs
ref type
maxOccurs multiplicity
minOccurs
maxOccurs multiplicity
minOccurs
name (= Property
"_sequence[n]")
maxOccurs multiplicity
minOccurs
XSD UModel
type
simpleTyp DataType
e <<simpleType>>
XSD UModel
fixed fixed
simpleTyp DataType
e <<simpleT
ype>>
XSD UModel
minExclusi value value <<minExcl
ve usive>>
fixed fixed
type
XSD UModel
processC processC
ontents ontents
simpleTyp DataType
e <<simpleT
ype>>
simpleTyp DataType
e <<simpleT
ype>>
complexT Class
ype <<comple
xType>>
<<redefine>>
attributeGr Class
oup <<attribute
Group>>
group Class
<<group>
>
1. Open the UML file that is to be the target of the merge process, i.e. the file into which the second
model will be merged - the merged project file.
2. Select the menu option Project | Merge Project....
3. Select the second UML project that is to be merged into the first one. The Messages window reports
on the merge process, and logs the relevant details.
Note: Clicking on one of the entries in the Messages window displays that modeling element in the Model
Tree.
Merging results:
· New modeling elements i.e. those that do not exist in the source, are added to the merged model.
· Differences in the same modeling elements; the elements from the second model take precedence,
e.g. there can only be one default value of an attribute, the default value of the second file is used.
· Diagram differences: UModel first checks to see if there are differences between diagrams of the two
models. If there are, then the new/different diagram is added to the merged model (with a running
number suffix, activity1 etc.) and the original diagram is retained. If there are no differences, then
identical diagrams(s) are ignored, and nothing is changed. You can then decide which of the diagrams
you want to keep or delete, you can of course keep both of them if you want.
· The whole merge process can be undone step-by-step by clicking the Undo toolbar button, or pressing
Ctrl+Z.
· Clicking an entry in the message window displays that element in the Model Tree.
· The file name of the merged file (the first file you opened) is retained.
When merging main projects, any editable subprojects are automatically merged as well. There is no need for a
separate subproject merging process. For an example, see Example: Manual 3-Way Project Merge 270 . Note
the following:
· The whole merge process can be undone step-by-step by clicking the Undo toolbar button, or pressing
Ctrl+Z.
· Clicking an entry in the message window displays that element in the Model Tree.
· The file name of the merged file, the first file you opened, is retained.
Merging results
In the following text, "source" means the initial/first project file you open before starting the merge process.
· New modeling elements in the second file i.e. that do not exist in the source, are added to the merged
model.
· New modeling elements in the source file i.e. that do not exist in the second file, remain in the merged
model.
· Deleted modeling elements from the second file i.e. those that still exist in the source, are removed
from the merged model.
· Deleted modeling elements from the source file i.e. that still exist in the second file, remain deleted
from the merged model.
· If a property (e.g. the visibility of a class) is changed in either the source, or second file, the updated
value is used in the merged model.
· If a property (e.g. the visibility of a class) is changed in both source and second file, the value of the
second file is used (and a warning is shown in the messages window).
Moved elements:
· If an element is moved in the source, or second file, then the element is moved in the merged model.
· If an element is moved (to different parents) in both the source and second file, a prompt appears, and
you have to manually select the parent element in the merged model.
Diagram differences:
UModel first checks to see if there are differences between diagrams of the two models. If yes, then the
new/different diagram is added to the merged model (with a running number suffix, activity1 etc.) and the
original diagram is retained. If there are no differences, then identical diagrams(s) are ignored, and nothing is
changed. You can then decide which of the diagrams you want to keep or delete, you can of course keep both
of them if you want.
The specific source control system you use, determines if the automatic snapshot 3-way merge process is
supported by UModel. A manual 3-way merge is however, always possible.
· Source control systems that perform automatic file merging without user intervention, will probably not
support an automatic 3-way merge.
· Source control systems that prompt you to choose between Replace or Merge, when a project file has
been changed, will generally support a 3-way merge. After the source control plug-in has replaced the
file, selecting the Replace command activates the UModel file alert which then allows you to do a 3-
way merge. UModel must be used for the check in/out process.
· Main projects as well as subprojects can be placed under source control. Changing data in a
subproject automatically prompts you if the subproject(s) should be checked out.
· Each check in/out action, creates a Common ancestor, or a snapshot, file which is then used during
the 3-way project merge process.
Note: Snapshot files are automatically created and used only with the standalone versions of UModel, i.e.
these functions are not available in the Eclipse or Visual Studio plug-in versions.
Example
User A edits a UModel project file and changes the name of a class in the BankView Main diagram. User B
opens the same project file and changes the visibility of the same class.
As snapshot files are created for each user, the snapshot editing history allows the individual changes to be
merged into the project. Both the name and visibility changes are merged into the project file during the 3-way
merge process.
For the scope of this example, let's assume that the common ancestor file is Bank_CSharp.ump project,
available in the folder C:\Users\<username>\Documents\Altova\UModel2024\UModelExamples. The copies
of Tom and Alice must be created manually. Therefore, let's first create two copies of the Bank_Csharp.ump
project in child folders below the ...\UModelExamples folder. Let's call the child folders Alice and Tom; the
project name can remain as is.
Use the File | Save Project As command to create the copies of Tom and Alice. When prompted to
adjust the relative paths, click Yes. This way you will avoid introducing syntax errors in the project
copies.
The goal of the example is to show how Alice should merge changes not only from the original
Bank_CSharp.ump, but also from Tom's project into a new merged model (a so-called "3-way merge").
1. The operations CollectAccountInfos and GetBalanceOfAccounts are both changed from "public" to
"protected".
2. On the Project menu, click Merge Project (3-way), and select the project file changed by Tom from
Tom folder.
3. You are now prompted to open the common ancestor file. Select the original Bank_CSharp.ump
project file from the ...\UModelExamples folder.
The 3-way merge process is started and you return to the project file from which you started the 3-way merge
process, i.e. from the project file in the Alice folder. The Messages window shows you the merge process in
detail.
· The changes made to the project by Tom are replicated in Alice's project.
· The changes made to the project by Alice are retained in the project file.
Note: The project file in the Alice folder should now be used as the common ancestor file for future 3-way
merges between the project files in folders Tom and Alice.
· Class template called MyVector, with formal template parameter "T", visible in the dashed rectangle.
· Formal parameters without type info (T ) are implicitly classifiers: Class, Datatype, Enumeration,
PrimitiveType, Interface. All other parameter types must be shown explicitly e.g. Integer.
· Property myArray with unbounded number of elements of type T.
Right clicking the template and selecting Show | Bound elements, displays the actual bound
elements.
Templates can also be defined when defining properties or operations. The autocomplete function helps you
with the correct syntax when doing this.
Parameter substitution
T>aBaseClass
Substituting classifiers
T>{contract}aBaseClass
allowsSubstitutable is true
Parameter must be a classifier that may be substituted for the classifier designated by the classifier
name.
When constraining to anything other than a class, (interface, data type), the constraint is displayed
after the colon ":" character. E.g. T is constrained to an interface (T:Interface) which must be of type
"anInterface" (>anInterface).
Template parameter T must be of type "vector" which contains objects which are a supertype of
aBaseClass.
Using wildcards
Class1
Property1:vector<T->?>
Run the Project | Generate Documentation menu command to generate detailed documentation about your
UML project in HTML, Microsoft Word, RTF or PDF format. The documentation generated by this command
can be freely altered and used; permission from Altova to do so is not required.
Notes
· To generate documentation in PDF format or to customize the generated documentation, Altova
StyleVision (https://www.altova.com/stylevision) must be installed and licensed.
· To generate documentation in Microsoft Word format, Microsoft Word 2000 or later is required.
Documentation is generated for the modeling elements you select in the Generate Documentation dialog box.
You can either use the fixed design, or specify a custom StyleVision Power Stylesheet (SPS). Using a
StyleVision Power Stylesheet enables you to customize the output of the generated documentation, see
Customizing Output with StyleVision 286 .
You can also create partial documentation of modeling elements. To do this, right-click an element (or multiple
elements using Ctrl+Click) in the Model Tree and select Generate Documentation. The element can be a
folder, class, interface, and so on. The documentation options are the same in both cases.
Related elements are hyperlinked in the generated output, enabling you to navigate from component to
component. All manually created hyperlinks also appear in the documentation.
If your project contains UModel profiles (such as C#, Java, VB.NET, and so on), the generated documentation
will include these if the Included subprojects option is enabled in the Include tab, see Documentation
281
Generation Options .
To generate documentation:
The following image shows a fragment of UModel fixed-design documentation generated from the
Bank_Java.ump project file.
As illustrated above, the generated documentation includes an index of diagrams and elements (with links) at
the top of the HTML file.
The image below shows a fragment of the generated documentation for the Account class. Note that the
individual members in class diagrams are also hyperlinked to their definitions. For example, clicking a property
or operation takes you to its definition. The hierarchy classes, as well as all underlined text, are also
hyperlinked.
Main tab
The Main tab includes the general documentation generation options.
Documentation Design:
· Select Use fixed design... to use the UModel built-in documentation design.
· Select Use user-defined... to generate documentation formatted with the help of a custom StyleVision
Power Stylesheet (.sps file) created in StyleVision. Note: This option requires Altova StyleVision to be
installed, see also Customizing Output with StyleVision 286 .
· Click Browse to browse for a predefined stylesheet file.
· Click Edit to launch StyleVision and open the selected stylesheet file in a StyleVision window.
Output format:
· The output format can be one of the following: HTML, Microsoft Word, RTF, or PDF. Microsoft Word
documents are created with the .doc file extension when generated using a fixed design, and with a
.docx file extension when generated using a StyleVision Power Stylesheet. The PDF output format
requires Altova StyleVision to be installed.
· Split output to multiple files generates an output file for each modeling element (class, interface,
diagram, and so on). Clear this check box to generate one global file with all modeling elements.
· Select the Embed CSS in HTML check box to embed the generated CSS code in the HTML
documentation. Clear this check box to keep the CSS file external.
· The Embed diagrams option is enabled for the Microsoft Word and RTF output options. When this
check box is selected, diagrams are embedded in the generated file. Diagrams are created as .png
files, which are displayed in the result file via object links.
· Create folder for diagrams generates a subfolder below the selected output folder, that will contain
all diagrams.
· The Show result file after generation option is enabled for all output formats. When this check box
is selected, the main generated file is displayed in the default browser (for HTML files), in Microsoft
Word (for Word files), or in the default application (for .pdf or .rtf files).
· The Generate links to local files option allows you to specify if the generated links are to be
absolute, or relative, to the output file.
Include tab
This tab allows you to select which diagrams and modeling elements are to appear in the documentation.
To prevent subprojects or profiles from being documented, clear the Included subprojects check box. Be
aware that, if this check box is not selected, any elements or diagrams that are in subprojects will not be
included in generated documentation. Select the Predefined subprojects check box to include UModel built-
in profiles such as C# or Java profiles. Note, however, that generating documentation from predefined projects
takes a very long time. Unknown externals refers to elements whose kind could not be identified—this
usually happens after you import source code into UModel without first including the built-in subprojects for that
158
language or language version, see Including Subprojects for more information.
Details tab
This tab allows you to select the element details that are to appear in the documentation.
· If you intend to import XML tags text in your documentation, clear the as HTML option under the
Documentation option.
· The up and down fields allow you to define the nesting depth shown above or below the current class
in the hierarchy diagram.
· The expand each element only once option allows only one of the same classifiers to be expanded
in the same image or diagram.
Fonts tab
This tab allows you to customize the font settings for the various headers and text content.
To generate documentation with .sps files, Altova StyleVision must be installed and licensed.
UModel includes a predefined .sps file, which is available at the following path: C:
\users\<username\Documents\UModel2024\Documentation\UModel\UModelDocumentation.sps. To
format the generated documentation using a custom .sps file, select this option while generating
documentation, for example:
You can begin the customization by creating a copy of the default UModelDocumentation.sps and editing it
in StyleVision. For example, you can change the existing formatting or add links and images to the design.
Any StyleVision Power Stylesheet is based on an XML Schema. In case of stylesheets that control the design
of UModel-generated documentation, this schema is available at the following path: C:
\users\<username\Documents\UModel2024\Documentation\UModel\UModelDocumentation.xsd. Note
that the UModelDocumentation.xsd file references the Documentation.xsd file located in the folder above it.
When you author custom .sps files in StyleVision for UModel documentation, the UModelDocumentation.xsd
file must be used as a schema. The image below illustrates the Design Overview window of StyleVison after
you open the UModelDocumentation.sps file. Notice that it uses the UModelDocumentation.xsd schema
file, and a working XML required to preview the design. The working XML file is available in the SampleData
subfolder relative to the schema file.
For instructions about how to edit .sps files, refer to the StyleVision documentation
(https://www.altova.com/documentation).
8 UML Diagrams
Altova website: UML diagrams
There are two major groups of UML diagrams, Structural diagrams, which show the static view of the model,
and Behavioral diagrams, which show the dynamic view. UModel supports all fourteen diagrams of the UML 2.5
specification, as well as Additional diagrams.
· Behavioral diagrams 289 include Activity, State machine, Protocol State Machine and Use Case
diagrams; as well as the Interaction, Communication, Interaction Overview, Sequence, and Timing
diagrams.
· Structural diagrams 379 include: Class, Composite Structure, Component, Deployment, Object, and
Package diagrams.
· Additional diagrams 416 XML schema diagrams.
Note: The Ctrl+Enter keys can be used to create multi-line labels for most of the modeling diagrams, e.g.
Lifeline labels in sequence diagrams, timing diagrams; guard conditions, state names, activity names
etc.
Activity Diagram
State Machine Diagram
Protocol State Machine Diagram
Use Case Diagram 334
A subset of the Behavioral diagrams are those that depict the object interactions, namely:
Communication Diagram
Interaction Overview Diagram
Sequence Diagram
Timing Diagram 370
Activity diagrams are useful for modeling real-world workflows of business processes, and display which
actions need to take place and what the behavioral dependencies are. The Activity diagram describes the
specific sequencing of activities and supports both conditional and parallel processing. The Activity diagram is
a variant of the State diagram, with the states being activities.
The Activity diagram shown below is available in the Bank_MultiLanguage.ump sample, in the ...
\UModelExamples folder supplied with UModel.
To insert multiple elements of the selected type, hold down the Ctrl key and click in the diagram window.
1. Click the Action (CallBehavior) toolbar button, and click in the Activity diagram to insert it.
2. Enter the name of the Action, e.g. "Validate References", and press Enter to confirm.
1. Click the Action (CallOperation) icon in the icon bar, and click in the Activity diagram to insert
it.
2. Enter the name of the Action, e.g. "collectAccountInfo", and press Enter to confirm.
3. Click the Browse button to the right of the operation field in the Properties tab. This opens the "Select
Operation" dialog box in which you can select the specific operation.
4. Navigate to the specific operation that you want to insert, and click OK to confirm.
· branch1 has the guard "reference missing", which transitions to the abort activity
· branch2 has the guard "valid", which transitions to the collectAccountInfos activity.
1. Click the DecisionNode icon in the title bar, and insert it in the Activity diagram.
2. Click the ActivityFinalNode icon which represents the abort activity, and insert it into the
Activity diagram.
3. Click the "Validate References" activity to select it, then click the right-hand handle, ControlFlow, and
drag the resulting connector onto the "DecisionNode" element. The element is highlighted when you
can drop the connector.
4. Click the "DecisionNode" element, click the right-hand connector, ControlFlow, and drop it on the
"collectAccountInfos" action. Please see "Inserting an Action (CallOperation 291 " for more information.
5. Enter the guard condition "valid", in the guard field of the Properties tab.
6. Click the DecisionNode element and drag from the right-hand handle, ControlFlow, and drop it on the
"ActivityFinalNode" element. The guard condition on this transition is automatically defined as "else".
Double click the guard condition in the diagram to change it e.g. "reference missing".
Note: UModel does not validate, or check, the number of Control/Object Flows in a diagram.
Creating a merge
1. Click the MergeNode icon in the icon bar, then click in the Activity diagram to insert it.
2. Click the ControlFlow (ObjectFlow) handles of the actions that are to be merged, and drop the arrow(s)
on the "MergeNode" symbol.
Action (CallBehavior)
Inserts a CallBehaviorAction element which directly invokes a specific behavior. Selecting an existing
behavior using the behavior combo box, e.g. HandleDisplayException, displays a rake symbol within the
element.
Action (CallOperation)
Inserts a CallOperationAction which indirectly invokes a specific behavior as a method. Please see "Inserting
291
an action (CallOperation) " for more information.
Action (OpaqueAction)
A type of action used to specify implementation information. Can be used as a placeholder until you decide
which specific action type you want to use.
Action (ValueSpecificationAction)
A type of action that evaluates(/generates) a specific value at the output pin. (Defined by the specific properties,
e.g. upperBound.)
AcceptEventAction
Inserts the Accept Event action which waits for the occurrence of an event which meets specific conditions.
AcceptEventAction (TimeEvent)
Inserts an AcceptEventAction, triggered by a time event, which specifies an instant of time by an expression
e.g. 1 sec. since last update.
SendSignalAction
Inserts the SendSignalAction, which creates a signal from its inputs and transmits the signal to the target
object, where it may cause the execution of an activity.
DecisionNode
Inserts a Decision Node which has a single incoming transition and multiple outgoing guarded transitions.
Please see "Creating a branch 293 " for more information.
MergeNode
Inserts a Merge Node which merges multiple alternate transitions defined by the Decision Node. The Merge
Node does not synchronize concurrent processes, but selects one of the processes.
InitialNode
The beginning of the activity process. An activity can have more than one initial node.
ActivityFinalNode
The end of the activity process. An activity can have more that one final node, all flows in the activity stop when
the "first" final node is encountered.
FlowFinalNode
Inserts the Flow Final Node, which terminates a flow. The termination does not affect any other flows in the
activity.
ForkNode
Inserts a vertical Fork node. Used to divide flows into multiple concurrent flows.
ForkNode (Horizontal)
Inserts a horizontal Fork node. Used to divide flows into multiple concurrent flows.
JoinNode
Inserts a vertical Fork node. A Join node synchronizes multiple flows defined by the Fork node.
InputPin
Inserts an input pin onto a Call Behavior, or Call Operation action. Input pins supply input values that are used
by an action. A default name, "argument", is automatically assigned to an input pin.
The input pin symbol can only be placed onto those activity elements where the mouse pointer changes to the
hand symbol . Dragging the symbol repositions it on the element border.
OutputPin
Inserts an output pin action. Output pins contain output values produced by an action. A name corresponding
to the UML property of that action e.g. result, is automatically assigned to the output pin.
The output pin symbol can only be placed onto those activity elements where the mouse pointer changes to
the hand symbol . Dragging the symbol repositions it on the element border.
Exception Pin
An OutputPin can be changed to an Exception pin by clicking the pin and selecting "isExceptionPin" from the
Properties pane.
ValuePin
Inserts a Value Pin which is an input pin that provides a value to an action, that does not come from an
incoming object flow. It is displayed as an input pin symbol, and has the same properties as an input pin.
ObjectNode
Inserts an object node which is an abstract activity node that defines object flow in an activity. Object nodes
can only contain values at runtime that conform to the type of the object node.
CentralBufferNode
Inserts a Central Buffer Node which acts as a buffer for multiple in- and out flows from other object nodes.
DataStoreNode
Inserts a Data Store Node which is a special "Central Buffer Node" used to store persistent (i.e. non transient)
data.
ActivityPartition (horizontal)
Inserts a horizontal Activity Partition, which is a type of activity group used to identify actions that have some
characteristic in common. This often corresponds to organizational units in a business model.
Double clicking a label allows you to edit it directly; pressing Enter orients the text correctly.
Please note that Activity Partitions are the UML 2.0 update to the "swimlane" functionality of previous UML
versions.
· Elements placed within a ActivityPartition become part of it when the boundary is highlighted.
· Objects within an ActivityPartition can be individually selected using Ctrl+Click, or by dragging the
marquee inside the boundary.
· Click the ActivityPartition boundary, or title, and drag to reposition it.
ActivityPartition (vertical)
Inserts a vertical Activity Partition, which is a type of activity group used to identify actions that have some
characteristic in common. This often corresponds to organizational units in a business model.
ActivityPartition (2 Dimensional)
Inserts a two dimensional Activity Partition, which is a type of activity group used to identify actions that have
some characteristic in common. Both axes have editable labels.
1. Right click the label where you want to insert a new partition.
2. Select New | ActivityPartition.
ControlFlow
A Control Flow is an edge, i.e. an arrowed line, that connects two activities/behaviours, and starts an activity
after the previous one has been completed.
ObjectFlow
A Object Flow is an edge, i.e. an arrowed line, that connects two actions/object nodes, and starts an activity
after the previous one has been completed. Objects or data can be passed along an Object Flow.
ExceptionHandler
An Exception Handler is an element that specifies what action is to be executed if a specified exception occurs
during the execution of the protected node.
Activity
Inserts an Activity into the activity diagram.
ActivityParameterNode
Inserts an Activity Parameter node onto an activity. Clicking anywhere in the activity places the parameter node
on the activity boundary.
StructuredActivityNode
Inserts a Structured Activity Node which is a structured part of the activity, that is not shared with any other
structured node.
ExpansionRegion
An expansion region is a region of an activity having explicit input and outputs (using ExpansionNodes). Each
input is a collection of values.
The expansion region mode is displayed as a keyword, and can be changed by clicking the "mode" combo box
in the Properties tab. Available settings are:parallel, iterative, or stream.
ExpansionNode
Inserts an Expansion Node onto an Expansion Region. Expansion nodes are input and output nodes for the
Expansion Region, where each input/output is a collection of values. The arrows into, or out of, the expansion
region, determine the specific type of expansion node.
InterruptableActivityRegion
An interruptible region contains activity nodes. When a control flow leaves an interruptible region all flows and
behaviors in the region are terminated.
1. Make sure that an Action element is present in the InterruptableActivityRegion, as well as an outgoing
Control Flow to another action:
2. Right click the Control Flow arrow, and select New | InterruptingEdge.
Note: You can also add an InterrupingEdge by clicking the InterruptableActivityRegion, right clicking in the
Properties window, and selecting Add InterruptingEdge from the pop-up menu.
1. Actions, which are associated to transitions, are short-term processes that cannot be interrupted (for
example, internal error /notify admin in the diagram below)
2. State Activities (behaviors), which are associated to states, are longer-term processes that may be
interrupted by other events (for example, listen for incoming connections, in the diagram below).
A state machine can have any number of State Machine Diagrams (or State Diagrams) in UModel.
The State machine diagram illustrated above is available in the following sample UModel project: C:
\Users\<username>\Documents\Altova\UModel2024\UModelExamples\Bank_MultiLanguage.ump.
1. Click the specific state machine diagram icon in the State Machine Diagram toolbar.
2. Click in the State Diagram to insert the element. To insert multiple elements of the selected type, hold
down the Ctrl key and click in the diagram window.
1. Locate the element you want to insert in the Model Tree tab (you can use the search function text
box, or press Ctrl+F to search for any element).
2. Drag the element(s) into the state diagram.
1. Click the State toolbar icon ( ) , and then click inside the diagram.
2. Enter the name of the state and press Enter to confirm.
· Right-click the state element, select New, and then one of the entries from the context menu.
The Entry, Exit, and Do activities are associated with one of the following possible behaviors: "Activity",
"Interaction", and "StateMachine". Therefore, the options available in the context menu are:
· Do: Activity
· Do: Interaction
· Do: StateMachine
· Entry: Activity
· Entry: Interaction
· Entry: StateMachine
· Exit: Activity
· Exit: Interaction
· Exit: StateMachine
These options originate in the UML specification. Namely, each of these internal actions are behaviors, and, in
the UML specification, three classes derive from the "Behavior" class: Activity, StateMachine, and Interaction.
In the generated code, it does not make a difference which particular behavior (Activity, StateMachine, or
Interaction) has been selected.
You can select one action from the Do, Entry and Exit action categories. Activities are placed in their own
compartment in the state element, though not in a separate region. The type of activity that you select is used
as a prefix for the activity e.g. entry / store current time.
To delete an activity:
· Click the respective activity in the state element and press the Del key.
1. Click the Transition handle of the source state (on the right of the element).
2. Drag-and-drop the transition arrow onto the target state.
The Transition properties are now visible in the Properties tab. Clicking the "kind" combo box, allows
you to define the transition type: external, internal or local.
Transitions can have an event trigger, a guard condition and an action in the form eventTrigger [guard
condition] /activity.
Activating the "Toggle automatic creation of operations in target by typing operation names" icon ,
automatically creates the corresponding operation in the referenced class, when creating a transition and
entering a name e.g. myOperation().
Note: Operations can only be created automatically when the state machine is inside a class or interface.
1. Right click the State and select the specific action/activity, e.g. New | Entry:Activity.
2. Enter the name of the activity making sure to finish with the open/close brackets "()", e.g. entry /
OnEntryCooler().
The new element is also visible in the Model Tree. Scrolling down the Model Tree, you will notice that
the OnEntryCooler operation has been added to the parent class AirConditionController.
Note: Operations are automatically added for: Do:Activity, Entry:Activity, Exit:Activity, as well as guard
condition activities and effects (on transitions).
An "a" character appears in the transition label above the transition arrow, if it is the first trigger in the
state diagram. Triggers are assigned default values of the form alphabetic letter, source state -> target
state.
3. Double-click the new character and enter the transition properties in the form eventTrigger [guard
condition] / activity.
Note: To see the individual transition properties, right-click the transition (arrow) and select "Select in Model
Tree". The event, activity and constraint elements are all shown below the selected transition.
1. Right-click a transition arrow in the diagram, and select New | Activity Diagram. This inserts an
Activity diagram window into the diagram at the position of the transition arrow.
2. Click the inserted window to make it active. You can now use the scroll bars to scroll within the
window.
3. Double-click the Action window to switch into the Activity diagram and further define the transition, e.g.
change the Action name to "Database logon". Note that a new Activity Diagram tab has now been
added to the project. You can add any activity modeling elements to the diagram, please see "Activity
Diagram 289 " for more information.
4. Click the State Machine Diagram tab to switch back to see the updated transition.
5. Drag the Activity window to reposition it in the diagram, and click the resize handle if necessary.
Dragging the Activity window between the two states displays the transition in and out of the activity.
Composite state
This type of state contains a second compartment comprised of a single region. Any number of states may be
placed within this region.
· Right-click the composite state and select New | Region from the context menu. A new region is
added to the state. Regions are divided by dashed lines.
To delete a region:
· Click the region you want to delete in the composite state and press the Del key.
Deleting a region of an orthogonal state reverts it back to a composite state; deleting the last region of a
composite state changes it back to a simple state.
· Click the state element you want to insert (e.g. Logging in User), and drop it into the region
compartment of the composite state.
The region compartment is highlighted when you can drop the element. The inserted element is now
part of the region, and appears as a child element of the region in the Model Tree pane.
Moving the composite state moves all contained states along with it.
Orthogonal state
This type of state contains a second compartment comprised of two or more regions, where the separate
regions indicate concurrency.
Right clicking a state and selecting New | Region allows you add new regions.
· Click the Styles tab, scroll to the "Show region names on states" entry, and select true/false.
Submachine state
This state is used to hide details of a state machine. This state does not have any regions but is associated to
a separate state machine.
1. Having selected a state, click the submachine combo box in the Properties tab. A list containing the
currently defined state machines appears.
2. Select the state machine that you want this submachine to reference.
A hyperlink icon automatically appears in the submachine. Clicking it opens the referenced state
machine, "BankServer" in this case.
· The state which the point is connected to, must itself reference a submachine State Machine (visible in
the Properties tab).
· This submachine must contain one or more Entry and Exit points
1. Click the ConnectionPointReference icon in the title bar, then click the submachine state that
you want to add the entry/exit point to.
2. Right-click in the Properties tab and select Add entry. Please note that another Entry, or Exit Point
has to exist elsewhere in the diagram to enable this pop-up menu.
This adds an EntryPoint row to the Properties tab, and changes the appearance of the
ConnectionPointReference element.
3. Use the same method to insert an ExitPoint, by selecting "Add exit" from the context menu.
· State
· CompositeState, with any hierarchical level
· OrthogonalState, with any number of regions
· Region
· InitialState
· FinalState
· Transition
· Guard
· Trigger
· Call-Event
· Fork
· Join
· Choice
· Junction
· DeepHistory
· ShallowHistory
· Entry/exit/do actions
· Effects
State Machine code generation is integrated into the "normal" round-trip engineering process. This means that
State Machine code can be automatically updated on every forward-engineering process.
The screenshot above shows the AirCondition State Machine diagram which is available in the ..
\StateMachineCodeGeneration directory under ...\UModelExamples. A separate directory exists for each
of the code generation languages supported by UModel.
Each directory contains an AirCondition and Complex folder, which contains the respective UModel project,
programming language project files, as well as the generated source files. The Complex.ump project file
contains almost all of the modeling elements and functionality that UModel supports when generating code
from State Machine diagrams.
Each directory also contains a test application, e.g. TestSTMAirCondition.sln for C#, allowing you to work with
the generated source files immediately.
· Right-click in the State Machine diagram and select "Generate State Machine code", or
· Select the menu option Project | Generate State Machine Code
The default settings are shown above. Click OK to generate the code.
State Machine code is automatically updated when you start the forward engineering process. You can
however change this setting by clicking on the State Machine diagram background and clicking the "Automatic
Update Code" check box.
Changes should not be made manually in the generated code, as these changes are not reflected in the State
Machine diagram during the reverse-engineering process.
Clicking the icon of the Automatic Update field, opens the Generate State Machine Code dialog box,
allowing you to change the code generation settings.
· Right-click the diagram and selecting Check State Machine Syntax from the context menu.
The controller class provides methods which can be used from "outside" to change the states (e.g. after
external events occur).
The state machine implementation however, calls controller class methods ("callbacks") to inform the state
machine user about state changes (OnEntry, OnExit, ...), transition effects, and the possibility to override and
implement methods for conditions (guards).
UModel can automatically create simple operations (without any parameter) for entry/exit/do behaviors,
transition effects, ... when the corresponding option is turned on (also see Creating states, activities and
transitions 308 ). These methods can be changed to whatever you want in UModel (add parameters, set them as
abstract, etc.).
A state machine (i.e. its controller class) can be instantiated several times. All instances work independently of
each other.
· The UML State machine execution is designed for the "Run-to-completion execution model".
· UML state machines assume that processing of each event is completed before the next event is
processed.
· This also means no entry/exit/do action or transition effect may directly trigger a new transition/state
change.
Initialization
· Every region of a state machine has to have an initial state.
· The code generated by UModel automatically initializes all regions of the state machine (or when the
Initialize() method of the controller class is called).
· If OnEntry events are not wanted during initialization, you can call the Initialize() method manually
and ignore OnEntry events during the startup.
The AirCondition.ump example shows how to walk through the regions to the current state(s):
Notes:
· The state machine user should call the generated method "MyEvent1" when the corresponding event
occurs (outside the state machine).
· The return parameter of these event-methods provides information about whether the event caused a
state change (i.e. if it had any effect on the state machine) or not. For example, if "State1" is active
and event "MyEvent1()" occurs, the current state changes to "State2" and "MyEvent1()" returns true. If
"State2" is active and "MyEvent1()" occurs, nothing changes in the state machine and MyEvent1()
returns false.
Notes:
· "OnState1State2Effect()" will be called by the state machine implementation, whenever the transition
between "State1" and "State2" is fired.
· To react to this effect, "OnState1State2Effect()" should be overridden in a derived class of
"CTestStateMachine".
· "CTestStateMachine:: OnState1State2Effect()" can also be set to abstract, and you will get compiler
errors until the method is overridden.
· When "OnState1State2Effect()" is not abstract, and the "Generate debug messages" option is active,
UModel will generate following debug output:
Notes:
· To effect operations (automatically created by UModel) parameters can be added manually (UModel
cannot know the required type).
· In this sample, the parameter "text:String" has been added to the Effect method in TestController. A
proper argument has to be specified when calling this method (here: "1 => 2").
· Another possibility would be: e.g. to call static methods ("MyStatic.OnState1State2Effect("1 => 2")"),
or methods of singletons ("getSingleton().OnState1State2Effect("1 => 2")").
Notes:
· States can have entry/exit/do behaviors. UModel automatically creates the corresponding operations to
handle them.
· When "MyEvent2()" occurs in the sample above, the state machine implementation calls
"OnExitState3()". If "MyEvent2" would have an Effect, it would be subsequently called, then
"OnEntryState4" and "OnDoState4" would be called.
· Normally, these methods should be overridden. When they are not abstract and the "Generate debug
messages" option is active, UModel provides default debug output as described in Example 2.
· These methods can also have parameters as shown in Example 3.
Example 5 - guards
Transitions can have guards, which determine if the transition really can fire.
Notes:
· If "State5" is the active state and "MyEvent2" occurs, the state machine implementation will call
"CanGoState6" and, depending on its result, the transition will fire or not.
· Normally, these methods should be overridden. When they are not abstract and the "Generate debug
messages" option is active, UModel provides default debug output as described in Example 2.
· These methods also can have parameters as shown in Example 3.
· Multiple transitions with the same event, but having different guards, are possible. The order in which
the different guards are polled is undefined. If a transition does not have a guard, or the guard is "else",
it will be considered as the last (i.e., only when all other transition guards return false, will this one will
fire). For example, in the diagram below, it is undefined whether CanGoState6() or CanGoState7() is
called first. The third transition will only fire if CanGoState6() and CanGoState7() return false.
Additional constructs and functionality can be found in the AirCondition.ump and Complex.ump samples.
InitialState (pseudostate)
The beginning of the process.
FinalState
The end of the sequence of processes.
EntryPoint (pseudostate)
The entry point of a state machine or composite state.
ExitPoint (pseudostate)
The exit point of a state machine or composite state.
Choice
This represents a dynamic conditional branch, where mutually exclusive guard triggers are evaluated (OR
operation).
Junction (pseudostate)
This represents an end to the OR operation defined by the Choice element.
Terminate (pseudostate)
The halting of the execution of the state machine.
Fork (pseudostate)
Inserts a vertical Fork bar. Used to divide sequences into concurrent subsequences.
Join (pseudostate)
Joins/merges previously defined subsequences. All activities have to be completed before progress can
continue.
DeepHistory
A pseudostate that restores the previously active state within a composite state.
ShallowHistory
A pseudostate that restores the initial state of a composite state. All pseudostate elements can be changed to
a different "type", by changing the kind combo box entry in the Properties tab.
ConnectionPointReference
A connection point reference represents a usage (as part of a submachine state) of an entry/exit point defined
in the state machine reference by the submachine state.
· The state which the point is connected to, must itself reference a submachine State Machine (visible in
the Properties tab).
· This submachine must contain one or more Entry and Exit points
Transition
A direct relationship between two states. An object in the first state performs one or more actions and then
enters the second state depending on an event and the fulfillment of any guard conditions. Transitions have an
event trigger, guard condition(s), an action (behavior), and a target state. The supported event subelements are:
· ReceiveSignalEvent
· SignalEvent
· SendSignalEvent
· ReceiveOperationEvent
· SendOperationEvent
· ChangeEvent.
Note: Operations can only be created automatically when the state machine is inside a class or interface.
Protocol State Machines are used to show a sequence of events that an object responds to, without having to
show the specific behavior. The required sequence of events, and the resulting changes in the state of the
object, are modeled in this diagram.
Protocol State Machines are most often used to describe complex protocols, e.g. database access through a
specific interface, or communication protocols such as TCP/IP.
Protocol State Machines are created in the same way as State Machine diagrams, but have fewer modeling
elements. Protocol-Transitions between states can have pre- or post conditions which define what must be true
for a transition to another state to occur, or what the resulting state must be, once the transition has taken
place.
1. Locate the element you want to insert in the Model Tree tab (you can use the search function text
box, or press Ctrl+F to search for any element).
2. Drag the element(s) into the Protocol State Machine diagram.
1. Click the State icon in the icon bar and click in the Protocol State Machine diagram to insert it.
2. Enter the name of the state and press Enter to confirm. Simple states do not have any regions or any
other type of substructure.
1. Click the Transition handle of the source state (on the right of the element), or use the Protocol
Transition icon in the icon bar.
2. Drag-and-drop the transition arrow onto the target state. The text cursor is automatically set for you to
enter the pre and/or post condition. Please make sure to use the square brackets [] and slash
character when entering the conditions directly.
Entering the pre/post conditions in the Properties window automatically inserts the square brackets
and slash character into the diagram.
For information about how to create and insert composite state elements and submachine states, see
Composite states 315
State
A simple state element with one compartment.
Composite state
This type of state contains a second compartment comprised of a single region. Any number of states may be
placed within this region.
Orthogonal state
This type of state contains a second compartment comprised of two or more regions, where the separate
regions indicate concurrency. Right clicking a state and selecting New | Region allows you add new regions.
Submachine state
This state is used to hide details of a state machine. This state does not have any regions but is associated to
a separate state machine.
InitialState (pseudostate)
The beginning of the process.
FinalState
The end of the sequence of processes.
EntryPoint (pseudostate)
The entry point of a state machine or composite state.
ExitPoint (pseudostate)
The exit point of a state machine or composite state.
Choice
This represents a dynamic conditional branch, where mutually exclusive guard triggers are evaluated (OR
operation).
Junction (pseudostate)
This represents an end to the OR operation defined by the Choice element.
Terminate (pseudostate)
The halting of the execution of the state machine.
Fork (pseudostate)
Inserts a vertical Fork bar. Used to divide sequences into concurrent subsequences.
Join (pseudostate)
Joins/merges previously defined subsequences. All activities have to be completed before progress can
continue.
ConnectionPointReference
A connection point reference represents a usage (as part of a submachine state) of an entry/exit point defined
in the state machine reference by the submachine state.
· The state which the point is connected to, must itself reference a submachine State Machine (visible in
the Properties tab).
· This submachine must contain one or more Entry and Exit points
Protocol Transition
A direct relationship between two states. An object in the first state performs one or more operations and then
enters the second state depending on an event and the fulfillment of any pre- or post conditions.
331
Please see Inserting Protocol State Machine elements for more information.
Communication diagrams display the interactions i.e. message flows, between objects at run-time, and show
the relationships between the interacting objects. Basically, they model the dynamic behavior of use cases.
Communication diagrams are designed in the same way as sequence diagrams, except that the notation is laid
out in a different format. Message numbering is used to indicate message sequence and nesting.
UModel allows you to generate Communication diagrams from Sequence diagrams and vice versa, in one
simple action see "Generating Sequence diagrams 337 " for more information.
2. Click in the Communication diagram to insert the element. To insert multiple elements of the selected
type, hold down the Ctrl key and click in the diagram window.
1. Locate the element you want to insert in the Model Tree tab (you can use the search function text
box, or press Ctrl+F to search for any element).
2. Drag the element(s) into the Communication diagram.
Lifeline
The lifeline element is an individual participant in an interaction. UModel allows you to insert other elements into
the sequence diagram, e.g. classes. Each of these elements then appear as a new lifeline. You can redefine
the lifeline colors/gradient using the "Header Gradient" combo boxes in the Styles tab.
1. Click the Lifeline icon in the title bar, then click in the Communication diagram to insert it.
2. Enter the lifeline name to change it from the default name, Lifeline1, if necessary.
Messages
A Message is a modeling element that defines a specific kind of communication in an interaction. A
communication can be e.g. raising a signal, invoking an Operation, creating or destroying an instance. The
message specifies the type of communication as well as the sender and the receiver.
Message (Call)
Message (Reply)
Message (Creation)
Message (Destruction)
To insert a message:
Note: Holding down the Ctrl key allows you to insert a message with each click.
· The direction in which you drag the arrow defines the message direction. Reply messages can point in
either direction.
· Having clicked a message icon and holding down Ctrl allows you to insert multiple messages by
repeatedly clicking and dragging in the diagram tab.
Message numbering
The Communication diagram uses the decimal numbering notation, which makes it easy to see the hierarchical
structure of the messages in the diagram. The sequence is a dot-separated list of sequence numbers followed
by a colon and the message name.
· Right-click anywhere in a Communication diagram and select Generate Sequence Diagram from the
context menu.
Interaction Overview Diagrams are a variant of Activity diagrams and give an overview of the interaction between
other interaction diagrams such as Sequence, Activity, Communication, or Timing diagrams. The method of
constructing a diagram is similar to that of Activity diagram and uses the same modeling elements: start/end
points, forks, joins etc.
Two types of interaction elements are used instead of activity elements: Interaction elements and Interaction
use elements.
Interaction elements are displayed as iconized versions of a Sequence, Communication, Timing, or Interaction
Overview diagram, enclosed in a frame with the "SD" keyword displayed in the top-left frame title space.
Interaction occurrence elements are references to existing Interaction diagrams with "Ref" enclosed in the
frame's title space, and the occurrence's name in the frame.
2. Click in the diagram to insert the element. To insert multiple elements of the selected type, hold down
the Ctrl key and click in the diagram window.
1. Locate the element you want to insert in the Model Tree tab (you can use the search function text box,
or press Ctrl+F, to search for any element).
2. Drag the element(s) into the diagram.
1. Click the CallBehaviorAction (Interaction) icon in the icon bar, and click in the Interaction
Overview diagram to insert it.
The Collect Account Information sequence diagram is automatically inserted if you are using the
Bank_Multilanguage.ump example file from the ...\UModelExamples folder. The first sequence
diagram, found in the model tree, is selected by default.
2. To change the default interaction element: Click the behavior/diagram combo box in the Properties
tab. A list of all the possible elements that can be inserted is presented.
As this is also a sequence diagram, the Interaction element appears as an iconized version of the
sequence diagram.
If you select <ref> BankAPI, then the Interaction element occurrence is displayed.
1. Click the CallBehaviorAction (InteractionUse) icon in the icon bar, and click in the Interaction
Overview diagram to insert it.
Collect Account Information is automatically inserted as a Interaction occurrence element, if you are
using the Bank_Multilanguage.ump example file from the ...\UModelExamples folder. The first
existing sequence diagram is selected per default.
2. To change the Interaction element, double-click the behavior combo box in the Properties tab. A list
of all the possible elements that can be inserted is presented.
3. Select the occurrence you want to insert.
Note: All elements inserted using this method appear in the form shown in the screenshot above i.e. with
"ref" in the frame's title space.
DecisionNode
Inserts a Decision Node which has a single incoming transition and multiple outgoing guarded transitions.
Please see "Creating a branch 293 " for more information.
MergeNode
Inserts a Merge Node which merges multiple alternate transitions defined by the Decision Node. The Merge
Node does not synchronize concurrent processes, but selects one of the processes.
InitialNode
The beginning of the activity process. An interaction can have more than one initial node.
ActivityFinalNode
The end of the interaction process. An interaction can have more that one final node, all flows stop when the
"first" final node is encountered.
ForkNode
Inserts a vertical Fork node. Used to divide flows into multiple concurrent flows.
ForkNode (Horizontal)
Inserts a horizontal Fork node. Used to divide flows into multiple concurrent flows.
JoinNode
Inserts a vertical Fork node. A Join node synchronizes multiple flows defined by the Fork node.
AddDurationConstraint
A Duration defines a ValueSpecification that denotes a duration in time between a start and endpoint. A
duration is often an expression representing the number of clock ticks, which may elapse during this duration.
ControlFlow
A Control Flow is an edge, i.e. an arrowed line, that connects two behaviours, and starts an interaction after the
previous one has been completed.
UModel supports the standard Sequence diagram defined by UML, and allows easy manipulation of objects
and messages to model use case scenarios. The sequence diagrams shown in the following sections are
available in the Bank_Java.ump, Bank_CSharp.ump and Bank_MultiLanguage.ump samples, in the ...
\UModelExamples folder supplied with UModel.
You can model sequence diagrams manually, or, alternatively, generate them from reverse-engineered source
358
code, as described in Generating Sequence Diagrams from Source Code .
· Lifelines are the horizontally aligned boxes at the top of the diagram, together with a dashed vertical
line representing the object's life during the interaction. Messages are shown as arrows between the
lifelines of two or more objects.
· Messages are sent between sender and receiver objects, and are shown as labeled arrows. Messages
can have a sequence number and various other optional attributes: argument list etc. Conditional,
optional, and alternative messages are all supported.
See also:
· Lifeline 346
· Combined Fragment 348
Sequence diagram and other UModel elements, can be inserted into a sequence diagram using several
methods.
1. Locate the element you want to insert in the Model Tree tab (you can use the search function text
box, or press Ctrl+F to search for any element).
2. Drag the element(s) into the sequence diagram.
8.1.7.1.1 Lifeline
The lifeline element is an individual participant in an interaction. UModel also allows you to insert other
elements into the sequence diagram, e.g. classes and actors. Each of these elements appear as a new lifeline
once they have been dragged into the diagram pane from the Model Tree tab.
The "lifeline" label appears in a bar at the top of the sequence diagram. Labels can be repositioned and resized
in the bar, with changes taking immediate effect in the diagram tab. You can also redefine the label
colors/gradient using the "Header Gradient" combo boxes in the Styles tab.
Most classifier types can be inserted into the sequence diagram. The "represents" field in the Properties tab
displays the element type that is acting as the lifeline. Dragging typed properties onto a sequence diagram
also creates a lifeline.
A recursive, or self message (one that calls a different method in the same class) creates stacked activation
boxes.
· Click the Styles tab and scroll to the bottom of the list.
The "Show Execution Specifications" combo box allows you to show/hide the activation boxes in the
sequence diagram.
Lifeline attributes
The destruction check box allows you to add a destruction marker, or stop, to the lifeline without having to use
a destruction message.
The selector field allows you to enter an expression that specifies the particular part represented by the lifeline,
if the ConnectableElement is multivalued, i.e. has a multiplicity greater than one.
Combined fragments are subunits, or sections of an interaction. The interaction operator visible in the
pentagon at top left, defines the specific kind of combined fragment. The constraint thus defines the specific
fragment, e.g. loop fragment, alternative fragment etc. used in the interaction.
The combined fragment icons in the icon bar allow you to insert a specific combined fragment: seq, alt or loop.
Clicking the interactionOperator combo box also allows you to define the specific interaction fragment.
InteractionOperators
Weak
sequencing seq
The combined fragment represents weak sequencing between the
behaviours of the operands.
Alternatives Only one of the defined operands will be chosen, the operand must have
alt a guard expression that evaluates to true.
If one of the operands uses the guard "else", then this operand is
executed if all other guards return false. The guard expression can be
entered immediately upon insertion, will appear between the two square
brackets.
Option Option represents a choice where either the sole operand is executed, or
opt nothing happens.
Break The break operator is chosen when the guard is true, the rest of the
break enclosing fragment is ignored.
Parallel par Indicates that the combined fragment represents a parallel merge of
operands.
Strict strict The combined fragment represents a strict sequencing between the
sequencing behaviours of the operands.
Loop
loop The loop operand will be repeated by the number of times defined in the
guard expression.
Having selected this operand, you can directly edit the expression (in the
loop pentagon) by double clicking.
Critical Region critical The combined fragment represents a critical region. The sequence(s)
may not be interrupted/interleaved by any other processes.
Negative neg Defines that the fragment is invalid, and all others are considered to be
valid.
Assert assert Designates the valid combined fragment, and its sequences. Often used
in combination with consider, or ignore operands.
Ignore ignore Defines which messages should be ignored in the interaction. Often used
in combination with assert, or consider operands.
3. Use the same method to add the second interaction operand with the guard condition "else". Dashed
lines separate the individual operands in the fragment.
Deleting InteractionOperands
1. Double-click the guard expression in the combined fragment element, of the diagram (not in the
Properties tab).
2. Delete the guard expression completely, and press Enter to confirm. The guard expression/interaction
operand is removed and the combined fragment is automatically resized.
The InteractionUse element is a reference to an interaction element. This element allows you to share
portions of an interaction between several other interactions.
Clicking the "refersTo" combo box, allows you to select the interaction that you want to refer to. The name of
the interaction use you select appears in the element.
Note: You can also drag an existing Interaction Use element from the Model Tree into the diagram tab.
8.1.7.1.4 Gate
A gate is a connection point which allows messages to be transmitted into, and out of, interaction
fragments. Gates are connected using messages.
A StateInvariant is a condition, or constraint applied to a lifeline. The condition must be fulfilled for the
lifeline to exist.
To define a StateInvariant:
1. Click the State invariant icon, then click a lifeline, or an object activation to insert it.
2. Enter the condition/constraint you want to apply, e.g. accountAmount > 0, and press Enter to
confirm.
8.1.7.1.6 Messages
Messages are sent between sender and receiver lifelines, and are shown as labeled arrows. Messages can
have a sequence number and various other optional attributes: argument list etc. Messages are displayed from
top to bottom, i.e. the vertical axis is the time component of the sequence diagram.
· Recursion, or calls to another operation of the same object, are shown by the stacking of activation
boxes (Execution Specifications).
To insert a message:
· The direction in which you drag the arrow defines the message direction. Reply messages can point in
either direction.
· Activation box(es) are automatically created, or adjusted in size, on the sender/receiver objects. You
can also manually size them by dragging the sizing handles.
· Depending on the message numbering settings you have enabled, the numbering sequence is updated.
· Having clicked a message icon and holding down Ctrl key, allows you to insert multiple messages by
repeatedly clicking and dragging in the diagram tab.
To delete a message:
The display changes and the connect operation is displayed in the Model Tree tab.
The default action when repositioning messages is to move all dependent messages related to the active one.
Using Ctrl+Click allows you to select multiple messages.
Only the selected message moves during dragging. You can position the message anywhere in the vertical
axis between the object lifelines.
Message numbering
UModel supports different methods of message numbering: nested, simple and none.
· Simple assigns a numerical sequence to all messages from top to bottom i.e. in the order that
they occur on the time axis.
· Nested uses the decimal notation, which makes it easy to see the hierarchical structure of the
messages in the diagram. The sequence is a dot-separated list of sequence numbers followed by a
colon and the message name.
1. Click the Styles tab and scroll down to the Show Message Numbering field.
2. Click the combo box and select the numbering option you want to use. The numbering option you
select is immediately displayed in the sequence diagram.
Note: The numbering scheme might not always correctly number all messages, if ambiguous traces exist. If
this happens, adding return messages will probably clear up any inconsistencies.
Message replies
Message reply icons are available to create reply messages, and are displayed as dashed arrows.
Reply messages are also generally implied by the bottom of the activation box when activation boxes are
present. If activation boxes have been disabled (Styles tab | Show Execution Specifics=false), then reply
arrows should be used for clarity.
Activating the "toggle reply messages" icon, automatically creates syntactically correct reply messages
when creating a call message between lifelines/activations boxes.
1. Messages can create new objects. This is achieved using the Message Creation icon .
2. Drag the message arrow to the lifeline of an existing object to create that object. This type of message
ends in the middle of an object rectangle, and often repositions the object box vertically.
1. Create a message between two lifelines, the receiving object being a class lifeline (Bank). As soon as
you drop the message arrow, the message name is automatically highlighted.
2. Enter a character using the keyboard e.g. "b". A pop-up window containing a list of the existing class
methods is opened.
3. Select an operation from the list, and press Enter to confirm e.g. collectAccountInfos.
4. Press the space bar and press Enter to select the parenthesis character that is automatically
supplied. A syntax helper now appears, allowing you to enter the parameter correctly.
Activating the Toggle automatic creation of operations in target by typing operation names icon,
automatically creates the corresponding operation in the referenced class, when creating a message and
entering a name e.g. myOperation().
Note: Operations can only be created automatically when the lifeline references a class or interface.
Message icons
Message (Call)
Message (Reply)
Message (Creation)
Message (Destruction)
1. On the Project menu, click Import Source Directory, and select the directory unzipped previously.
2. Go through the wizard steps to import the source code as a Java project. For more information about
this step, see Reverse Engineering (from Code to Model) 69 .
3. Having imported the code, right-click the main method of the OrgChartTest class in the Model Tree
and select Generate Sequence Diagram from Code... from the context menu.
This opens the Sequence Diagram Generation dialog box in which you define the generation settings.
4. Select the presentation and layout options, and then click OK to generate the diagram. The settings
shown above produce the sequence diagram below.
Option Purpose
Diagram owner You can set this option when generating a diagram
for the first time. For existing diagrams, this
information is read-only.
Option Purpose
Automatically update diagram when model is updated When you perform reverse engineering (from code to
from code model), sequence diagrams are re-generated
automatically in the model, provided that you have
selected the option Automatically update diagram
when model is updated from code when
generating the diagram for the first time.
Show code in notes Select this check box to generate the diagram with
notes (callouts) that contain program code.
Also show code of messages displayed directly Even when it is possible to show a piece of code as
below UML Message on the diagram, this option still
displays the code of that message as a note.
Option Purpose
Use special color for non-displayable invocations Assigns a color of your choice to non-displayable
invocations.
Show empty Combined Fragments Keeps the Combined Fragment 348 blocks on the
diagram, even if they don't contain anything.
Shown unknown invocations When selected, this option also displays messages
for operations or constructors which could not be
resolved (that is, not found in the model).
Split into smaller diagrams where appropriate Automatically splits sequence diagrams into smaller
sub-diagrams, and automatically generates
hyperlinks between them for easy navigation.
Maximum invocation depth Defines the call depth to be used in the diagram. For
example, if method1() calls method2() which calls
method3(), and the invocation depth is set to 2, then
only method2 is shown, and method3 is no longer
shown.
Type names to ignore Lets you define a comma delimited list of types that
should not appear in the sequence diagram when it is
generated.
Operation names to ignore Lets you define a comma delimited list of operations
that should not appear in the generated sequence
diagram. Adding the operation names to the list
causes the complete operation to be ignored.
Prepending a "+" character to the operation in the list
(for example, +InitComponent) causes the
operation calls to be shown in the diagram, but
without their content.
Use dedicated Lifeline for static calls If there are static methods calls, and if there is
already an instance of that object on the diagram,
messages are normally drawn to that existing lifeline.
With this option enabled, the diagram generator uses
a dedicated new lifeline just for static method calls
for that classifier.
1. Select the menu option Project | Generate Sequence diagrams from Code.
2. Select the operations that you want to generate a sequence diagram for and click OK. (Use the Select
All Public and Select All buttons where necessary.)
3. Optionally, select the Include Getters and Setters check box to generate sequence diagrams for
C#/VB.NET getters and setters.
4. Click OK. This opens a dialog box where you can specify the sequence diagram generation options 360
.
5. Click OK. A sequence diagram is generated for each selected operation, and UModel automatically
opens it.
Creating multiple Sequence diagrams will likely take longer if your project is large. Note that only the first
10 diagrams will be opened automatically by UModel; all the rest will be generated without being opened.
2. Select Generate Sequence Diagram from Code (Getter/Setter) from the context menu. This opens
a dialog box where you can specify the sequence diagram generation options 360 .
3. Click OK to generate the Sequence Diagram.
· Starting from a reverse engineered operation, see Generating Sequence Diagrams from source
358
code ,
· By creating a new sequence diagram from scratch, which is linked to an operation, by right-clicking
367
the operation (in the Model Tree) and selecting Create sequence diagram for code .
When using a reverse engineered sequence diagram as basis, ensure that the option "Show code in
notes" is selected when reverse engineering the code, so you do not lose any code when you start the
forward-engineering process again. This is due to the fact that UML is not able to display all the language
features of VB.NET, Java and C# on the sequence diagram, and those code sections are therefore shown
as code notes.
367
See Adding code to sequence diagrams for an example.
If a Sequence Diagram is to be used for code engineering automatically every time code engineering is started:
Old code will always be lost when forward engineering code from a sequence diagram, because it will be
overwritten with the new code.
1. Select the menu option Project | Generate Code from Sequence Diagrams. You are now prompted
to select the specific Sequence Diagram(s). Clicking the "Select All" button selects all the Sequence
Diagrams in the UModel project.
2. Click OK to generate the code. The Messages window shows the status of the code generation
process.
· Right click a Sequence Diagram and select Generate Code from Sequence diagram.
1. Click into the empty space of the Sequence Diagram, that contains code of an operation.
2. Select Generate Code from Sequence diagram.
· In the Model Tree, right-click an operation and select Create Sequence diagram for code.
You will then be prompted if you want to use the new diagram for forward engineering.
The result is a new Sequence Diagram containing the lifeline of that class.
When reverse-engineering code, standard sequence diagram elements, e.g. CombinedFragments, are
"mapped/assigned" to coding elements (e.g. "if" statements, loops, etc.).
For those programming statements that have no corresponding sequence diagram elements, e.g. "i = i+1",
UModel makes use of "code" notes to add code to diagrams. These notes must then be linked to the lifeline.
Note that UModel does not check, or parse, these code fragments. It is up to you to make sure that the code
fragments are correct and will compile.
1. Click the Note icon then click the model element where you want to insert it, e.g.
CombinedFragment.
2. Enter the code fragment, e.g. return.
3. Click the Node Link handle of the inserted note and drop the cursor on the lifeline.
4. Activate the "Is Code" check box in the Properties tab to include this code fragment when generating
code.
When selecting a note on a sequence diagram, which can be used for code generation, the property "is code"
is available in the Properties window. Clicking the check box, allows you to switch between "ordinary" notes
and code generation notes.
Ordinary notes:
Code updates occur automatically on every forward engineering process if the "Use for forward engineering"
check box is active. If changes were made to the sequence diagram, the code of the operation is always
overwritten.
The sequence diagram shown below was generated by right clicking the OnCommand operation and selecting
Generate sequence diagram from code. The C# code of this example is available in the C:
\Users\<user>\Documents\Altova\UModel2024\UModelExamples\IDEPlugIn\Styles\ folder. Use the option
Project | Import Source Project, to import the project.
if (!m_bPlugINVersionOK)
{
return;
}
if (nID == 3 || nID == 6)
{
OnSetStyles((IApplication)pUModel, "red");
}
if (nID == 4 || nID == 7)
{
OnSetStyles((IApplication)pUModel, "green");
}
GC.Collect();
Timing diagrams depict the changes in state, or condition, of one or more interacting objects over a given period
of time. States, or conditions, are displayed as timelines responding to message events, where a lifeline
represents a Classifier Instance or Classifier Role.
A Timing diagram is a special form of a sequence diagram. The difference is that the axes are reversed i.e. time
increases from left to right, and lifelines are shown in separate vertically stacked compartments.
Timing diagrams are generally used when designing embedded software or real-time systems.
There are two different types of timing diagram: one containing the State/Condition timeline as shown above,
and the other, the General value lifeline, shown below.
2. Click in the Timing Diagram to insert the element. To insert multiple elements of the selected type,
hold down the Ctrl key and click in the diagram window.
1. Locate the element you want to insert in the Model Tree tab (you can use the search function text
box, or press Ctrl+F to search for any element).
2. Drag the element(s) into the state diagram.
8.1.8.2 Lifeline
The lifeline element is an individual participant in an interaction, and is available in two different
representations:
1. State/Condition lifeline
1. Click the Lifeline (State/Condition) icon in the title bar, then click in the Timing Diagram to
insert it.
2. Enter the lifeline name to change it from the default name, Lifeline1, if necessary.
3. Place the mouse cursor over a section of one of the timelines and click left. This selects the line.
4. Move the mouse pointer to the position you want a state change to occur, and click again. Note that
you will actually see the double headed arrow when you do this. A red box appears at the click
position and divides the line at this point.
5. Move the cursor to the right hand side of the line and drag the line upwards.
Note that lines can only be moved between existing states of the current lifeline.
Any number of state changes can be defined per lifeline. Once the red box appears on a line, clicking
anywhere else in the diagram deletes it.
· Right-click the lifeline and select New | State/Condition (StateInvariant). A new State e.g. State3 is
added to the lifeline.
· Click the state and press the Del. key, or alternatively, right click and select Delete.
· Click the "toggle notation" icon at the bottom right of the lifeline.
This changes the display to the General Value lifeline, the cross-over point represents a state/value
change.
Note: Clicking the Lifeline (General Value) icon inserts the lifeline as shown above. You can switch
between the two representations at any time.
Grouping lifelines
Placing or stacking lifelines automatically positions them correctly and preserves any tick marks that might
have been added. Messages can also be created between separate lifelines by dragging the respective
message object.
The TickMark is used to insert the tick marks of a timing ruler scale onto a lifeline.
To insert a TickMark:
1. Click the tick mark icon and click on the lifeline to insert it.
2. Insert multiple tick marks by holding down the Ctrl key and repeatedly clicking at different positions on
the lifeline border.
3. Enter the tick mark label in the field provided for it. Drag tick marks to reposition them on the lifeline.
1. Use the marquee, by dragging in the main window, to mark the individual tick marks.
8.1.8.4 Event/Stimulus
The Event/Stimulus ExecutionEvent is used to show the change in state of an object caused by the
respective event or stimulus. The received events are annotated to show the event causing the change in
condition or state.
To insert an Event/Stimulus:
1. Click the Event/Stimulus icon, then click the specific position in the timeline where the state change
takes place.
2. Enter a name for the event, in this example the event is "Code".
Note that the event properties are visible in the Properties tab.
8.1.8.5 DurationConstraint
A DurationConstraint defines a ValueSpecification that denotes a duration in time between a start and
endpoint. A duration is often an expression representing the number of clock ticks, which may elapse during
this duration.
To insert an DurationConstraint:
1. Click the DurationConstraint icon, then click the specific position on the lifeline where the constraint
is to be displayed. The default minimum and maximum values, "d..t", are automatically supplied.
These values can be edited by double clicking the time constraint, or by editing the values in the
Properties window.
8.1.8.6 TimeConstraint
A TimeConstraint is generally shown as graphical association between a TimeInterval and the construct
that it constrains. Typically, this is graphical association between an EventOccurrence and a TimeInterval.
To insert a TimeConstraint:
· Click the TimeConstraint icon, then click the specific position on the lifeline where the constraint is to
be displayed.
The default minimum and maximum values are automatically supplied, "d..t" respectively. These values
can be edited by double clicking the time constraint, or by editing the values in the Properties window.
8.1.8.7 Message
A Message is a modeling element that defines a specific kind of communication in an Interaction. A
communication can be e.g. raising a signal, invoking an Operation, creating or destroying an Instance. The
Message specifies the type of communication defined by the dispatching ExecutionSpecification, as well as
the sender and the receiver.
Message (Call)
Message (Reply)
Messages are sent between sender and receiver timelines, and are shown as labeled arrows.
To insert a message:
Notes:
· The direction in which you drag the arrow defines the message direction. Reply messages can point in
either direction.
· Having clicked a message icon and holding down Ctrl key, allows you to insert multiple messages by
repeatedly clicking and dragging in the diagram tab.
To delete a message:
Class Diagram
Component Diagram
Composite Structure Diagram
Deployment Diagram
Object Diagram
Package Diagram
Profile Diagram 403
· Click on the + or - buttons of the currently active class to expand/collapse the specific compartment.
· Use the marquee (drag on the diagram background) to mark multiple classes, then click the
expand/hide button. You can also use Ctrl+Click to select multiple classes.
· Press Ctrl+A to select all classes, then click the expand/collapse button, on one of the classes, to
expand/collapse the respective compartments.
Note that you can use the standard keyboard keys, or the numeric keypad keys to achieve this.
· Click a class in the diagram window, click the Styles tab and scroll down the list until you find the
Show Visibility entry.
You can choose between the UModel type shown above, or the UML conformant symbols shown
below.
To show or hide multiple members based on their visibility, use the check boxes in the Element Styles group.
For example, clearing the protected check box in the Show Attributes group hides all protected attributes of
the class.
Note: Tagged values of hidden elements are also hidden when you select the hide option.
After you confirm your preferences with OK and close the dialog box, any hidden members on the diagram are
replaced by the ellipsis ... symbol. To open the dialog box again, double-click the ellipsis.
The When new elements are added and not hidden by Element Styles option allows you to define what
will be made visible when new elements are added to the class. This applies not only to elements added
manually in the diagram or in the Model Tree, but also to those added automatically during the code
engineering process. The valid values for this option are as follows:
Show elements When a new member is added to the class, show it on the
diagram. Nevertheless, if any of the options set under
"Element styles" dictate that the element must be hidden,
hide it.
Hide elements (except those added to this Here, the term "node" refers to the current instance of the
node) class on the diagram. (Recall that the same class can be
added multiple times on the same diagram, see
Renaming, Moving, and Copying Elements 107 .)
For an example of how the options above are useful, open the Bank_MultiLanguage.ump example project,
and find the "Hierarchy of Account" class diagram.
There are now two instances of the SavingsAccount class on the diagram.
1. Right-click the left instance of the class, select Show/Hide Node content, and then select the Show
elements option.
2. Right-click the right instance of the class, select Show/Hide Node content, and then select the Hide
elements (except those added to this node) option.
Next, add a new property to the left instance (select the class and press F7). As illustrated below, the new
property (Property1) is visible in the left instance but not visible in the right instance. This happens because
the right-side instance of the class has the the Hide elements (except those added to this node) option
enabled.
Finally, add a new property to the right-side instance of the class. As illustrated below, the new property
(Property2) is visible in both instances. This happens because the left-side instance is configured to show new
elements, while the right-side instance is the current instance where the property is added, so the new property
is shown unconditionally.
1. Switch to the Styles tab and change the Use Syntax Coloring entry to false.
2. Use the Attribute Color, or Operation Color entries in the Styles tab to customize these items in
the class.
1. Right-click one of the derived classes in the class diagram, e.g. CheckingAccount, and select
Override/Implement Operations. This opens the dialog box shown below.
2. Select the Operations that you want to override and confirm with OK. The "Select undefined..." buttons
select those method types in the window at left.
Note: When the dialog box is opened, operations of base classes and implemented interfaces that have the
same signature as existing operations, are automatically checked (i.e. active).
· Drag an attribute from the Attribute compartment and drop it in the Operations compartment.
A pop-up menu appears at this point allowing you to decide what type of get/set method you want to
create.
Selecting the first item creates a get and set method for interestRate:float.
1. Right-click the class title, e.g. SavingsAccount, and select the context menu option Create
Getter/Setter Operations. The Create Getters/Setters dialog box opens displaying all attributes
available in the currently active class.
2. Use the buttons to select the items as a group, or click the getter/setter check boxes individually.
Note: You can also right-click a single attribute and use the same method to create an operation for it.
In the shots shown above, Class2 realizes Interface1, which is used by classes 1, 3, and 4. The usage icons
were used to create the usage relationship between the classes and the interface.
· Click the Toggle Interface notation icon at the base of the interface element.
1. Click the method of the class you want to add the raised exception to in the Model Tree window, e.g.
getBalance of the Account class.
2. Right-click the Properties window and select Add Raised Exception from the pop-up menu. This adds
the raised exceptions field to the Properties window, and automatically selects the first entry in the
list.
3. Select an entry from the list, or enter your own into the field.
· Right-click the class on the diagram and select New | Reception from the context menu.
Receptions appear in a separate compartment on the Class diagram, similar to properties and operations, for
example:
Receptions share the same styles as operations. This means that, whenever you change the style of
117
operations, the changes affect Receptions also. For more information, see Changing the Style of Elements .
1) The Enable diagram generation check box is selected on the "Import Source Project", "Import Binary
Types", or "Import Source Directory" dialog box.
2) The Generate single diagram and/or the Generate diagram per package options are selected on the
"Content Diagram Generation" dialog box.
Once the import operation is finished, any generated class diagrams are available under "Class Diagrams" in
the Diagram Tree.
Diagram Tree
The Composite Structure Diagram has been added in UML 2.0 and is used to show the internal structure,
including parts, ports and connectors, of a structured classifier, or collaboration.
2. Click in the Composite Structure diagram to insert the element. To insert multiple elements of the
selected type, hold down the Ctrl key and click in the diagram window.
1. Locate the element you want to insert in the Model Tree tab (you can use the search function text box,
or press Ctrl+F to search for any element).
2. Drag the element(s) into the Composite Structure diagram.
Collaboration
Inserts a collaboration element which is a kind of classifier/instance that communicates with other instances to
produce the behavior of the system.
CollaborationUse
Inserts a Collaboration use element which represents one specific use of a collaboration involving specific
classes or instances playing the role of the collaboration. A collaboration use is shown as a dashed ellipse
containing the name of the occurrence, a colon, and the name of the collaboration type.
When creating dependencies between collaboration use elements, the "type" field must be filled to be able to
create the role binding, and the target collaboration must have at least one part/role.
Part (Property)
Inserts a part element which represents a set of one or more instances that a containing classifier owns. A Part
can be added to collaborations and classes.
Port
Inserts a port element which defines the interaction point between a classifier and its environment, and can be
added on parts with a defined type.
Class
Inserts a Class element, which is the actual classifier that occurs in that particular use of the collaboration.
Connector
Inserts a Connector element which can be used to connect two or more instances of a part, or a port. The
connector defines the relationship between the objects and identifies the communication between the roles.
Packages are depicted as folders and can be used on any of the UML diagrams, although they are mainly used
on use-case and class diagrams.
Dependency links between packages are created if there are any references between the modeling elements of
those packages. E.g. Dependencies between classes, derived classes, or if attributes have types that are
defined in a different package.
1. Right click a package in the Model Tree, e.g. altova, and select Show in new Diagram | Package
Dependencies.... This opens the New Package Dependency Diagram dialog box.
A new diagram is generated and displays the package dependencies of the altova package.
2. Click in the diagram to insert the element. To insert multiple elements of the selected type, hold down
the Ctrl key and click in the diagram window.
1. Locate the element you want to insert in the Model Tree tab (you can use the search function text box,
or press Ctrl+F to search for any element).
2. Drag the element(s) into the diagram.
Package
Inserts the package element into the diagram. Packages are used to group elements and also to provide a
namespace for the grouped elements. Being a namespace, a package can import individual elements of other
packages, or all elements of other packages. Packages can also be merged with other packages.
Profile
Inserts the Profile element, which is a specific type of package that can be applied to other packages.
The Profiles package is used to extend the UML meta model. The primary extension construct is the
Stereotype, which is itself part of the profile. Profiles must always be related to a reference meta model such
as UML, they cannot exist on their own.
Dependency
Inserts the Dependency element, which indicates a supplier/client relationship between modeling elements, in
this case packages, or profiles.
PackageImport
Inserts an <<import>> relationship which shows that the elements of the included package will be imported into
the including package. The namespace of the including package gains access to the included namespace; the
namespace of the included package is not affected.
PackageMerge
Inserts a <<merge>> relationship which shows that the elements of the merged (source) package will be
imported into the merging (target) package, including any imported contents of the merged (source) package.
If the same element exists in the target package then these elements' definitions will be expanded by those
from the target package. Updated or added elements are indicated by a generalization relationship back to the
source package.
ProfileApplication
Inserts a Profile Application which shows which profiles have been applied to a package. This is a type of
package import that states that a Profile is applied to a Package.
The Profile extends the package it has been applied to. Applying a profile, using the ProfileApplication icon,
means that all stereotypes that are part of it, are also available to the package.
Profile names are shown as dashed arrows from the package to the applied profile, along with the <<apply>>
keyword.
1) The Enable diagram generation check box is selected on the "Import Source Project", "Import Binary
Types", or "Import Source Directory" dialog box.
2) The Generate diagram option is selected on the "Package Dependency Diagram Generation" dialog box.
Once the import operation is finished, any generated package diagrams are available under "Package
Diagrams" in the Diagram Tree.
Diagram Tree
In UML, profiles are a way to extend UML to a specific platform or domain. Unlike a package, a profile is in the
meta-model and consists of "meta" building blocks that extend or constrain something. This is possible with
the help of the following extension mechanisms included into a profile: stereotypes, tagged values, and
constraints.
In UModel, the profile diagram is where you can conveniently create your own stereotypes, tagged values and
constraints bundled as a custom profile. Profiles enable you to extend or adapt UML to your specific domain or
customize the appearance of elements in your modeling projects. For example, you may want to define custom
styles or add custom icons for UML elements such as classes, interfaces, and so on.
Importantly, the profile diagram is where you can apply a profile to a package. For example, the profile diagram
below illustrates a ProfileApplication relationship between the package BankView and the Java profile built
into UModel. You can find this diagram in the following sample project: C:
\Users\<username>\Documents\Altova\UModel2024\UModelExamples\BankView_Java.ump; it is called
"Apply Java Profile".
Profile diagram
The applied Java profile means that any class or interface that is part of the BankView package (or will be
added to this package in future) must look like a Java class or interface and all its members must exhibit
behavior specific to that language. For example:
· All Java data types that exist in the profile are available for selection from a drop-down list when you
design a class in a class diagram, see also Class Diagrams 27 .
· All Java-specific stereotypes defined in the profile, such as «annotations», «final», «static»,
«strictfp», and so on, are visible as properties in the Properties window when you select an element.
This chapter describes how you can extend UModel projects by means of custom profiles and stereotypes. For
154
information about using the UModel built-in profiles, see Applying UModel Profiles and Stereotypes and
140
Tagged Values .
1. Right-click the package where you would like to create the new profile, (for example, "Root"), and
select New element | Profile from the context menu.
2. Create all the elements that should be part of this profile, such as stereotypes, data types, and so on.
You can do this either in the Model Tree window or from a profile diagram. For example, to create a
new stereotype in the model, right-click the profile and select New element | Stereotype from the
context menu. See also Creating Stereotypes 405 .
3. Optionally, create a profile diagram (right-click the profile and select New diagram | Profile diagram
from the context menu). To add all the required elements to the diagram, use the standard UModel
menu commands and toolbars, see How to Model... 103 .
If you would like to create the profile from a profile diagram, make sure that the diagram is owned by
In addition, if you would like to reuse the profile across multiple UModel projects, do the following:
1. Share any packages that you want to make reusable. (Right-click the package or the profile itself, and
select Subproject | Share package from the context menu.)
2. Save the project to a directory from where you can later include it as a subproject, see Including
Subprojects 158 .
So far, you have created a profile but have not added (or applied) it to any package. By applying a profile to a
package, you make all of the extension mechanisms of that profile (such as stereotypes, data types, and so
on) available to elements of the package.
However, if you would like to add custom icons to elements or customize their appearance based on the
applied stereotype, this can be achieved by creating custom stereotypes. Note the following prerequisites:
· Stereotypes must be owned by a profile or a package inside a profile. Therefore, in order to create a
stereotype, you must create a profile first (or a package inside an existing profile).
· After creating the profile, you must apply it to the package where you need to use the custom
stereotypes, as described in Creating and Applying Profiles 404 .
Once you have created a profile, you can start adding stereotypes to it. This can be done either directly in the
Model Tree window, or from a profile diagram. If you would like to create stereotypes from a profile diagram,
make sure that the diagram is owned by (created under) a profile, or by a package inside a profile, as shown
below.
To create a stereotype:
1. If you haven't done so already, create a profile, see Creating and Applying Custom Profiles 404 .
2. Optionally, right-click the profile and select New diagram | Profile diagram from the context menu.
This creates a new profile diagram under the current profile—it will help you visualize in one place all
the stereotypes, data types, and other elements that you will subsequently add to the profile.
3. Right-click the profile in the Model Tree window, and select New element | Stereotype from the
context menu.
4. Optionally, set the stereotype properties in the Properties window. For example, if you set the
stereotype's metaclass to "Class", the stereotype will apply to classes only. Likewise, you can set a
custom icon for the stereotype by clicking the Ellipsis button next to icon file name.
Notes
· If the image path is relative, it must be relative to the UModel project's folder.
· To use custom icons with transparent background, set their background color to RGB value
82,82,82.
· To display stereotypes for association relationships, set the Show MemberEnd stereotypes
property to "true" in the Styles window.
You can set the data type of each property from the Properties window, by selecting a value from the type list.
Any data type previously defined in the same profile as the stereotype is available for selection. If the profile
doesn't contain any data types yet, you can define one by right-clicking the profile diagram, and selecting New
| Data type from the context menu.
To set the default value of a property, enter that value in the default field of the Properties window. For
example, the stereotype property illustrated below has "0" as default value:
The data type of a stereotype attribute (property) can also be an enumeration, see Example: Creating and
Applying Stereotypes 408 .
· Create a stereotype
· Create stereotype attributes (properties) that become tagged values when applied to an element
· Define a stereotype attribute as an enumeration
· Set a default value for a stereotype attribute
· Apply the stereotype to elements in the model.
The example is accompanied by a sample project file called StereotypesDemo.ump, available at the following
path: C:\Users\<username>\Documents\Altova\UModel2024\UModelExamples\Tutorial. If you follow the
instructions below literally, you will create a similar project.
Create a stereotype
For the scope of this tutorial, you will create a stereotype with two attributes: "Usability" and "IsObsolete". The
"IsObsolete" attribute will be defined as an enumeration. The enumeration will consist of two values, "Yes" and
"No", where "No" is the default value.
1. Right-click the profile and select New element | Stereotype from the context menu. A new
stereotype has been added to the profile.
2. Rename the new stereotype to "Info".
3. Right-click the stereotype and select New element | Property from the context menu. This adds a
new property.
4. Rename the new property to "Usability".
6. Right-click the "DemoProfile" and select New Element | Enumeration from the context menu.
Rename the enumeration to "YesNoEnum".
7. Right-click the enumeration and select New Element | EnumerationLiteral from the context menu.
Rename the enumeration literal to "Yes".
8. Repeat the step above and create an enumeration literal called "No".
9. Click the "IsObsolete" property and change its type to YesNoEnum. Also, set the default property to
"No"
1. Right-click the "Root" package and add a new package by selecting New element | Package from
the context menu.
2. Rename the new package to "DemoPackage".
3. Add a class to the package (in this example, "DemoClass".
1. Right-click the "DemoProfile" in the Model Tree window and select New diagram | Profile diagram
from the context menu.
2. Drag both the "DemoPackage" package and the "DemoProfile" profile from the Model Tree window into
the diagram.
3. Click the ProfileApplication toolbar button, and draw a ProfileApplication relationship from the
package to the profile.
1. Right-click the "DemoPackage" and select New diagram | Class diagram from the context menu.
2. Drag the class "DemoClass" onto the diagram.
3. Click the class and select the «Info» stereotype in the Properties window. Notice that the
"IsObsolete" property is pre-filled with its default value.
The class on the diagram now has a "Tagged values" section which displays the stereotype attributes and their
values. You can change these values either from the Properties window, or directly from the diagram.
The class that will be customized in this example is in the StereotypesDemo.ump project, available at the
following path: C:\Users\<username>\Documents\Altova\UModel2024\UModelExamples\Tutorial. This is a
simple demo project which includes a custom profile under which we will create the stereotype. For an example
that shows you how to create profiles and stereotypes from scratch, see Example: Creating and Applying
Stereotypes 408 .
To add a custom image to the stereotype, click the stereotype, and then click the Ellipsis button next to
icon file name property in the Properties window. Select the following sample image: C:
\Users\<username>\Documents\Altova\UModel2024\UModelExamples\Tutorial\class.bmp.
Next, click the Styles tab of the Properties window. Select Styles of Elements with this Stereotype from the
top list, and change the Header Font Size property to "16".
1. Open the class diagram "ClassDiagram1". You will find this diagram under the "DemoPackage" in the
Model Tree view.
2. Click the "DemoClass" class, and then select the «StylingStereotype» check box in the Properties
window.
The appearance of the class on the diagram is now changed according to the applied stereotype:
Remarks
The demo project contains a profile diagram, "ProfileDiagram1". In this diagram, notice that the "DemoProfile"
is applied to the "DemoPackage" with a ProfileApplication relationship. This makes the stereotype
available to the package, see also Creating and Applying Custom Profiles 404 .
You have now learned how to change the appearance of elements using stereotypes. You can use the same
technique in other projects. Just keep in mind that the profile where you create the stereotype must be applied
to the target package, as shown above.
416
XML Schema diagrams
UModel supports the import and generation of W3C XML schemas as well as their forward and reverse
engineering. In case of XML Schemas, "forward and reverse engineering" means that you can import a schema
(or multiple schemas from a directory) into UModel, view or modify the model, and write the changes back to
the schema file. When you synchronize data from the model to a schema file, the schema file is always
overwritten by the model.
Note: The XML Schema must be valid before it can be imported into UModel. XML Schemas are not validated
when you create or import them in UModel, or when you run a project syntax check. Nevertheless,
UModel checks whether the XML schema is well-formed when importing it.
XML Schema diagrams display schema components in UML notation. For example, simple types are shown in
UModel as data types with the «simpleType» stereotype. Complex types are shown as classes with the
«complexType» stereotype. Various schema details are represented as Tagged Values 141 , while schema
annotations are represented as comments. For a mapping table that illustrates how all the XML schema
components map to UModel elements, see XML Schema Mappings 258 .
3. To generate diagrams from the schema, make sure that the Enable diagram generation check box
is selected and click Next.
4. To create a separate diagram for each global component in the schema like in this example, select the
Generate diagrams for XSD globals option. To open all generated diagrams after import, select
Open diagrams. Options from the "Style" group let you define the compartments that appear by
default in diagrams for each schema component. The Show schema details as tagged values
option displays the schema details as Tagged Values 141 .
5. Click Next. To generate a Package dependency diagram like the one in this example, select the
Generate Diagram check box.
6. Click Finish.
Once UModel completes importing the schema, a new package called All Schemas is created and set
automatically as the "XSD Namespace Root". The OrgChart.xsd schema used in this example imports types
from another namespace, more specifically, from the ipo.xsd schema. Consequently, both schemas appear in
the Model Tree window after import, under their respective namespaces:
If you have selected the Generate diagrams for XSD globals check box, all XSD global components
generate an XML Schema diagram, and the diagrams appear under the respective namespace packages, like
the "Address (complexType)" diagram in the image above.
2. To import schemas from all subdirectories of the selected directory, select the Process all
subdirectories check box. The rest of the import process is the same as described above for a single
XML schema.
You can configure whether such details are to be shown or hidden from the diagram. To do this, right-click the
element and select Tagged Values | <option> from the context menu. You can configure the display of
tagged values not only individually for each element, but also globally at project level. For more information, see
Showing or Hiding Tagged Values 144 .
The "Root" and "Component View" packages are common to any UModel Project and cannot be deleted.
"Root" is the topmost level under which any other packages are added, and "Component View" is used for code
engineering (in this case, importing or generating schema files).
The "XSDNamespaceRoot" package includes all the namespaces used by your schema(s). To turn a package
into an XSD Namespace Root, right-click it and select Code Engineering | Set as XSD Namespace Root
from the context menu. If you import an existing XML schema into the project, this package is called "All
schemas" by default.
The "XSDTargetnamespace" package is an XML Schema namespace. Multiple such namespaces may exist
under the same XSD Namespace Root. To turn a package into a namespace, first select the package, and
then select the «namespace» property (stereotype) in the Properties window.
"XSDSchema" is a schema, or, in UML terms, a class with the «schema» property (stereotype) selected in the
Properties window.
XMLSchemaDiagram1 is the actual diagram that describes the schema's model. You can create XML
Schema diagrams under an XSD Namespace Root, under an XML Schema Namespace, or under an XML
Schema. In the example project illustrated above, the diagram is created under the XML schema.
The XSD Profile enables all the types and structures required to work with XML Schema in the project. If your
project does not have this profile, you will be prompted to include it whenever you create a new XML Schema
diagram. You can also add the XSD profile to a project explicitly, see Applying UModel Profiles 154 .
· Click a specific toolbar button, and then click inside the XML Schema diagram.
To insert multiple elements of the same type, hold down the Ctrl key and click multiple times in the diagram.
As stated above, XML Schema diagrams can be created at various levels in the project's structure. If the
diagram is at a level which does not allow placing a particular element, certain toolbar buttons are not
meaningful and they show a tooltip with information instead of adding the element.
The table below lists all the toolbar buttons and their purpose.
XSD Target Namespace Adds an XSD target namespace. Clicking this button is
meaningful if the diagram was created directly under an XSD
Namespace Root.
XSD Schema Adds an XML Schema Definition (XSD). Clicking this button is
meaningful if the diagram was created under an XSD target
namespace.
Element (global) Adds a global element to the diagram. When you add an
element, a property with the same name as the element is
automatically generated in the attributes compartment. Set the
property type to set the element's type.
Complex Type Adds a global complex type to the diagram. In UML terms, this
is a class that has the «global» and «complexType»
stereotypes applied.
Complex Type with Simple Adds a global complex type with simple content. In UML terms,
Content this is a data type that has the «global», «complexType», and
«simpleContent» stereotypes applied.
For step-by-step schema modeling instructions, see Example: Create and Generate an XML Schema 424 .
<xs:restriction base="xs:integer">
<xs:maxInclusive value="10"/>
<xs:minInclusive value="1"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="ProductType">
<xs:sequence>
<xs:element name="number" type="xs:integer">
</xs:element>
<xs:element name="size" type="prod:SizeType">
</xs:element>
</xs:sequence>
<xs:attribute name="createdAt" type="xs:date">
</xs:attribute>
</xs:complexType>
<xs:element name="product" type="prod:ProductType">
</xs:element>
</xs:schema>
product.xsd
Also, the XML schema has a global product element, a complex type ProductType and a simple type
SizeType.
In the Model Tree Window 79 , rename "XMLSchemaDiagram1" to "MainDiagram". This is the diagram where
most schema components will be created, except for namespace declarations.
Next, rename "XSDTargetNamespace" to "http://www.altova.com/umodel" (recall that this is the required target
namespace). This declares the target namespace of the new schema.
The two "xmlns" namespaces and the UTF-8 encoding can be set as follows:
Optionally, you can quickly generate a new XML Schema diagram at namespace level that presents the same
information visually, as follows:
1. In the Model Tree, right-click the namespace "http://www.altova.com/umodel" and select New
Diagram | XML Schema diagram from the context menu.
2. When a message box with the following text appears: "Do you want to add the 'XML Schema Diagram'
to a new 'XSD Schema'?", click No.
3. Drag the XML Schema from the Model Tree into the diagram.
141
As shown above, the namespace and encoding are stored as Tagged Values and can be edited from the
diagram window as well.
4. Click inside the Model Tree and press Ctrl+F. The Find dialog box appears. Start typing "integer" and
locate the integer type from the "XSDDataTypes" package of the "XSD Profile".
5. Drag the integer type into the diagram.
6. Click the Restriction toolbar button and drag the cursor from SizeType to integer. This creates
the restriction relationship; see also Creating Relationships 130 .
7. To define the minInclusive and maxInclusive values, select the simple type and edit the properties
with the same name in the Properties window.
1. Click the XSD Complex Type toolbar button, and then click inside the diagram.
2. Rename the complex type to ProductType.
3. Right-click the complex type and select New | XSD Sequence from the context menu.
4. Drag the «sequence» class away from the complex type and into the diagram.
7. Using the same steps as above, create the element size of type SizeType. Note that SizeType is the
simple type created previously.
8. Right-click the complex type on the diagram and select New | XSD Attribute (local) from the context
window.
9. Change the attribute's name to createdAt and the type to date.
Add an element
Now that all the required types of the schema have been defined, you can add a product element of type
ProductType, as follows:
1. Click the XSD Element (global) toolbar button, and then click inside the diagram. Notice that a
class with the «element» stereotype and a single property is added.
Completed design
The steps above conclude the design part of the schema. By now, your full schema design should look as
follows:
Right-click the "Component View" package in the Model Tree and add a new element of type Component.
Make sure to change the component's properties as shown below:
Note: If a project file property is missing, enter product.xsd in the directory property and press Enter. A
message box should now appear asking you to refer to a project file instead. Click Yes to confirm.
Finally, the XML Schema must be realized by the code engineering component, as described in Adding a Code
Engineering Component 165 . For the scope of this example, the quickest way to create the
ComponentRealization relationship is as follows:
· In the Model Tree, drag the XSDSchema schema over the code engineering component
(Component1) and drop it when a tooltip appears such as the one below:
You can now generate the schema file. To do this, either press F12 or select the Project | Overwrite
Program Code from UModel project menu command. Note that merging is not supported in case of XML
Schemas; therefore, the dialog box shows a message in red to state this fact.
The new XML schema will be generated in the same folder as your UModel project.
You can export UModel projects to XML Metadata Interchange (XMI) files, and import XMI files as UModel
projects. This provides interoperability with other UML tools that support XMI. The supported XMI versions are
as follows:
Notes:
· During the export process, all included files, even those defined as include by reference 160 , are
exported.
· If you intend to re-import generated XMI code into UModel, make sure that you select the Export
UModel Extensions check box.
The sections below describe options available when exporting projects to XMI.
Export UUIDs
XMI defines three versions of element identification: IDs, UUIDs and labels.
· IDs are unique within the XMI document, and are supported by most UML tools. UModel exports these
type of IDs by default, i.e. none of the check boxes need activated.
· UUID are Universally Unique Identifiers, and provide a mechanism to assign each element a global
unique identification, GUID. These IDs are globally unique, i.e. they are not restricted to the specific
XMI document. UUIDs are generated by selecting the "Export UUIDs" check box.
· UUIDs are stored in the standard canonical UUID/GUID format (e.g "6B29FC40-CA47-1067-B31D-
00DD010662DA", "550e8400-e29b-41d4-a716-446655440000",...)
· Labels are not supported by UModel.
Note: The XMI import process automatically supports both types of IDs.
Data such as the file names of classes, or element colors, are not part of the UML specification and thus have
to be deleted in XMI, or be saved in "Extensions". If they have been exported as extensions and re-imported, all
file names and colors will be imported as defined. If extensions are not used for the export process, then these
UModel-specific data will be lost.
When importing an XMI document, the format is automatically detected and the model generated.
Export diagrams
Exports UModel diagrams as "Extensions" in the XMI file. The option Export UModel Extensions must be
selected before you can save the diagrams as extensions.
10 Source Control
The source control support in UModel is available through the Microsoft Source Control Plug-in API (formerly
known as the MSSCCI API), versions 1.1, 1.2 and 1.3. This enables you to run source control commands such
as "Check in" or "Check out" directly from UModel to virtually any source control system that lets native or
third-party clients connect to it through the Microsoft Source Control Plug-in API.
You can use as your source control provider any commercial or non-commercial plug-in that supports the
Microsoft Source Control Plug-in API, and can connect to a compatible version control system. For the list of
source control systems and plug-ins tested by Altova, see Supported Source Control Systems 439 .
Any source control plug-ins compatible with the Microsoft Source Code Control Plug-in API are displayed in the
Current source control plug-in drop-down list.
If a compatible plug-in cannot be found on your system, the following message is displayed:
Some source control systems might not install the source control plug-in automatically, in which case you will
need to install it separately. For further instructions, refer to the documentation of the respective source control
system. A plug-in (provider) compatible with the Microsoft Source Code Control Plug-in API is expected to be
registered under the following registry entry on your operating system:
HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider\InstalledSCCProviders
Upon correct installation, the plug-in becomes available automatically in the list of plug-ins available to UModel.
You might be able to speed up your system by disabling (or increasing the interval of) the Perform
background status updates every ... seconds option in the Source Control tab accessed through Tools |
Options.
Note: The 64-bit version of your Altova application automatically supports any of the supported 32-bit source
control programs listed in this documentation. When using a 64-bit Altova application with a 32-bit
source control program, the Perform background status updates every ... seconds option is
automatically grayed-out and cannot be selected.
1. If this hasn't been done already, install the source control system (see Supported Source Control
Systems 439 ) and set up the source control database (repository) to which you wish to save your
work.
2. Create a local workspace folder that will contain the working files that you wish to place under source
control. The folder that contains all your workspace folders and files is called the local folder, and the
path to the local folder is referred to as the local path. This local folder will be bound to a particular
folder in the repository.
3. In your Altova application, create an application project folder to which you must add the files you wish
to place under source control. This organization of files in an application project is abstract. The files in
a project reference physical files saved locally, preferably in one folder (with sub-folders if required) for
each project.
4. In the source control system's database (also referred to as source control or repository), a folder is
created that is bound to the local folder. This folder (called the bound folder) will replicate the structure
of the local folder so that all files to be placed under source control are correctly located hierarchically
within the bound folder. The bound folder is usually created when you add a file or an application
project to source control for the first time.
· Altova has implemented the Microsoft Source Control Plug-in API (versions 1.1, 1.2, and 1.3) in
UModel, and has tested support for the listed drivers and revision control systems. It is expected that
UModel will continue to support these products if, and when, they are updated.
· Source Code Control clients not listed below, but which implement the Microsoft Source Control Plug-
in API, should also work with UModel.
Codice Software Plastic SCM Professional Codice Software Plastic SCM Professional 2.7.127.10 (SCC
2.7.127.10 (Server) Plugin)
Dynamsoft SourceAnywhere for VSS 5.3.2 Dynamsoft SourceAnywhere for VSS 5.3.2 Client
Standard/Professional Server
IBM Rational ClearCase 7.0.1 (LT) IBM Rational ClearCase 7.0.1 (LT)
Microsoft SourceSafe 2005 with CTP Microsoft SourceSafe 2005 with CTP
Microsoft Visual Studio Team System Microsoft Team Foundation Server 2008/2010 MSSCCI
2008/2010 Team Foundation Server Provider
QSC Team Coherence Server 7.2.1.35 QSC Team Coherence Client 7.2.1.35
Reliable Software Code Co-Op 5.1a Reliable Software Code Co-Op 5.1a
Seapine Surround SCM Client/Server for Seapine Surround SCM Client 2009.0.0
Windows 2009.0.0
Serena Dimensions Express/CM 10.1.3 for Serena Dimensions 10.1.3 for Win32 Client
Win32 Server
The description of the version control commands that follow apply to the standalone version of UModel. The
Visual Studio and Eclipse versions of UModel use the version control functionality and menu items available in
those IDEs.
Bank_CSharp.ump now opens in UModel, and the file is placed under source control. This is
indicated by the lock symbol visible on the Root folder in the Model Tree window. The Root folder
represents both the project file and the working directory for source control operations.
The BankCSharp directory has been created locally, you can now work with these files as you
normally would.
Note:
To place under source control the code files generated when synchronizing code, see: Add to Source
Control 451
or
The lock symbol denotes that the file, or folder is under source control, but is currently not checked out.
or
The red check mark denotes checked out, i.e. the UModel project file (or code file) has been checked out for
editing. The asterisk in the Application title bar denotes that changes have been made to the file, and you will
be prompted to save it when you exit.
or
The arrow symbol shows that the file(s) have been checked out by someone else in the network, or by you into
a different working directory
1. Select the menu option Project | Source Control and activate/check the Enable source control
check box of the fly-out menu. The previous check in/out status of the various files are retrieved and
displayed in the Model Tree window.
1. Select the menu option Project | Source Control and uncheck the Enable source control check
box.
You are now prompted if you want to remove the binding information from the project.
If the affected files are currently checked out, different things occur depending on the specific version control
plugin: nothing happens, new data are merged into your local file, or your changes are overwritten.
This command works in a similar fashion to the Get command, but does not display the "Source control - Get"
dialog box. It is therefore not possible to specify Advanced get options.
Note that this command automatically performs a recursive get latest version operation when performed on a
folder, i.e. it affects all other files below the current one in the package hierarchy.
1. Select the file(s) you want to get the latest version of in the Model Tree.
2. Select Project | Source Control | Get Latest Version.
10.3.4 Get
Retrieves a read-only copy of the selected files and places them in the working folder. The files are not
checked-out for editing per default.
Using Get:
Select All
Selects all the files in the list box.
Advanced
Allows you to define the Replace writable and Set timestamp options in the respective combo boxes.
The "Make writable" check box removes the read-only attribute of the retrieved files.
Advanced
Allows you to define the Replace writable and Set timestamp options in the respective combo boxes.
The "Make writable" check box removes the read-only attribute of the retrieved files.
· Select the file or folder you want to check out in the Model Tree.
· Select Project | Source Control | Check Out.
Note: You can change the number of files to check out, by activating the individual check boxes in the Files
list box.
Select the option Checkout local version to check out only the local versions of the files, not those from the
source control database.
· Single files, click on the respective files (CTRL + click, in the Model Tree)
· Folders, click on the folders (CTRL + click, in the Model Tree)
or
The red check mark denotes that the file/folder has been checked out.
Advanced
Allows you to define the Replace writable and Set timestamp options in the respective combo boxes.
The "Make writable" check box removes the read-only attribute of the retrieved files.
10.3.7 Check In
This command checks in the previously checked out files, i.e. your locally updated files, and places them in
the source control database.
To Check In files:
Shortcut: Right-click a checked out item in the project window, and select "Check in" from the Context menu.
Note:
You can change the number of files to check in, by activating the individual check boxes in the Files
list box.
, or
The lock symbol denotes that the file/folder is under source control, but is currently not checked out.
Note:
You can change the number of files by activating the individual check boxes in the Files list box.
The Undo check out option can apply to the following items:
· Single files, click on the respective files (CTRL + click, in Model Tree)
· Folders, click on the folders (CTRL + click, in Model Tree)
Advanced
Allows you to define the Replace writable and Set timestamp options in the respective combo boxes.
The "Make writable" check box removes the read-only attribute of the retrieved files.
Having placed the UModel project file (*.ump) under source control, you can then add the code files produced
by the code-engineering process, to source control as well. For this to work, the generated code files and the
UModel project have to be placed in, or under, the same SourceSafe working directory. The working directory
used in this section is C:\Users\Altova\Documents\UMODEL_WORK\.
1. Expand the Component View folder in the Model Tree and Navigate to the BankView component.
2. Click the BankView component and click the Browse icon next to the "directory" field in the
Properties window.
8. Click OK once you have selected the files you want to place under source control.
The lock symbol now appears next to each of the classes/file sources placed under source control.
Note:
You can change the number of files to remove, by activating the individual check boxes in the Files list
box.
1. Select the folder you want to share files to, in the Model Tree window, and select Project | Source
Control | Share from Source Control. e.g. BankView Component in the Component View folder.
2. Select the project folder that contains the file you want to share in the "Projects" list box.
3. Select the file you want to share in the "Files to share" list box and click the Share button.
The file is now removed from the "File to share" list.
4. Click the Close button to continue.
This dialog box is provides various way of comparing and getting specific versions of the file in
question. Double clicking an entry in the list opens the History Details dialog box for that file.
Close
Closes this dialog box.
View
Opens a further dialog box in which you can select the type of viewer you want to see the file with.
Details
458
Opens a dialog box in which you can see the properties of the currently active file.
Get
Allows you to retrieve one of the previous versions of the file in the version list, and place it into the
working directory.
Check Out
Allows you to check out the latest version of the file.
Diff
Opens the Difference options 457 dialog box, which allows you to define the difference options when
viewing the differences between two file versions.
Use CTRL+Click to mark two file versions in this window, then click Diff to view the differences between
them.
Pin
Pins or unpins a version of the file, allowing you to define the specific file version to use when
differencing two files.
Rollback
Rolls back to the selected version of the file.
Report
Generates a history report which you can send to the printer, file, or clipboard.
Help
Opens the online help of the source control provider plugin.
If you have "pinned" one of the files in the history dialog box, then the pinned file will be used in the "Compare"
text box. Any two files can be selected using the Browse buttons.
The differences between the two files are highlighted in both windows (this example uses MS
SourceSafe).
At the time when this documentation is written, the GIT SCC plug-in is available for experimental use.
Registration with the plug-in publisher is required in order to use the plug-in.
The GIT SCC plug-in enables you to work with a Git repository using the commands available in the Project |
Source Control menu of UModel. Note that the commands in the Project | Source Control menu of UModel
are provided by the Microsoft Source Control Plug-in API (MSSCCI API), which uses a design philosophy
different from Git. As a result, the plug-in essentially mediates between "Visual Source Safe"-like functionality
and Git functionality. On one hand, this means that a command such as Get latest version may not be
applicable with Git. On the other hand, there are new Git-specific actions, which are available in the "Source
Control Manager" dialog box provided by the plug-in (under the Project | Source Control | Source Control
Manager menu of UModel).
Other commands that you will likely need to use frequently are available directly under the Project | Source
Control menu.
The following sections describe the initial configuration of the plug-in, as well as the basic workflow:
462
· Enabling Git Source Control with GIT SCC Plug-in
462
· Adding a Project to Git Source Control
464
· Cloning a Project from Git Source Control
1. Download the plug-in installation file from the publisher's website (http://www.pushok.com), run it, and
follow the installation steps.
2. On the Project menu of UModel, click Change Source Control, and make sure PushOk GITSCC is
selected as source control provider. If you do not see Push Ok GITSCC in the list of providers, it is
likely that the installation of the plug-in was not successful. In this case, check the publisher's
documentation for a solution.
3. When a dialog box prompts you to register the plug-in, click Registration and follow the wizard steps
to complete the registration process.
1. Make sure that PushOK GIT SCC Plug-in is set as source control provider (see Enabling Git Source
Control with GIT SCC Plug-in 462 ).
2. Create a new empty project and make sure that it has no validation errors (that is, the command
Project | Check Project Syntax does not show any errors or warnings).
3. Save the project to a local folder, for example C:\MyRepo\Project.ump.
4. In the Model Tree pane, click the Root node.
5. On the Project menu, under Source Control, click Add to Source Control.
6. Click OK.
You can now start adding modeling elements (diagrams, classes, packages, and so on) to your project. Note
that all project files and folders must be under the root folder of the project. For example, if the project was
created in the C:\MyRepo folder , then only files under C:\MyRepo should be added to the project. Otherwise, if
you attempt to add to your project files that are outside the project root folder, a warning message is displayed:
1. Make sure that PushOK GIT SCC Plug-in is set as source control provider (see Enabling Git Source
Control with GIT SCC Plug-in 462 ).
2. On the Project menu, click Source Control | Open from Source Control.
3. Enter the path or the URL of the source repository. Click Check to verify the validity of the path or
URL.
4. Under Local Path, enter the path to local folder where you want the project to be created, and click
Next. If the local folder exists (even if it is empty), the following dialog box opens:
Add
Action (CallBehaviorAction)
Action (CallOperationAction)
AcceptEventAction
AcceptEventAction (TimeEvent)
SendSignalAction
DecisionNode (Branch)
MergeNode
InitialNode
ActivityFinalNode
FlowFinalNode
ForkNode (vertical)
ForkNode (horizontal)
JoinNode
JoinNode (horizontal)
InputPin
OutputPin
ValuePin
ObjectNode
CentralBufferNode
DataStoreNode
ActivityPartition (horizontal)
ActivityPartition (vertical)
ActivityPartition 2-Dimensional
ControlFlow
ObjectFlow
ExceptionHandler
Activity
ActivityParameterNode
StructuredActivityNode
ExpansionRegion
ExpansionNode
InterruptibleActivityRegion
Note
Note Link
Relationship
Association
Aggregation
Composition
AssociationClass
Dependency
Usage
InterfaceRealization
Generalization
Add
Package
Class
Interface
Enumeration
Datatype
PrimitiveType
Profile
Stereotype
ProfileApplication
InstanceSpecification
Note
Note Link
Add
Lifeline
Message (Call)
Message (Reply)
Message (Creation)
Message (Destruction)
Note
Note Link
Add
Collaboration
CollaborationUse
Part (Property)
Class
Interface
Port
Relationship
Connector
Dependency (Role Binding)
InterfaceRealization
Usage
Note
Note Link
Add
Package
Interface
Class
Component
Artifact
Relationship
Realization
InterfaceRealization
Usage
Dependency
Note
Note Link
Add
Package
Component
Artifact
Node
Device
ExecutionEnvironment
Relationship
Manifestation
Deployment
Association
Generalization
Dependency
Note
Note Link
Add
CallBehaviorAction (Interaction)
CallBehaviorAction (InteractionUse)
DecisionNode
MergeNode
InitialNode
ActivityFinalNode
ForkNode
ForkNode (Horizontal)
JoinNode
JoinNode (Horizontal)
DurationConstraint
Relationship
ControlFlow
Note
Note Link
Relationship
Association
AssociationClass
Dependency
Usage
InterfaceRealization
Generalization
Add
Package
Class
Interface
Enumeration
Datatype
PrimitiveType
InstanceSpecification
Note
Note Link
Add
Package
Profile
Relationship
Dependency
PackageImport
PackageMerge
ProfileApplication
Note
Note Link
Add
Profile
Stereotype
Relationship
Generalization
ProfileApplication
PackageImport
ElementImport
Note
NoteLink
Add
Simple state
Composite state
Orthogonal state
Submachine state
FinalState
InitialState
EntryPoint
ExitPoint
Choice
Junction
Terminate
Fork
Fork (horizontal)
Join
Join (horizontal)
ConnectionPointReference
Relationship
Protocol Transition
Note
Note link
Add
Lifeline
CombinedFragment
CombinedFragment (Alternatives)
CombinedFragment (Loop)
InteractionUse
Gate
StateInvariant
DurationConstraint
TimeConstraint
Message (Call)
Message (Reply)
Message (Creation)
Message (Destruction)
Note
Note Link
No message numbering
Simple message numbering
Nested message numbering
Add
Simple state
Composite state
Orthogonal state
Submachine state
FinalState
InitialState
EntryPoint
ExitPoint
Choice
Junction
Terminate
Fork
Fork (horizontal)
Join
Join (horizontal)
DeepHistory
ShallowHistory
ConnectionPointReference
Relationship
Transition
Note
Note link
Add
Lifeline (State/Condition)
Lifeline (General value)
TickMark
Event/Stimulus
DurationConstraint
TimeConstraint
Message (Call)
Message (Reply)
Asynchronous Message (Call)
Note
Note Link
Add
Package
Actor
UseCase
Relationship
Association
Generalization
Include
Extend
Note
Note Link
Add
XSD TargetNamespace
XSD Schema
XSD Element (global)
XSD Group
XSD ComplexType
XSD ComplexType (simpleContent)
XSD SimpleType
XSD List
XSD Union
XSD Enumeration
XSD Attribute
XSD AttributeGroup
XSD Notation
XSD Import
Relationship
XSD Include
XSD Redefine
XSD Restriction
XSD Extension
XSD Substitution
Note
Note link
12 Menu Reference
The following section lists all the menus and menu options in UModel, and supplies a short description of
each.
12.1 File
New
Clears the diagram tab, if a previous project exists, and creates a new UModel project.
Open
Opens previously defined modeling project. Select a previously saved project file *.ump from the Open dialog
box. See Creating, Opening, and Saving Projects 148 and Opening Projects from a URL 149 .
Reload
Reloads the current project and saves or discards the changes made since you opened the project file.
Save
Saves the currently active modeling project using the currently active file name.
Save as
Saves the currently active modeling project with a different name, or allows you to give the project a new name
if this is the first time you save it.
Save Copy As
Saves a copy of the currently active UModel project with a different file name.
Send by Mail
Opens your default mail application and inserts the current UModel project as an attachment.
Print
Opens the Print dialog box, from where you can print out the current diagram (or a selection on the diagram) as
hard copy.
Use current retains the currently defined zoom factor of the modeling project. Selecting this option enables the
"Page split of pictures" group. Use optimal scales the modeling project to fit the page size. You can also
specify the zoom factor numerically. The Prevent option prevents modeling elements from being split over a
page, and keeps them as one unit.
Print Preview
Opens the same Print dialog box with the same settings as described above.
Print Setup
Opens the Print Setup dialog box in which you can define the printer you want to use and the paper settings.
Recent files
This section of the File menu lists up to four most recent files you have been working with.
Exit
The Exit command exist UModel. If any of your current files have unsaved changes, UModel will prompt you to
save the changes.
12.2 Edit
Undo
UModel has an unlimited number of "Undo" steps that you can use to retrace your modeling steps.
Redo
The redo command allows you to redo previously undone commands. You can step backward and forward
through the undo history using both these commands.
Cut/Copy/Paste/Delete
These are the standard Windows text editing commands. You can use them not only for text but also for
modeling elements, see Renaming, Moving, and Copying Elements 107 .
Select all
Select all modeling elements of the currently active diagram. Equivalent to the Ctrl+A shortcut.
Find
Allows you to search for specific text in the current window, see Finding and Replacing Text 109 .
Find Next F3
Searches for the next occurrence of the same search string in the currently active window.
Replace
109
Allows you to search and replace any modelling elements in the project, see Finding and Replacing Text .
Copy as Bitmap
Copies the currently active diagram to clipboard, from where you can paste it into the application of your
choice.
12.3 Project
Check Project Syntax
167
Checks the UModel project syntax, see Checking Project Syntax .
Source Control
436
See Source control systems for detailed information on source control servers and clients and how to use
them.
Merge Program Code from UModel Project / Overwrite Program Code from UModel Project
Updates program code from the model (assuming that your project is set up for code engineering, see
Generating Program Code 164 ). The name of this command can be either Merge Program Code from
UModel Project or Overwrite Program Code from UModel Project, depending on the settings in the
Synchronization Settings dialog box. By default, the Synchronization Settings dialog box opens every time
when you run this command. For more information, see Code Synchronization Settings 215 .
Merge UModel Project from Program Code / Overwrite UModel Project from Program Code
Updates the model (the UModel Project) from the program code. The name of this command can either be
Merge UModel Project from Program Code or Overwrite UModel Project from Program Code,
depending on the settings in the Synchronization Settings dialog box. By default, the Synchronization Settings
dialog box opens every time when you run this command. For more information, see Code Synchronization
Settings 215 .
Project Settings
When generating program code into a UModel project, you may want to set or change project settings 169 .
Synchronization Settings
Opens the Synchronization Settings dialog box, see Code Synchronization Settings 215 .
Merge Project
Merges two UModel project files into one model. The first file you open is the one the second file will be merged
into. Please see Merging UModel projects 268 for more information.
Include Subproject
158
See Including other UModel projects .
Clear Messages
91
Clears the syntax check and code merging messages, warnings and errors from the Messages Window .
Note: Errors are generally problems that must be fixed before code can be generated, or the model code can
be updated during the code engineering process. Warnings can generally be deferred until later. Errors
and warnings are generated by the syntax checker, the compiler for the specific language, the UModel
parser that reads the newly generated source file, as well as during the import of XMI files.
Generate Documentation
Generates documentation for the currently open project in HTML, Microsoft Word, and RTF formats, see
Generating UML documentation 277 .
12.4 Layout
The commands of the Layout menu allow you to line up and align the elements of your modeling diagrams, see
Aligning and Resizing Modeling Elements 125 .
Align
The align command allows you to align modeling elements along their borders, or centers depending on the
specific command you select.
Space Evenly
This set of commands allow you to space selected elements evenly both horizontally and vertically.
Line Up
This set of commands allow you to line up the selected elements vertically or horizontally.
Line Style
This set of commands allow you to select the type of line used to connect the various modeling elements. The
lines can be any type of dependency, association lines used in the various model diagrams.
Autosize
This command resizes the selected elements to their respective optimal size(s).
Autolayout all
This command arranges automatically the modeling elements on the diagram, using one of the options below.
The hierarchical layout options can be customized from the Tools | Options
menu, View tab, Autolayout Hierarchic group.
12.5 View
The commands available in this menu allow you to:
· Show or hide any of the UModel helper windows, see UModel Graphical User Interface 77
· Define the sort criteria of elements inside the Model Tree window 79 and Favorites window 84
12.6 Tools
The commands available in this menu allow you to:
· Customize 494 the interface: define your own toolbars, keyboard shortcuts, menus, and macros.
· Restore toolbars and windows to their default state.
· Define the global program settings/options 504 .
The User-Defined Tools | Customize command opens the Tools tab 497 of the Customize dialog (in which you
can create the custom commands that appear in the menu of the User-Defined Tools command.)
12.6.2 Customize
The Customize command displays a dialog box from where you can customize UModel to suit your personal
needs. You can customize the following entities:
· Commands 495
· Toolbars 496
· Tools 497
501
· Keyboard
502
· Menu
503
· Options
12.6.2.1 Commands
The Commands tab allows you customize UModel menus or toolbars.
Notes:
· Placing the cursor over a menu when dragging, opens it, allowing you to insert the command anywhere
in the menu.
· Commands can be placed in menus or tool bars. If you created you own toolbar, you can populate it
with your own commands/icons.
502
· You can also edit the commands in the context menus (right-click anywhere to open the context
menu), using the same method. Click the Menu tab and then select the specific context menu
available in the Context Menus combo box.
12.6.2.2 Toolbars
The Toolbars tab allows you to activate or deactivate specific toolbars, as well as create your own specialized
ones.
Toolbars contain symbols for the most frequently used menu commands. For each symbol, you get a brief "tool
tip" explanation when the mouse cursor is directly over the item and the status bar shows a more detailed
description of the command. You can drag the toolbars from their standard position to any location on the
screen, where they appear as a floating window. Alternatively, you can also dock them to the left or right edge
of the main window.
· Click the check box to activate (or deactivate) the specific toolbar.
1. Click the New... button, and give the toolbar a name in the Toolbar name dialog box.
2. Add commands to the toolbar using the Commands 495 tab of the Customize dialog box.
1. Click the Reset All button, to reset all the toolbar commands to the state they were when the program
was installed. A prompt appears stating that all toolbars and menus will be reset.
2. Click Yes to confirm the reset.
The Show text labels option places explanatory text below toolbar icons when activated.
12.6.2.3 Tools
The Tools tab allows you to create custom menu commands that can start external tools directly from UModel.
The custom menu commands that you define here appear under the menu Tools | User-defined tools.
External tools can be programs included with Windows, such as Windows Explorer (explorer.exe), Notepad
(notepad.exe), or other custom executables. You can optionally assign arguments to each user-defined tool
and set the directory where the external tool should initialize (in order to look for relative file names).
For example, the configuration illustrated below adds a new menu command called "Open Project Folder".
When run, this command will open the directory of the current UModel project in Windows Explorer.
When an external tool takes arguments (like Windows Explorer in the example above), these can be entered in
the Arguments input box. To supply multiple arguments, separate them with the space character. The values
you can supply as arguments can be plain text (hard-coded values) or be selected with the button from a
list of predefined UModel variables. You can use any of the following UModel predefined variables as
arguments:
Proj ect File Name The file name of the active UModel project file, for example
Test.ump.
Proj ect File Path The absolute file path of the active UModel project file, for
example, C:\MyDirectory\Test.ump.
Focused UML Data – Name The name of the currently focused UML element, for example,
Class1.
Focused UML Data – UML Qualified Name The qualified name of the currently focused UML element, for
example, Package1::Package2::Class1.
Focused UML Data – Code File Name The code file name of the currently focused UML class,
interface or enumeration as shown in the Property window
(relative to the realizing component), for example, Class1.cs or
MyNamespace\Class1.Java.
Focused UML Data – Code File Path The code file path of the currently focused UML class,
interface or enumeration as shown in the Property window, for
example, C:\Temp\MySource\Class1.cs.
Focused UML Data – Code Proj ect File The file name of the code project to which the currently
Name focused UML class, interface or enumeration belongs.
Focused UML Data – Code Proj ect File The file path of the code project to which the currently focused
Path UML class, interface or enumeration belongs, for example, C:
\Temp\MySource\MyProject.vcproj.
Proj ect Folder The directory where the current UModel project is saved, for
example, C:
\Users\<user>\Documents\Altova\UModel2024\UModelExa
mples\.
Temporary Folder The directory where the application's temporary files are
saved, for example, C:\Users\<user>\AppData\Local\Temp.
In some cases, you may also need to enter a value in the Initial Directory input box. For example, the
configuration below opens in Notepad the code file of the currently selected element on a diagram. (Note that,
for this command to work, the element currently selected on the diagram must have a value (file name) defined
in the code file name field of the Properties Window 85 , and that file must exist in C:
\UML_Bank_Sample\CSharpCode directory).
12.6.2.4 Keyboard
The Keyboard tab allows you to define (or change) keyboard shortcuts for any command.
1. Click the shortcut you want to delete in the Current Keys list box, and
2. Click the Remove button (which has now become active).
3. Click Close to confirm all the changes made in the Customize dialog box.
12.6.2.5 Menu
The Menu tab allows you to customize the menu bars as well as the context menus.
Customizing menus
The Default Menu bar is the menu bar that is displayed when no project is open. The UModel project menu
bar is the menu bar that is displayed when a project is open. Each menu bar can be customized separately,
and customization changes made to one do not affect the other.
To customize a menu bar, select it from the Show Menus For drop-down list. Then click the Commands tab
and drag commands from the Commands list box to the menu bar or into any of the menus.
1. Select from the Show Menus for drop-down list the menu bar that is to be customized.
2. With the Customize dialog open, select (i) the menu you want to delete from the application's menu
bar, or (ii) the command you want to delete from one of these menus.
3. Either (i) drag the menu from the menu bar or the menu command from the menu, or (ii) right-click the
menu or menu command and select Delete.
You can reset any menu bar to its original installation state by selecting it from the Show Menus For drop-
down list and then clicking the Reset button.
1. Select the context menu from the Select context menu drop-down list. This pops up the context
menu.
2. Click the Commands tab.
3. Drag a command from the Commands list box into the context menu.
4. To delete a command from the context menu, right-click that command in the context menu, and
select Delete. Alternatively, drag the command out of the context menu.
You can reset any context menu to its original installation state by selecting it in the Select context menu
drop-down list and then clicking the Reset button.
Menu shadows
Select the Menu shadows check box to give all menus shadows.
You can choose from among several menu animations if you prefer animated menus. The Menu animations
drop-down list provides the following options:
· None (default)
· Unfold
· Slide
· Fade
12.6.2.6 Options
The Options tab allows you to set general environment settings.
When active, the Show ScreenTips on toolbars check box displays a tooltip label when the mouse pointer is
placed over a toolbar button. The label contains a short description of the button function. If the Show shortcut
keys in ScreenTips check box is selected, the tooltip label displays the associated keyboard shortcut, if one
has been assigned.
When active, the Large Icons check box switches between the standard size icons, and larger versions of the
icons.
This command is useful if you have been resizing, moving, or hiding toolbars or windows, and would now like to
have all the toolbars and windows as they originally were.
12.6.4 Options
Select the menu item Tools | Options to define your project options.
· If a new Diagram created in the Model Tree tab, is also automatically opened in the main area.
· Default visibility settings when adding new elements - Properties or Operations.
· The number of items that can be automatically added to a diagram, before a prompt appears.
· The display of Styles when they are automatically added to a diagram.
· If Associations between modeling elements, are to be created automatically when items are added to a
diagram.
· If the associations to collections are to be resolved.
· If templates from unknown externals are to be resolved as not fully qualified.
· or use preexisting Collection Templates, or define new ones.
Collection Templates should be defined as fully qualified i.e. a.b.c.List. If the template has this
namespace then UModel automatically creates a Collection Association. Exception: If the template
belongs to the Unknown Externals package, and the option "Unknown externals: resolve unqualified",
is enabled, then only the template name is considered (i.e. List instead of a.b.c.List).
· If the autocompletion window is to be available when editing attributes or operations in the class
diagram.
The Code Engineering tab allows you to define the following parameters:
· The current source control plug-in using the combo box. The Advanced button allows you to define the
specific settings of the source control plug-in that you selected. These settings change depending on
the source control plug-in that you use.
· The login ID for the source control provider.
· Specific settings check in/out settings.
· The Reset button is made available if you have checked/activated the "Don't show this again" option in
one of the dialog boxes. The Don't show this again prompt is then reenabled.
512
For information about the settings available in the Network Proxy tab, see Network Proxy Settings . To find
511
out more about Java VM settings, see Java Virtual Machine Settings .
IP addresses
When host names resolve to more than one address in mixed IPv4/IPv6 networks, selecting this option causes
the IPv6 addresses to be used. If the option is not selected in such environments and IPv4 addresses are
available, then IPv4 addresses are used.
Timeout
· Transfer timeout: If this limit is reached for the transfer of any two consecutive data packages of a
transfer (sent or received), then the entire transfer is aborted. Values can be specified in seconds [s] or
milliseconds [ms], with the default being 40 seconds. If the option is not selected, then there is no time
limit for aborting a transfer.
· Connection phase timeout: This is the time limit within which the connection has to be established,
including the time taken for security handshakes. Values can be specified in seconds [s] or
milliseconds [ms], with the default being 300 seconds. This timeout cannot be disabled.
Certificate
· Verify TLS/SSL server certificate: If selected, then the authenticity of the server's certificate is checked
by verifying the chain of digital signatures until a trusted root certificate is reached. This option is
enabled by default. If this option is not selected, then the communication is insecure, and attacks (for
example, a man-in-the-middle attack) would not be detected. Note that this option does not verify that
the certificate is actually for the server that is communicated with. To enable full security, both the
certificate and the identity must be checked (see next option).
· Verify TLS/SSL server identity: If selected, then the server's certificate is verified to belong to the server
we intend to communicate with. This is done by checking that the server name in the URL is the same
as the name in the certificate. This option is enabled by default. If this option is not selected, then the
server's identify is not checked. Note that this option does not enable verification of the server's
certificate. To enable full security, both the certificate as well as the identity must be checked (see
previous option).
· Online Help, in HTML format, which is available at the Altova website. In order to access the Online
Help you will need Internet access.
· A Help file in PDF format, which is installed on your machine when you install UModel. It is named
UModel.pdf and is located in the application folder (in the Program Files folder). If you do not have
Internet access, you can always open this locally saved Help fie.
The Help option (screenshot below) enables you to select which of the two formats is opened when you click
the Help (F1) command in the Help menu.
You can change this option at any time for the new selection to take effect. The links in this section (see
screenshot above) open the respective Help format.
You may need to add a custom Java VM path, for example, if you are using a Java virtual machine which does
not have an installer and does not create registry entries (e.g., Oracle's OpenJDK). You might also want to set
this path if you need to override, for whatever reason, any Java VM path detected automatically by UModel.
· The Java VM path is shared between Altova desktop (not server) applications. Consequently, if you
change it in one application, it will automatically apply to all other Altova applications.
· The path must point to the jvm.dll file from the \bin\server or \bin\client directory, relative to the
directory where the JDK was installed.
· The UModel platform (32-bit, 64-bit) must be the same as that of the JDK.
· After changing the Java VM path, you may need to restart UModel for the new settings to take effect.
This setting does not affect Java code generation and import. Note that the Java runtimes used for importing
Java binaries into UModel can be configured separately. For more information, see Adding Custom Java
199
Runtimes .
Note: The network proxy settings are shared among all Altova MissionKit applications. So, if you change the
settings in one application, all MissionKit applications will be affected.
· HTTP Proxy: Uses the specified host name and port for the HTTP protocol. If Use this proxy server for
all protocols is selected, then the specified HTTP proxy is used for all protocols.
· SSL Proxy: Uses the specified host name and port for the SSL protocol.
· No Proxy for: A semi-colon (;) separated list of fully qualified host names, domain names, or IP
addresses for hosts that should be used without a proxy. IP addresses may not be truncated and IPv6
addresses have to be enclosed by square brackets (for example:
[2606:2800:220:1:248:1893:25c8:1946]). Domain names must start with a leading dot (for
example: .example.com).
· Do not use the proxy server for local addresses: If checked, adds <local> to the No Proxy for list. If
this option is selected, then the following will not use the proxy: (i) 127.0.0.1, (ii) [::1], (iii) all host
names not containing a dot character (.).
· Test URL: A test URL can be used to see which proxy is used for that specific URL. No I/O is done
with this URL. This field must not be empty if proxy-auto-configuration is used (either through Use
system proxy settings or Authomatic proxy configuration).
12.7 Window
Cascade
This command rearranges all open document windows so that they are all cascaded (i.e. staggered) on top of
each other.
Tile horizontally
This command rearranges all open document windows as horizontal tiles, making them all visible at the same
time.
Tile vertically
This command rearranges all open document windows as vertical tiles, making them all visible at the same
time.
Arrange icons
Arranges haphazardly positioned, iconized diagrams, along the base of the diagram viewing area.
Close
Closes the currently active diagram tab.
Close All
Closes all currently open diagram tabs.
Forward
Whenever you change focus from a diagram window to another one, or navigate a hyperlink, UModel
"remembers" this as an event. This command takes you "forward" in the history of such events. It is only
meaningful and available if you already used the Back menu command (see below).
Back
This command takes you back to the window that was previously in focus. This can be useful when you work
with many diagram windows simultaneously, or when you navigate with hyperlinks, see Hyperlinking
Elements 113 .
Windows
Displays a dialog box where you can layout or close multiple diagram windows simultaneously, see also
Diagram Pane 94 .
12.8 Help
This section describes all the menu commands available in the Help menu.
Help (F1)
The Help (F1) command opens the application's Help documentation (its user manual). By default, the
Online Help in HTML format at the Altova website will be opened.
If you do not have Internet access or do not want, for some other reason, to access the Online Help, you
can use the locally stored version of the user manual. The local version is a PDF file named UModel.pdf
that is stored in the application folder (in the Program Files folder).
If you want to change the default format to open (Online Help or local PDF), do this in the Help section of
the Options dialog (menu command Tools | Options).
Software Activation
License your product
After you download your Altova product software, you can license—or activate—it using either a free
evaluation key or a purchased permanent license key.
· Free evaluation license. When you first start the software after downloading and installing it, the
Software Activation dialog will pop up. In it is a button to request a free evaluation license. Click
it to get your license. When you click this button, your machine-ID will be hashed and sent to
Altova via HTTPS. The license information will be sent back to the machine via an HTTP response.
If the license is created successfully, a dialog to this effect will appear in your Altova application.
On clicking OK in this dialog, the software will be activated for a period of 30 days on this
particular machine.
· Permanent license key. The Software Activation dialog allows you to purchase a permanent
license key. Clicking this button takes you to Altova's online shop, where you can purchase a
permanent license key for your product. Your license will be sent to you by e-mail in the form of a
license file, which contains your license-data.
There are three types of permanent license: installed, concurrent user, and named user. An
installed license unlocks the software on a single computer. If you buy an installed license for N
computers, then the license allows use of the software on up to N computers. A concurrent-user
license for N concurrent users allows N users to run the software concurrently. (The software may
be installed on 10N computers.) A named-user license authorizes a specific user to use the
software on up to 5 different computers. To activate your software, click Upload a New License,
and, in the dialog that appears, enter the path to the license file, and click OK.
Note: For multi-user licenses, each user will be prompted to enter his or her own name.
Your license email and the different ways to license (activate) your Altova product
The license email that you receive from Altova will contain your license file as an attachment.
The license file has a .altova_licenses file extension.
You can access the Software Activation dialog (screenshot below) at any time by clicking the Help |
Software Activation command.
· Registering the license in the Software Activation dialog. In the dialog, click Upload a New
License and browse for the license file. Click OK to confirm the path to the license file and to
confirm any data you entered (your name in the case of multi-user licenses). Finish by clicking
Save.
· Licensing via Altova LicenseServer on your network: To acquire a license via an Altova
LicenseServer on your network, click Use Altova LicenseServer, located at the bottom of the
Software Activation dialog. Select the machine on which the LicenseServer you want to use has
been installed. Note that the auto-discovery of License Servers works by means of a broadcast
sent out on the LAN. As these broadcasts are limited to a subnet, License Server must be on the
same subnet as the client machine for auto-discovery to work. If auto-discovery does not work,
then type in the name of the server. The Altova LicenseServer must have a license for your Altova
product in its license pool. If a license is available in the LicenseServer pool, this is indicated in
the Software Activation dialog (see screenshot below showing the dialog in Altova XMLSpy).
Click Save to acquire the license.
After a machine-specific (aka installed) license has been acquired from LicenseServer, it cannot
be returned to LicenseServer for a period of seven days. After that time, you can return the
machine license to LicenseServer (click Return License) so that this license can be acquired
from LicenseServer by another client. (A LicenseServer administrator, however, can unassign an
acquired license at any time via the administrator's Web UI of LicenseServer.) Note that the
returning of licenses applies only to machine-specific licenses, not to concurrent licenses.
To check out a license, do the following: (i) In the Software Activation dialog, click Check out
License (see screenshot above); (ii) In the License Check-out dialog that appears, select the
check-out period you want and click Check out. The license will be checked out. After checking
out a license, two things happen: (i) The Software Activation dialog will display the check-out
information, including the time when the check-out period ends; (ii) The Check out License
button in the dialog changes to a Check In button. You can check the license in again at any
time by clicking Check In. Because the license automatically reverts to the checked-in status
after the check-out period elapses, make sure that the check-out period you select adequately
covers the period during which you will be working offline.
If the license being checked out is a Installed User license or Concurrent User license, then the
license is checked out to the machine and is available to the user who checked out the license. If
the license being checked out is a Named User license, then the license is checked out to the
Windows account of the named user. License check-out will work for virtual machines, but not for
virtual desktop (in a VDI). Note that, when a Named User license is checked out, the data to
identify that license check-out is stored in the user's profile. For license check-out to work, the
user's profile must be stored on the local machine that will be used for offline work. If the user's
profile is stored at a non-local location (such as a file-share), then the checkout will be reported as
invalid when the user tries to start the Altova application.
License check-ins must be to the same major version of the Altova product from which the license
was checked out. So make sure to check in a license before you upgrade your Altova product to
the next major version.
Note: For license check-outs to be possible, the check-out functionality must be enabled on
LicenseServer. If this functionality has not been enabled, you will get an error message to this
effect when you try to check out. In this event, contact your LicenseServer administrator.
Altova LicenseServer provides IT administrators with a real-time overview of all Altova licenses on a
network, together with the details of each license as well as client assignments and client usage of
licenses. The advantage of using LicenseServer therefore lies in administrative features it offers for large-
volume Altova license management. Altova LicenseServer is available free of cost from the Altova website.
For more information about Altova LicenseServer and licensing via Altova LicenseServer, see the Altova
LicenseServer documentation.
Order Form
When you are ready to order a licensed version of the software product, you can use either the Purchase
a Permanent License Key button in the Software Activation dialog (see previous section) or the Order
Form command to proceed to the secure Altova Online Shop.
Registration
Opens the Altova Product Registration page in a tab of your browser. Registering your Altova software will
help ensure that you are always kept up to date with the latest product information.
Support Center
A link to the Altova Support Center on the Internet. The Support Center provides FAQs, discussion forums
where problems are discussed, and access to Altova's technical support staff.
to Application Server Platforms. The software available at the Component Download Center is typically free
of charge.
About UModel
Displays the splash window and version number of your product. If you are using the 64-bit version of
UModel, this is indicated with the suffix (x64) after the application name. There is no suffix for the 32-bit
version.
13 SPL Reference
This section gives you an overview of SPL (Spy Programming Language), code generator's template language.
It is assumed that you have prior programming experience, and are familiar with operators, functions, variables
and classes, as well as the basics of object-oriented programming - which is used heavily in SPL.
The templates used by UModel are supplied in the applications's UModelSPL folder. You can use these files as
a guide to developing your own templates.
The template file is interpreted by the code generator and outputs the source-code files of the target language/s
(that is, the non-compiled code files) and any other relevant project file or template-dependent file.
Code generator instructions are enclosed in square brackets '[' and ']'. Multiple statements can be included in a
bracket pair. Additional statements have to be separated by a new line or a colon ':'.
[$x = 42
$x = $x + 1]
or
[$x = 42: $x = $x + 1]
To output literal square brackets, escape them with a backslash: \[ and \]; to output a backslash use \\.
Comments
Comments inside an instruction block always begin with a ' character, and terminate on the next line, or at a
block close character ].
13.2 Variables
Any non-trivial SPL file will require variables. Some variables are predefined by the code generator, and new
variables may be created simply by assigning values to them.
The $ character is used when declaring or using a variable, a variable name is always prefixed by $. Variable
names are case sensitive.
Variables types:
· integer - also used as boolean, where 0 is false and everything else is true
· string
· object - provided by UModel
· iterator - see foreach 535 statement
[$x = 0]
x is now an integer.
[$x = "teststring"]
Strings
String constants are always enclosed in double quotes, like in the example above. \n and \t inside double
quotes are interpreted as newline and tab, \" is a literal double quote, and \\ is a backslash. String constants
can also span multiple lines.
Objects
Objects represent the information contained in the UModel project. Objects have properties, which can be
accessed using the . operator. It is not possible to create new objects in SPL (they are predefined by the code
generator, derived from the input), but it is possible to assign objects to variables.
Example:
class [=$class.Name]
This example outputs the word "class", followed by a space and the value of the Name property of the $class
object.
The following table shows the relationship between UML elements their SPL equivalents along with a short
description.
Predefined variables
UML element SPL property Multiplicity UML Attribute / UModel Attribute / Description
Association Association
UML element SPL property Multiplicity UML Attribute / UModel Attribute / Description
Association Association
UML element SPL property Multiplicity UML Attribute / UModel Attribute / Description
Association Association
UML element SPL property Multiplicity UML Attribute / UModel Attribute / Description
Association Association
UML element SPL property Multiplicity UML Attribute / UModel Attribute / Description
Association Association
All new coding elements are written using the SPL templates. For example, if you open UModelSPL\C#[Java]
\Default\Attribute.spl, you can change the way the name is written. Namely, you can replace
write $Property.name
with
It is highly recommended that you immediately update your model from code after code generation, to ensure
that code and model are synchronized.
Note: As previously mentioned, copy the SPL templates one directory higher (i.e. above the default directory
to UModelSPL\C#) before modifying them. This ensures that they are not overwritten when you install
a new version of UModel. Please make sure that the "user-defined override default" check box is
activated in the Code from Model tab of the "Synchronization Settings" dialog box.
SPL Templates
SPL templates can be specified per UModel project using the menu option Project | Project Settings (as
shown in the screenshot below). Relative paths are also supported. Templates which are not found in the
specified directory, are searched for in the local default directory.
Global objects
$Options an object holding global options:
$Indent a string used to indent generated code and represent the current nesting level
$IndentStep a string, used to indent generated code and represent one nesting level
integer Compare(s)
The return value indicates the lexicographic relation of the string to s (case sensitive):
integer CompareNoCase(s)
The return value indicates the lexicographic relation of the string to s (case insensitive):
integer Find(s)
Searches the string for the first match of a substring s. Returns the zero-based index of the first character of s
or -1 if s is not found.
string Left(n)
Returns the first n characters of the string.
integer Length()
Returns the length of the string.
string MakeUpper()
Returns a string converted to upper case.
string MakeUpper(n)
Returns a string, with the first n characters converted to upper case.
string MakeLower()
Returns a string converted to lower case.
string MakeLower(n)
string Mid(n)
Returns a string starting with the zero-based index position n
string Mid(n,m)
Returns a string starting with the zero-based index position n and the length m
string RemoveLeft(s)
Returns a string excluding the substring s if Left( s.Length() ) is equal to substring s.
string RemoveLeftNoCase(s)
Returns a string excluding the substring s if Left( s.Length() ) is equal to substring s (case insensitive).
string RemoveRight(s)
Returns a string excluding the substring s if Right( s.Length() ) is equal to substring s.
string RemoveRightNoCase(s)
Returns a string excluding the substring s if Right( s.Length() ) is equal to substring s (case insensitive).
string Repeat(s,n)
Returns a string containing substring s repeated n times.
string Right(n)
Returns the last n characters of the string.
13.3 Operators
Operators in SPL work like in most other programming languages.
* Multiply
/ Divide
% Modulo
+ Add
- Subtract
= Equal
<> Not equal
= Assignment
13.4 Conditions
SPL allows you to use standard "if" statements. The syntax is as follows:
if condition
statements
else
statements
endif
if condition
statements
endif
Example:
Switch
SPL also contains a multiple choice statement.
Syntax:
switch $variable
case X:
statements
case Y:
case Z:
statements
default:
statements
endswitch
The switch statement in SPL does not fall through the cases (as in C), so there is no need for a "break"
statement.
Syntax:
Example:
Example 2:
[foreach $i in 1 To 3
Write "// Step " & $i & "\n"
‘ Do some work
next]
Foreach steps through all the items in $classes, and executes the code following the instruction, up to the
next statement, for each of them.
In each iteration, $class is assigned to the next class object. You simply work with the class object instead of
using, classes[i]->Name(), as you would in C++.
Example:
endif
]"[=$enum.Value]"[
next]
returns a collection whose elements are sorted by name (case sensitive) in ascending or descending order.
returns a collection whose elements are sorted by name (case insensitive) in ascending or descending order
Example:
$SortedNestedClassifier = $Class.nestedClassifier.SortByNameNoCase( true )
returns a collection whose elements are sorted by kind names (e.g. “Class”, “Interface”,…) in ascending or
descending order.
returns a collection whose elements are sorted by kind (e.g. “Class”, “Interface”,…) in ascending or descending
order and if the kinds are equal by name (case sensitive in ascending or descending order)
returns a collection whose elements are sorted by kind (e.g. “Class”, “Interface”,…) in ascending or descending
order and if the kinds are equal by name (case insensitive in ascending or descending order)
13.6 Subroutines
Code generator supports subroutines in the form of procedures or functions.
Features:
Subroutines
Syntax example:
Sub SimpleSub()
... lines of code
EndSub
Note: Recursive or cascaded subroutine declaration is not permitted, i.e. a subroutine may not contain
another subroutine.
Parameters
Parameters can also be passed by procedures using the following syntax:
Syntax:
· ByVal specifies that the parameter is passed by value. Note that most objects can only be passed by
reference.
· ByRef specifies that the parameter is passed by reference. This is the default if neither ByVal nor
ByRef is specified.
Example:
Call SimpleSub()
or
Function invocation
To invoke a function (any subroutine that contains a return statement), simply use its name inside an
expression. Do not use the call statement to call functions. Example:
14 License Information
This section contains information about:
Please read this information carefully. It is binding upon you since you agreed to these terms when you
installed this software product.
To view the terms of any Altova license, go to the Altova Legal Information page at the Altova website.
· You can evaluate the software free-of-charge for 30 days before making a purchasing decision. (Note:
Altova MobileTogether Designer is licensed free of charge.)
· Once you decide to buy the software, you can place your order online at the Altova website and get a
fully licensed product within minutes.
· When you place an online order, you always get the latest version of our software.
· The product package includes an onscreen help system that can be accessed from within the
application interface. The latest version of the user manual is available at www.altova.com in (i) HTML
format for online browsing, and (ii) PDF format for download (and to print if you prefer to have the
documentation on paper).
Your Altova product has a built-in license metering module that further helps you avoid any unintentional
violation of the End User License Agreement. Your product is licensed either as a single-user or multi-user
installation, and the license-metering module makes sure that no more than the licensed number of users use
the application concurrently.
This license-metering technology uses your local area network (LAN) to communicate between instances of the
application running on different computers.
Single license
When the application starts up, as part of the license metering process, the software sends a short broadcast
datagram to find any other instance of the product running on another computer in the same network segment.
If it doesn't get any response, it will open a port for listening to other instances of the application.
Multi-user license
If more than one instance of the application is used within the same LAN, these instances will briefly
communicate with each other on startup. These instances exchange key-codes in order to help you to better
determine that the number of concurrent licenses purchased is not accidentally violated. This is the same kind
of license metering technology that is common in the Unix world and with a number of database development
tools. It allows Altova customers to purchase reasonably-priced concurrent-use multi-user licenses.
We have also designed the applications so that they send few and small network packets so as to not put a
burden on your network. The TCP/IP ports (2799) used by your Altova product are officially registered with the
IANA (see the IANA Service Name Registry for details) and our license-metering module is tested and proven
technology.
If you are using a firewall, you may notice communications on port 2799 between the computers that are
running Altova products. You are, of course, free to block such traffic between different groups in your
organization, as long as you can ensure by other means, that your license agreement is not violated.
If your organization needs to use its own certificate (for example, to monitor communication to and from client
machines), then we recommend that you install Altova's free license management software, Altova
LicenseServer, on your network. Under this setup, client machines can continue to use your organization's
certificates, while Altova LicenseServer can be allowed to use the Altova certificate for communication with
Altova.
Index Align,
elements when dragging, 18
snap lines when dragging, 504
All,
expand / collapse, 379
. Artifact,
add to node, 55
.NET 5, manifest, 55
as UModel profile, 158 Association,
importing types from binaries, 96 aggregate/composite, 27
support, 11 as relationship, 130
.NET Core, 11 between classes, 27
importing assemblies, 203 changing the properties of, 133
.NET Framework, 158 creating, 130, 133
importing assemblies, 203 object links, 42
reflexive associations, 133
show typed property, 275
3 use case, 18
viewing, 133
3-way project, Association qualifier,
merge, 268 creating, 133
Associations,
viewing, 87
Attribute,
A autocompletion window, 504
coloring, 384
Abstract, show / hide, 379
class, 27 Autocomplete,
Activation box, function, 27
Execution Specification, 346 Autocompletion,
Activity, window on class editing, 504
Add diagram to transition, 308 Autocompletion of data types,
Add operation, 308 disabling, 127
Add to state, 308 triggering, 127
create branch / merge, 293 Autogenerate,
diagram elements, 295 reply message, 352
icons, 467 Automatially add operation, 308
Activity diagram, 289
inserting elements, 290
Actor,
customize, 18 B
user-defined, 18
Add, 451 Ball and socket,
diagram to package, 18 interface notation, 379
new project, 147 Base,
package to project, 18 class, 36
project to source control, 451 Base class,
Diagram, 397
icon reference, 79
icons, 466
ignore elem. from inluded files, 504 E
inserting elements into, 105
Edit menu,
multiple instances of class, 379
commands, 487
quick scroll, 89
Element,
save as png, 485
add to Favorites, 84
save open diagrams with project, 504
styles, 86
styles, 86
ElementImport,
viewing an outline of, 89
viewing, 87
XML Schema, 416
Elements,
Diagram Tree window, 83
adding to a diagram, 105
Diagram type,
adding to the model, 79, 104
identifying, 93
aligning within a diagram, 125
Diagrams, 288
applying custom images to, 117
behavioral, 289
autolayout, 125
changing the appearance of, 123
changing properties of, 85
changing the size of, 123
changing the appearance of, 117
creating, 93, 119
constraining, 112
deleting from project, 123
copying, 107
fit into window, 129
deleting from diagram, 108
generating, 120
deleting from project, 108
generating from Hierarchy window, 87
documenting, 90, 116
opening, 122
finding, 109
structural, 379
finding in a diagram, 111
viewing inside a project, 83
hyperlinking, 113
zoom in/out, 129
ignore from include files, 504
Directory,
insert State Machine, 307
change project location, 147
moving, 107
ignoring on merge, 504
renaming, 107
Disable source control, 444
replacing, 109
Distribution,
resizing, 125
of Altova's software products, 539, 540
Enable source control, 444
Documentation,
End User License Agreement, 539, 543
adding to elements, 116
Enhance,
generate from UML project, 277
performance, 163
generating source code with, 116
Entry point,
importing from source code, 116
add to submachine, 315
Documentation window, 90
Errors,
Download source control project, 441
during code engineering, 91
Drid,
Evaluation period,
snap lines while dragging, 18
of Altova's software products, 539, 540
DurationConstraint,
Event/Stimulus,
Timing diagram, 376
Timing diagram, 375
Exception,
Adding raised exception, 379
Location, Multiline, 18
move project, 147 Multi-line,
actor text, 18
interactionOperand, 348
use case, 18
M
Mail,
send project, 485
Manifest,
N
artifact, 55 Name,
Menu, region names - hide / show, 315
add/delete command, 495 New,
Merge, classifier, 212
3-way manual project merge, 270 New line,
3-way project merge, 268 in Lifeline, 335
create in Activity, 293 ineractionOperand, 348
ignore directory, 504 Node,
projects, 268 add, 55
Message, 352 add artifact, 55
arrows, 352 styles, 86
call, 352 Numbering,
create object, 352 messages, 352
go to operation, 352
inserting, 352
moving, 352
numbering, 352 O
Timing diagram, 377
Object,
Messages window,
create message, 352
reference, 91
diagram, 42
Method,
icons, 475
Add raised exception, 379
links - associations, 42
Methods,
Object diagram, 397
getter / setter, 379
Open Project,
Model,
source control, 441
adding elements to, 79, 104
OpenJDK,
changing class name - effect in Java, 214
importing binaries, 199
Model Tree window,
Operand,
expanding or collapsing items, 79
interaction, 348
exploring the project from, 79
Operation,
icon reference, 79
autocompletion window, 504
showing or hiding items, 79
Automatically add on Activity, 308
sorting items, 79
coloring, 384
Modeling,
goto from call message, 352
enhance performance, 163
overriding, 379
Move,
reusing, 36
project, 147
show / hide, 379
Moving message arrows, 352
R S
Raised exception, Save,
Adding, 379 diagram as image, 485
Realization, SC,
component, 49 syntax coloring, 384
generate ComponentRealizations, 212 Search,
Refactoring code, diagrams, 109
class names - synchronization, 214 elements, 109
Reference, 484 text, 109
Refresh status, Send by mail,
source control, 459 project, 485
Region, Sequence,
add to composite state, 315 icons, 479
Region name, Sequence diagram, 343
show / hide, 315 adding code to, 367
Reject source edits, 449 combined fragment, 348
Relationships, gate, 351
aggregation, 130 generate code from, 364
association, 105, 130 generate from Communication diag., 335
changing the style of, 131 inserting elements, 344
composition, 130 interaction use, 351
dependency, 130 lifeline, 346
generalization, 105, 130 messages, 352
realization, 130 state invariant, 352
viewing, 133 Sequence diagrams,
Remove, generating from getters/setters, 362
from source control, 453 generating from source code, 358
Rename, generating multiple, 362
classifier, 212 Set,
Reply, getter / setter methods, 379
message - autogenerate, 352 Setting,
Reset, synchronization, 211
toolbar & menu commands, 496 Settings,
Restore, source control, 504
toolbars and windows, 494 Share,
Reverse engineering, 69 from source control, 454
Root, Shortcut,
as package, 107 show in tooltip, 503
catalog - XMLSpy, 504 Shortcuts,
package/class synchronization, 211 assigning, 501
Run native interface, 459 deleting, 501
Show,
hide - slot, 379
hide- region name, 315
V
Variables,
UML, 524
VB.NET,
code generation options, 169
code import options, 188
generating code, 164
import binary files, 198
importing source code, 186
Version control,
commands, 441
View,
to multiple instances of element, 379
View menu,
commands, 493
Visibility,
icons - selecting, 379
W
Warnings,
during code engineering, 91
Windows,
restore to default, 494
Workflow,
project, 147
Working directory,