Design the communication between two systems
PRESENTATION
The aim of this tutorial is to show you how to create a smart washing machine model. You will learn about model interactions, textual requirement generation and good practices proper to the processes of modelling.
Prerequisites
Have done the tutorial Include a matlab activity in a model.
News skills that you will acquire
On Designer:
- Link between User Stories,
- Concept on Inter System.
On Virtual Bench:
- Use a new Context elements: Hour display, SVG, ComboBox,
- Create model to model mappings,
- Use SVG in our library,
- Use multiple executables in a scenario, via our Launcher.
Duration
5h
INTRODUCTION
In this tutorial we are going to design a smart washing machine. The washing machine will have the possibility to be controlled from a Smart Device, which means the two systems will have to communicate with each other. To create our model, we will follow the same steps for each Use Case:
- Creation of the Use Case in Sim4Sys Designer: first the diagram which corresponds to the washing machine, then the one for the Smart Device (as communication between them is needed).
- Modeling of our Use Case by using Sim4Sys Virtual Bench: upload flows and creating the corresponding mapping.
- Requirement template generation: it is a good practice to generate our requirement template right after finishing every Use Case.
We will assume that you are already acquainted with some of the Sim4Sys Designer and Sim4Sys Virtual Bench procedures, but you will be able to check the documentation site to help you on the way.
WASHING MACHINE MODEL
[Sim4Sys Designer] Create the washing machine model
To start this tutorial you will have to create a new model.
- Create a new papyrus project model named "SmartWashingMachine". To do that, you can refer to New Model.
- Create a new projet "WashingMachine" (which will corresponds to the machine itself) (cf New Project)
- Create a service called "LaundryCleaning".(cf New Service)
- Create your Life Phase "Standard Use". (cf. Add a life phase to a service)
Create the states
Our washing machine will have two possible states: "On" and "Off".
Go to the LaundryCleaning StateMachine.
- Rename the FirstState to "Off". This will be the washing machine's initial state (when starting the simulation, the machine is turned off).
- Create a new state called "On". It will occur when the washing machine is turned on. Later in this tutorial you will create a second project called "SmartDevice" to allocate the elements of the device communicating with the washing machine.
[Sim4Sys Designer] Use case - Switch on
First of all, you will create the Use Case "Switch on" which allows you to shift the washing machine from the state "Off" to "On" at the user's request.
- Go to your LaundryCleaning service in the Life Phase Standard Use and click on Complete Use Cases (UCD).
- Drag&Drop an actor on the diagram and select User.
- Drag&Drop a new Use Case and name it "Switch On". You can create a link with the User if you want.
After following the previous steps, you should get a diagram of this nature:

[Sim4Sys Designer] USER STORY - The user switches on the washing machine.
In this Use Case the user will turn on the machine. When turning on, the washing machine should display useful information on its screen and activate a red pilot light.
- In LaundryCleaning service, more specifically inside the Life Phase Standard Use and the Use Case Switch On, create a User Story called "The user switches on the washing machine". (cf. how to create a User Story in a Use Case).
This User Story will have two Lifelines.
- Delete the one called Environment.
- Delete the Lifeline User.
- Drag&Drop the User lifeline with the stick figure symbol. This will be important for requirements generation.
- Drag and drop the State Off on the service lifeline (cf. State)
- Trace a flow between the user and "LaundryCleaning" and create your interface and flow as follows.

Go back to the Switch On user story.
- Retrace a flow between the User and your service, and select the flow you just created.
- Trace the rest of the flows and internal activities in order to get a diagram like the one below.
- Add the state On to the Lifeline LaundryCleaningBB. Don't forget to generate your diagram when it is complete.
- To generate the state machine right click on your diagram's background -> Edit -> Generate State Machines.
[Sim4Sys Designer] Use case - Switch off
You will now consider the case where the user turns off the washing machine.
- Go to your LaundryCleaning service in the Life Phase Standard Use and click on Complete Use Cases (UCD).
- Drag&Drop a new Use Case and name it "Switch Off". You can create a link with the User if you want.
After following the previous steps, you should get a diagram of this nature:

[Sim4Sys Designer] USER STORY - The user switches off the washing machine
-
In LaundryCleaning service, more specifically inside the Life Phase Standard Use and the Use Case Switch Off, create a User Story called "The user switches off the washing machine".
-
Do the same changes as before regarding the lifeline.
-
Trace the following diagram.
Don't forget to generate your diagram when it is complete.