Create, read and modify a list, using a Loop determined by length of content
PRESENTATION
This tutorial is an introduction to the creation of loops and the use of Complex Types in Designer. You will be guided through the process of extracting the content of a list, using the Trigger Activity element. Then, you will learn how to modify the list, by adding or removing lines or modifying the content of the lines.
Prerequisites
- Have done the tutorial Start to use Sim4Sys with a simple model (blackbox),
- Concept on C++, in particular on the vector.
Skills that you will acquire
On Designer:
- use a Complex Data Type and some vector's operations from C++,
- model a Loop via the utilisation of Trigger Activities.
On Virtual Bench:
- define a mapping with a Complex Data Type as parameter.
Duration
2h30
CREATE THE MODEL
- Create a model called "LoopTest"
- Create a new project called "LoopProject"
- Create a service called "LoopV1"
- Create a life phase Standard use in "LoopV1"
Create a Complex Data Type
In the Type Diagram, add two New DataTypes:
- UserDescriptionType: with the Attributes name, surname and information. All three have Type: TextType and Multiplicity: One
- UserListType: with the Attribute UserList. Type: UserDescriptionType and Multiplicity: Many

Create the Use Cases
In the Use Case Diagram, create:
- a New actor called "User",
- new use cases called "Inform about members" (where the content of the list is read and extracted during the loop) and "Modify the list"