tpc 3.3.0 uml&sysml features tutorial

34
TOPCASED 3.3.0 UML/SysML features tutorial Raphaël Faudou Benjamin Marconato

Upload: guillermo-avila

Post on 21-Apr-2015

42 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: TPC 3.3.0 UML&SysML Features Tutorial

TOPCASED 3.3.0 UML/SysML features tutorial

Raphaël FaudouBenjamin Marconato

Page 2: TPC 3.3.0 UML&SysML Features Tutorial

2 Topcased UML/SysML editor Tutorial

Agenda

• Prerequisites

• What’s new in this tutorial

• Create a new TOPCASED project/model

• Import Primitive Types

• Specialization of items – UML profile

• Show/hide properties and operation parameters

• Complete a transition in a state machine

• XMI import procedure

• Why can’t I see elements I used to see in TOPCASED 3.2 and older ?

Page 3: TPC 3.3.0 UML&SysML Features Tutorial

3 Topcased UML/SysML editor Tutorial

Requesites

• This tutorial supposes that you have read the generic « Quick start editor tutorial »

• Generic capabilities offered by TOPCASED editors will not be covered here

• Only UML/SysML specific features are presented in next slides

Page 4: TPC 3.3.0 UML&SysML Features Tutorial

4 Topcased UML/SysML editor Tutorial

What’s new since previous tutorial (3.0)

• Improved effect selection on transition and improved tutorial description

• Better conformance of activity diagram with UML Specification

• Create an event for a trigger through transition properties view

• Edit/Reach a behavior from a call behavior action

• Import primitive types

• FAQ section

• You can consult the release note to find all news on TOPCASED 3.3.0: http://gforge.enseeiht.fr/frs/download.php/2609/ReleaseNote3.3.0.pdf

Page 5: TPC 3.3.0 UML&SysML Features Tutorial

5 Topcased UML/SysML editor Tutorial

Create a new UML model (1/2)

• Blank model or a model created based on a template (structure and diagrams) Different templates according to the editor Possibility to add other custom templates (plug-in)

Page 6: TPC 3.3.0 UML&SysML Features Tutorial

6 Topcased UML/SysML editor Tutorial

Create a new model (2/2)

Two files

Model data (stored in xxx.uml)

Diagram data (stored in xxx.umldi, with

reference to xxx.uml)

UML model and diagram data, available

in the outline view

Graphical model-based editor

Property view, contextual to the selection

Page 7: TPC 3.3.0 UML&SysML Features Tutorial

7 Topcased UML/SysML editor Tutorial

Import Primitive Types

• I create an element in TOPCASED

and i want to reference a standard primitive type.

• Some of them are already defined in platform. You can import them using import primitive types action Right click on a package and select import primitive types

- You can also generate them using Generate Primitive Types (only available on model)

Page 8: TPC 3.3.0 UML&SysML Features Tutorial

8 Topcased UML/SysML editor Tutorial

Specialization of items – UML profile (1/8)

• Create a new UML model based on the « Profile » template

• Example : « architectureProfile »

Page 9: TPC 3.3.0 UML&SysML Features Tutorial

9 Topcased UML/SysML editor Tutorial

Specialization of items – UML profile (2/8)

• Create stereotypes and indicate the items to which they are applicable Relation with meta class

• Possibility of describing the properties of a stereotype

• Possibility of inheriting between stereotypes

• Save the profile Save the profile Accept “Define the profile

before saving”

Page 10: TPC 3.3.0 UML&SysML Features Tutorial

10 Topcased UML/SysML editor Tutorial

Specialization of items – UML profile (3/8)

• Referencing the profile Load the model of the profile on the main model

- Select the model from the « outline » view- Contextual menu « load resource »- Select the profile model (.uml extension)

Page 11: TPC 3.3.0 UML&SysML Features Tutorial

11 Topcased UML/SysML editor Tutorial

Specialization of items – UML profile (4/8)

• Application of the profile to the model Select the model from « outline » view and from « apply profile »

- The “ArchitectureProfile” profile is then available

Page 12: TPC 3.3.0 UML&SysML Features Tutorial

12 Topcased UML/SysML editor Tutorial

Specialization of items – UML profile (5/8)

• Select an item in the diagram Select the stereotype from the properties view and apply it The specific properties of the stereotype are then available

Page 13: TPC 3.3.0 UML&SysML Features Tutorial

13 Topcased UML/SysML editor Tutorial

