UML Generators — User Guide

Version 0.9.0.201511201014

Table of Contents

  1. Getting Started
    1. Installing UML Generators
    2. UML Design of a RTSJ application
      1. Services Declaration
      2. Component Definition
      3. Component Instantiation
      4. Communication between components
      5. UML Class Property as array of primitive types
      6. UML Class Property as object or array of objects
      7. State machines
      8. Communication Protocol Configuration
    3. Launching a code generation
  2. Stereotypes applicable with the RTSJ profile
    1. On a UML Package
    2. On a UML Interface
    3. On a UML Class
    4. On a UML Property
    5. On a UML Operation
    6. On a UML Reception
    7. On a UML Port

Getting Started

Installing UML Generators

PENDING

UML Design of a RTSJ application

Whatever the chosen graphical UML editor, you have to model your RTSJ application respecting some design rules in order that the UML data are correctly interpreted by the code generator. Besides, this allows you to be understood by all the users of this tool.

Services Declaration

The services to expose have to be defined in UML Interfaces.

According to the nature of the UML Interface, these services will be modeled as UML Operation or UML Reception:

When you create a UML Reception, you have to set the signal property with a previously created UML Signal which contains potential UML Property parameters.

Component Definition

You can define a component definition creating a UML Class with a UML Port inside at least.

Then, on each of its input ports, you have to set the type property with the UML Interface which provides the services to expose through this port.

Component Instantiation

In the context of your applicative system to design, you are going to instantiate your components from the definitions and to choose to make them communicate from some way.

Your system has to be represented by a UML Class stereotyped <<Root>>.

The instantiation of a component is modeled, in this UML Class, by a UML Property which references the component definition with the type property.

Communication between components

To make communicate two components through an output and input port, you have to:

UML Class Property as array of primitive types

You have to set several properties for your UML Property:

For example, if you want to model a "buffer" UML Property, in a UML Class, as an array of byte with a max size equals to Constants.TELECOMMAND_MAX_LENGTH, you have to:

So, this code will be generated:

private byte[] buffer = new byte[Constants.TELECOMMAND_MAX_LENGTH];

UML Class Property as object or array of objects

For a unary cardinality, you can set the default property with the Java code to initialize this attribute (without ";" at the end).

For example, if you want to model a "station" UML Property, in a UML Class, you have to:

So, this code will be generated:

public Station station = new Station();

For a multiple cardinality, the default property has to be used to define the size of the array (like the primitive types). In this case, the aggregation property has to be set as "Composite".

For example, if you want to model a "stations" UML Property, in a UML Class, as an array of Station with a max size equals to Constants.MISSION_HDSTATIONLIST_LENGTH, you have to:

So, this code will be generated:

@part
public Station[] stations = new Station[Constants.MISSION_HDSTATIONLIST_LENGTH];
{
	for (int i = 0; i < stations.length; i++) {
		stations[i] = new Station();
	}
}

State machines

A UML State Machine can be created on any UML Class.

PENDING

Communication Protocol Configuration

To apply an Ethernet configuration on your UML model for the code generation, you have to create an ETH model:

File > New > Other... > Example EMF Model Creation Wizards > Eth Model

Then, you have to load the resource related to the UML model you want to configure, from this ETH model:

Right click on the background of the ETH model editor > Load Resource...

Then, select the UML Connectors you want to apply an Ethernet configuration:

Note: The label of the displayed UML Connectors could be improved. The component instance name should be displayed instead of the component definition one.

Then, create an Ethernet container to address your component instances concerned by this kind of communication:

Then, define the related components to locate under this Ethernet container and specify the IP Address and port number:

Only the components concerned by an Ethernet connector will be proposed on the left side of this wizard.

Launching a code generation

2 steps are required to launch a code generation:

Right click on the UML model you want to take as input of the generation > Properties > Uml2AutojavaComponent section. 
This configuration will be stored on the current workspace. So, it will be saved for next generations.
Right click on the UML model you want to take as input of the generation. Then, you have the choice between 3 options:
1. Generate Autojava Components (only communication) : It generates only the code related to the communication between the component instances.
2. Generate Autojava Components (only components) : It generates only the code related to the components themselves.
3. Generate Autojava Components (All) : It generates the 2 parts.

Stereotypes applicable with the RTSJ profile

On a UML Package

On a UML Interface

On a UML Class

On a UML Property

On a UML Operation

On a UML Reception

On a UML Port

Part of UML Generators Documentation

Version 0.9.0.201511201014