Specialization of items – UML profile (6/8)

• You can apply a stereotype to several elements Select several use cases using the Control key Select the stereotype from the properties view and apply it

Note that the available stereotypes are filtered depending on the selected element types.

Page 14: TPC 3.3.0 UML&SysML Features Tutorial

14 Topcased UML/SysML editor Tutorial

Specialization of items – UML profile (7/8)

• Customize figure’s element using stereotype Define a stereotype and add

an image

Change stereotypes preferences : select “As an Icon” inWindow > Preferences > Topcased > UML/SysML > All Diagrams >

Stereotype

Apply the stereotype on element.

Page 15: TPC 3.3.0 UML&SysML Features Tutorial

15 Topcased UML/SysML editor Tutorial

Specialization of items – UML profile (8/8)

• At Sysml model creation, Sysml Activity extensions profile is automatically applied

• For existing model : right click on sysml model > topcased > other > Apply Sysml Activity extensions profile (You must close the editor first).

Page 16: TPC 3.3.0 UML&SysML Features Tutorial

16 Topcased UML/SysML editor Tutorial

Show/hide properties and operation parameters (1/4)

• The example will be based on a simple class. Create a new Class in the Class Diagram Add Properties & Operations Add Parameters to the Operations (These operations can be performed from

the Parameters panel of the Properties View when an Operation is selected)

Page 17: TPC 3.3.0 UML&SysML Features Tutorial

17 Topcased UML/SysML editor Tutorial

Show/hide properties and operation parameters (2/4)

• Options to Hide/Show elements of this class are accessible from the ‘Graphics’ panel of the Properties View. First you need to select the element. In our example, select the new class. In the Properties View, select the Graphics tab. Two columns named « Visible Elements » and « Hidden Elements » are

available. « Hide », « Show » buttons slide elements from one column to the other.

Page 18: TPC 3.3.0 UML&SysML Features Tutorial

18 Topcased UML/SysML editor Tutorial

Show/hide properties and operation parameters (3/4)

• Result when ‘showOperationParameterType’ is in the ‘Hidden Element’ column

• Default values of the parameters are now hidden

Page 19: TPC 3.3.0 UML&SysML Features Tutorial

19 Topcased UML/SysML editor Tutorial

Show/hide properties and operation parameters (4/4)

• Result when ‘showOperationParameters’ is in the ‘Hidden Element’ column

• Parameters of all the operations are now hidden

Page 20: TPC 3.3.0 UML&SysML Features Tutorial

20 Topcased UML/SysML editor Tutorial

Complete a transition in a state machine(1/4)

• Add a trigger to a transition You can create or select an event in the model (Call event, Signal Event…) Add a trigger with the trigger tab in the property view of a transition. Refer in this view to the event.

Page 21: TPC 3.3.0 UML&SysML Features Tutorial

21 Topcased UML/SysML editor Tutorial

Complete a transition in a state machine(2/4)

• Add an effect to a transition Add an activity in the Effect tab in the property view of a transition. Select an existing behavior or create a new one The behavior name is added to the transition

• WARNING: if you want to remove an effect, keep in mind that the associated behavior will be removed too as it is a composite element (linked to effect) Suggestion: instead of selecting the empty behavior, move the effect behavior through the

outline the effect is removed and you do not loose the behavior description

Page 22: TPC 3.3.0 UML&SysML Features Tutorial

22 Topcased UML/SysML editor Tutorial

Complete a transition in a state machine(3/4)

• Add an OCL guard to a transition Create a guard in the guard tab of property view of a transition. Select Constraint, then select « Create an OCL Expression ».

Then, this pop-up is displayed, it helps for typing OCL guards.

Page 23: TPC 3.3.0 UML&SysML Features Tutorial

23 Topcased UML/SysML editor Tutorial

Complete a transition in a state machine(4/4)

• Putting all pieces together

Page 24: TPC 3.3.0 UML&SysML Features Tutorial

24 Topcased UML/SysML editor Tutorial

Better UML2 conformance for activity diagram (1/6)

• CallBehaviorAction requires a behavior (to have a valid model) User is now guided to associate behavior at creation time He(she) is immediately required to select existing behavior or create an activity The resulting action has both a name and the behavior displayed

- Both in diagram and in outline Note: the action name has less semantics than the activity. That is why a “a1”

name is suggested

Page 25: TPC 3.3.0 UML&SysML Features Tutorial

25 Topcased UML/SysML editor Tutorial

Better UML2 conformance for activity diagram (2/6)

• New options exist for callBehaviorAction in the preferences select project properties>TOPCASED>Editors>UML/SysML… Check the “synchronize pins with activity parameters”

Page 26: TPC 3.3.0 UML&SysML Features Tutorial

26 Topcased UML/SysML editor Tutorial

Better UML2 conformance for activity diagram (3/6)

• Now, with pin/parameter synchronization, when creating an input pin or output pin on a callBehaviorAction, a dialog box asks the user to select an existing activity parameter or to create a new one matching the pin

• ActivityParameterNode is only created with diagram initialization. Synchronization is not in live mode

Page 27: TPC 3.3.0 UML&SysML Features Tutorial

27 Topcased UML/SysML editor Tutorial

Better UML2 conformance for activity diagram (4/6)

• Now, check the “show parameters” preference Note : in some cases, you may experience

an exception (bug) but it works

• The callBehaviorAction now shows pins as parameters in the activity call Note: in that case, you can decide not to

show pin labels (graphical tab)

Page 28: TPC 3.3.0 UML&SysML Features Tutorial

28 Topcased UML/SysML editor Tutorial

• Same conformance is applied by default for CallOperationAction When selecting an operation, pins are automatically created to match

operation parameters

Better UML2 conformance for activity diagram (5/6)

Page 29: TPC 3.3.0 UML&SysML Features Tutorial

29 Topcased UML/SysML editor Tutorial

Better UML2 conformance for activity diagram (6/6)

• You can set values on parameters if needed Values are refreshed in the diagram for primitive types

Page 30: TPC 3.3.0 UML&SysML Features Tutorial

30 Topcased UML/SysML editor Tutorial

Edit/Reach a behavior from a call behavior

• You can now edit the behavior name or even reach its properties through the properties of a call behavior action. Click on display button to reach the behavior properties

Page 31: TPC 3.3.0 UML&SysML Features Tutorial

31 Topcased UML/SysML editor Tutorial

XMI import procedure (1/2)

• To import an XMI file into Topcased:

select File > Import > File System

Choose the folder that contains your xmi file, select the checkbox and finish

Right click on the file in Package Explorer

Open with > Text Editor

Replace all occurrences of this URI:

http://schema.omg.org/spec/UML/2.1.1

by this one:

http://www.eclipse.org/uml2/2.1.0/UML

for TOPACSED 2.5.0

http://www.eclipse.org/uml2/3.0.0/UML

for TOPCASED 3.0.0

Then save your file as UML file:

File > Save As > fileName.uml

Page 32: TPC 3.3.0 UML&SysML Features Tutorial

32 Topcased UML/SysML editor Tutorial

• You can now open your file with UML Editor

Right click > Open with > UML Editor

• You can create the graphical part of your model. Look at this tutorial to know how: http://gforge.enseeiht.fr/docman/view.php/7/279/TPC_2.4_Java_Reverse_tutorial.pdf, slide 7

• Some remaining errors can occur deploying the model tree. These are identified with error messages and markers. Main parts of these errors are unavailable resources that are referenced in the model.

XMI import procedure (2/2)

Page 33: TPC 3.3.0 UML&SysML Features Tutorial

33 Topcased UML/SysML editor Tutorial

Frequently Asked Questions

• I have an “index out of bounds” exception when I close my diagrams file. What should I do ? If your model has been initialized before TOPCASED 3.3 and contains controlled element you can use

“clean controlled diagrams” script (Right click on DI > TOPCASED > Other > clean controlled diagrams). When a diagram was contained in wrong resource, close the diagrams file could throw this exception. This script will move diagrams in the proper resource.

• Why can’t I see elements I used to see in TOPCASED 3.2 and older ? A new politic of elements proposed to user is defined since TOPCASED 3.3

- In any choose dialog, the elements proposed are elements contained in the current model or in controlled packages.

- The elements from additional resources displayed are :• Elements linked to an “element import” element• Elements contained in a package linked to a “package import” element

- The complete list of elements is available if the property

is filled through Advanced Properties section

Page 34: TPC 3.3.0 UML&SysML Features Tutorial

34 Topcased UML/SysML editor Tutorial

Frequently Asked Questions

To create- An element import, right click on a package, create child > element import and in advanced

properties section fill the property “imported element”- A package import, right click on a package, create child > package import and in advanced

properties section fill the property “imported package”