SlideShare a Scribd company logo
No Magic World Symposium, Allen TX
Ed Seidewitz
Model Driven Solutions, Inc. ● http://www.modeldriven.com
ed-s@modeldriven.com ● @Seidewitz
http://slideshare.net/seidewitz
Copyright © 2018 Ed Seidewitz
Using the Alf Action Language
with Cameo Simulation Toolkit
Part 2 – Modeling
Page 2
About me
Ed Seidewitz
Chief Technology Officier, Model Driven Solutions, Inc.
ed-s@modeldriven.com ● @seidewitz
• 30 years experience as a project manager,
architect, developer and modeler
• Involved with UML since version 0.8
• Developer of fUML and Alf Reference
Implementations and MagicDraw Alf Plugin
• Chair of the OMG fUML and Alf Revision Task
Forces; member of the UML Revision Task Force
Copyright © 2018 Ed Seidewitz
Page 3
Goals
Part 1 – Basics (Sunday)
• Learn the basics of the Alf action language for Executable UML.
• Use the Alf Plugin for MagicDraw.
• Practice using Alf with Cameo Simulation Toolkit.
Part 2 – Modeling (Today)
• Model simulations using the Alf action language.
• Use Alf in class and state machine models in MagicDraw.
• Creating and run simulations using Alf with Cameo Simulation
Toolkit.
Copyright © 2018 Ed Seidewitz
Page 4
Prerequisites (for Part 2)
• Participant
– Basic knowledge of class, activity and state machine modeling
using MagicDraw
– Some experience with model execution using Cameo Simulation
Toolkit
– Introductory understanding of using Alf in CST (e.g., from Part 1 of
this tutorial)
• System (for hands-on exercises)
– MagicDraw 18.5
– Cameo Simulation Toolkit 18.5sp3
– Alf plugin 18.5
Install MagicDraw, CST and Alf Plugin on line or from USB stick
Copyright © 2018 Ed Seidewitz
Page 5
5
Installing the Alf plugin
Copyright © 2018 Ed Seidewitz
Plugin documentation is available at:
https://docs.nomagic.com/display/ALFP185/Alf+plugin
Under Plugins
(commercial),
download / install the
Alf plugin v18.5.
Select Help ► Resource/Plugin
Manager to open the Resource/
Plugin Manager window.
 A new version will be
available for the 19.0
release.
Or click here to install
from USB stick.
Page 6
Class Models
Copyright © 2018 Ed Seidewitz
Page 7
Object creation and property access
Copyright © 2018 Ed Seidewitz
order = new Order();
order.product = aProduct;
order.quantity = aQuantity;
order.amount = aQuantity * aProduct.price;
Create a new Order.
Set the properties
of the new order.
aCustomer.orders->add(order);
totalAmount =
aCustomer.orders.amount->
reduce RealFunctions::'+' ?? 0.0;
Add the new order to
an existing customer.
Navigate associations to
compute total amount.
 A reduce expression “inserts” a binary
function into the elements of a sequence.
 Properties must be public
to be accessible.
A property access
Page 8
Operations and methods
Copyright © 2018 Ed Seidewitz
this.product = product;
this.quantity = quantity;
return this.quantity * this.product.price;
this.orders->add(order);
return this.orders.getAmount()->
reduce RealFunctions::'+' ?? 0.0;
 The behavior that implements an operation
is called its method.
An operation call
Page 9
Operation invocations
Copyright © 2018 Ed Seidewitz
order = new Order(aQuantity, aProduct);
amount = order.getAmount();
aCustomer.addOrder(order);
totalAmount = aCustomer.getTotalAmount();
A constructor can be used to create an
object with initialization.
A constructor operation
has the standard Create
stereotype applied.
 Operation calls are synchronous invocations.
The caller waits until the operation method
execution completes.
Page 10
Hands On
Address Book
Copyright © 2018 Ed Seidewitz
Page 11
Create the Address Book project
Copyright © 2018 Ed Seidewitz
In the Alf folder,
select the Alf
template.
Under Other,
select Project
from Template.
Select File ► New Project to
open the project creation window.
Create an Address
Book project.
Page 12
Create the Address Book class model
Copyright © 2018 Ed Seidewitz
Make sure these Entry
attributes are public.
Give this association
end a multiplicity of *.
Page 13
Are you using SysML?
Copyright © 2018 Ed Seidewitz
 CST and Alf assume the use
of the UML primitive types.
But SysML provides primitive
value types that are different
than the UML primitive types.
Value properties have to
have value types, so String
here is the SysML type.
Remove the ValueProperty
stereotype and change the type to
the UML primitive type.
✗
✗
 This is resolved in v19.0 for
both CST and Alf.
Page 14
Create Address Book and Entry operations
Copyright © 2018 Ed Seidewitz
Create a constructor operation in
the usual way, and then apply
the standard Create stereotype.
Page 15
Create the Entry constructor method
Copyright © 2018 Ed Seidewitz
Right click on the Entry
operation and select
Create Method ►
Behavior to open this
selection window.
Choose either
Activity or
Opaque Behavior.
Enter code in the Alf
editor window to
initialize an Entry.
Page 16
Create Address Book operation methods
Copyright © 2018 Ed Seidewitz
Create methods for
the AddressBook
operations, and then
enter the Alf code
shown for them.
 A select expression is used to filter
a sequence based on a condition.
The index [1] ensures that at most
one value is selected.
 This expression will return either a
single value or null, as required by
the return multiplicity of 0..1.
 The constructor
operation is used when
creating an instance of
the Entry class.
 The braces { } are
required in if statement
clauses in Alf.
Page 17
Test the Address Book model
Copyright © 2018 Ed Seidewitz
Create an
AddressBookTest
activity with the
Alf code below.
 The ?? (null-coalescing) operator is
used here because get has return
multiplicity 0..1 and the + operator
requires argument multiplicity 1..1.
Run the activity
and see if it works!
Page 18
State Machine Models
Copyright © 2018 Ed Seidewitz
Page 19
Classifier behaviors
Copyright © 2018 Ed Seidewitz
A signal reception declares
the ability of instances of a
class to handle a signal.
A state machine can be
attached to a class as a
classifier behavior.
The state machine reacts to
signals that are sent to
instances of its context class.
Page 20
Transition and state behaviors
Copyright © 2018 Ed Seidewitz
Alf can be used to define
transition and state behaviors
in state machines.
Page 21
Signal sending
Copyright © 2018 Ed Seidewitz
fan = new Fan();
fan.TurnOn();
fan.TurnOff();
A signal send has a similar syntax to
operation calls, but referencing a
signal reception, rather than an
operation.
The state machine starts running
when an object is created.
 A signal can only be sent using Alf
to an object whose class has a
reception declared for the signal.
 Signal sends are asynchronous
invocations. The sender continues
immediately after the signal is sent.
Page 22
Hands On
Heating Simulation
Copyright © 2018 Ed Seidewitz
Page 23
Create the Heating Simulation project
Copyright © 2018 Ed Seidewitz
In the Alf folder,
select the Alf
template.
Under Other,
select Project
from Template.
Select File ► New Project to
open the project creation window.
Create a Heating
Simulation project.
Page 24
Create the model package structure
Copyright © 2018 Ed Seidewitz
Page 25
Create Environment and House classes
Copyright © 2018 Ed Seidewitz
Create three signals...
…and use them to declare
signal receptions.
Make this attribute
public.
Make this association
composite.
Make this operation
private.
Give both association
ends names.
Page 26
Create the Environment state machine
Copyright © 2018 Ed Seidewitz
Page 27
Add triggers to transitions
Copyright © 2018 Ed Seidewitz
Page 28
Create opaque behavior
Copyright © 2018 Ed Seidewitz
Under Effect, set the
Behavior Type to
Opaque Behavior.
Page 29
Add Alf code
Copyright © 2018 Ed Seidewitz
 A signal is sent by invoking the
signal reception on the target
object.
Click on the transition to enter
code for its effect behavior in
the Alf editor window.
Create an opaque
behavior and add Alf code
for this transition, too.
Page 30
Create the House state machine
Copyright © 2018 Ed Seidewitz
Page 31
Create the cool method
Copyright © 2018 Ed Seidewitz
Right click on the cool operation
and select Create Method ►
Behavior to open the Behavior
selection window.
Enter the Alf code in
the Alf editor window.
Choose either
Activity or
Opaque Behavior.
 The braces { } are
required in if statement
clauses in Alf.
Page 32
Coming in v19.0!
Copyright © 2018 Ed Seidewitz
Access event data
in transition and
state behaviors.
Page 33
Create an instance model
Copyright © 2018 Ed Seidewitz
Add a link for the Environment-
House composite association.
Be sure to create
slots for both ends.
Right click on the
Environment instance and
select Simulation ► Run
to execute the model.
Page 34
Add a Heater class
Copyright © 2018 Ed Seidewitz
Add new signals.
Add new reception.
Add new operation.
Make this
attribute public.
Make this
association
composite.
Add new attribute.
Page 35
Update the House state machine
Copyright © 2018 Ed Seidewitz
Add a new transition
triggered by the Heat
signal with Alf code to
call the heat operation.
Create a method behavior
for the heat operation.
Page 36
Create the Heater state machine
Copyright © 2018 Ed Seidewitz
Page 37
Update the instance model
Copyright © 2018 Ed Seidewitz
Add a Heater instance and
a link of the House-Heater
composite association.
Right click on the
Environment instance and
select Simulation ► Run
to execute the model again.
Page 38
Add a Thermostat class
Copyright © 2018 Ed Seidewitz
Make this
association
composite.
Add a new attribute.
This
association is
not composite.
Page 39
Update the Heater state machine
Copyright © 2018 Ed Seidewitz
Use the isOn attribute
to record which state
the Heater is in.
 There is no built-in way in
Alf to determine what state
a state machine is in.
Page 40
Create the monitor method
Copyright © 2018 Ed Seidewitz
Page 41
Are you using SysML?
Copyright © 2018 Ed Seidewitz
Alf currently cannot be
used to send a signal
via a specified port.
 To be resolved through
further integration of
Alf with composite
structure semantics.
Page 42
Update the House state machine
Copyright © 2018 Ed Seidewitz
Double click on the running
state (as a whole) to open
its specification window.
Under Entry, set the
Behavior Type to
Opaque Behavior.
Click on just the entry behavior
line and enter code in the Alf
editor window.
Page 43
Update the instance model
Copyright © 2018 Ed Seidewitz
Add a Thermostat instance
and links to the House and
Heater instances.
Right click on the
Environment instance and
select Simulation ► Run
to execute the model again.

More Related Content

What's hot (20)

SiriusCon2016 - ASML's MDE Going Sirius
SiriusCon2016 - ASML's MDE Going SiriusSiriusCon2016 - ASML's MDE Going Sirius
SiriusCon2016 - ASML's MDE Going Sirius
Obeo
 
Tailoring Arcadia Framework in Thales UK
Tailoring Arcadia Framework in Thales UKTailoring Arcadia Framework in Thales UK
Tailoring Arcadia Framework in Thales UK
Obeo
 
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UICustomizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Tech OneStop
 
Oracle unified-method
Oracle unified-methodOracle unified-method
Oracle unified-method
Sam Elrashedy
 
Using folder options for page protection
Using folder options for page protectionUsing folder options for page protection
Using folder options for page protection
Kranthi Kumar
 
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
Angel Alberici
 
Technical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part IITechnical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part II
Ashish Saxena
 
CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...
CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...
CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...
Obeo
 
FDMEE Tutorial - Part 1
FDMEE Tutorial - Part 1FDMEE Tutorial - Part 1
FDMEE Tutorial - Part 1
Van Huy
 
Modular Trade Studies with SysML Simulation.pptx
Modular Trade Studies with SysML Simulation.pptxModular Trade Studies with SysML Simulation.pptx
Modular Trade Studies with SysML Simulation.pptx
David Hetherington
 
Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...
Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...
Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...
Obeo
 
From SADT to SysML
From SADT to SysMLFrom SADT to SysML
From SADT to SysML
Pascal Roques
 
ASP.NET Core: The best of the new bits
ASP.NET Core: The best of the new bitsASP.NET Core: The best of the new bits
ASP.NET Core: The best of the new bits
Ken Cenerelli
 
Dissecting SysML v2.pptx
Dissecting SysML v2.pptxDissecting SysML v2.pptx
Dissecting SysML v2.pptx
Elizabeth Steiner
 
Siebel CRM: Open UI
Siebel CRM: Open UISiebel CRM: Open UI
Siebel CRM: Open UI
Ilya Milshtein
 
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
Obeo
 
[Capella Day 2019] Model execution and system simulation in Capella
[Capella Day 2019] Model execution and system simulation in Capella[Capella Day 2019] Model execution and system simulation in Capella
[Capella Day 2019] Model execution and system simulation in Capella
Obeo
 
Adapter Design Pattern
Adapter Design PatternAdapter Design Pattern
Adapter Design Pattern
melbournepatterns
 
User exit training
User exit trainingUser exit training
User exit training
Jen Ringel
 
System of systems modeling with Capella
System of systems modeling with CapellaSystem of systems modeling with Capella
System of systems modeling with Capella
Obeo
 
SiriusCon2016 - ASML's MDE Going Sirius
SiriusCon2016 - ASML's MDE Going SiriusSiriusCon2016 - ASML's MDE Going Sirius
SiriusCon2016 - ASML's MDE Going Sirius
Obeo
 
Tailoring Arcadia Framework in Thales UK
Tailoring Arcadia Framework in Thales UKTailoring Arcadia Framework in Thales UK
Tailoring Arcadia Framework in Thales UK
Obeo
 
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UICustomizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Tech OneStop
 
Oracle unified-method
Oracle unified-methodOracle unified-method
Oracle unified-method
Sam Elrashedy
 
Using folder options for page protection
Using folder options for page protectionUsing folder options for page protection
Using folder options for page protection
Kranthi Kumar
 
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
Angel Alberici
 
Technical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part IITechnical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part II
Ashish Saxena
 
CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...
CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...
CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...
Obeo
 
FDMEE Tutorial - Part 1
FDMEE Tutorial - Part 1FDMEE Tutorial - Part 1
FDMEE Tutorial - Part 1
Van Huy
 
Modular Trade Studies with SysML Simulation.pptx
Modular Trade Studies with SysML Simulation.pptxModular Trade Studies with SysML Simulation.pptx
Modular Trade Studies with SysML Simulation.pptx
David Hetherington
 
Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...
Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...
Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...
Obeo
 
ASP.NET Core: The best of the new bits
ASP.NET Core: The best of the new bitsASP.NET Core: The best of the new bits
ASP.NET Core: The best of the new bits
Ken Cenerelli
 
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
Obeo
 
[Capella Day 2019] Model execution and system simulation in Capella
[Capella Day 2019] Model execution and system simulation in Capella[Capella Day 2019] Model execution and system simulation in Capella
[Capella Day 2019] Model execution and system simulation in Capella
Obeo
 
User exit training
User exit trainingUser exit training
User exit training
Jen Ringel
 
System of systems modeling with Capella
System of systems modeling with CapellaSystem of systems modeling with Capella
System of systems modeling with Capella
Obeo
 

Similar to Using Alf with Cameo Simulation Toolkit - Part 2: Modeling (20)

Chapter 08
Chapter 08Chapter 08
Chapter 08
llmeade
 
Simulation using model sim
Simulation using model simSimulation using model sim
Simulation using model sim
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Alfresco - You probably didn't know that
Alfresco - You probably didn't know thatAlfresco - You probably didn't know that
Alfresco - You probably didn't know that
David Ciamberlano
 
Diving into VS 2015 Day4
Diving into VS 2015 Day4Diving into VS 2015 Day4
Diving into VS 2015 Day4
Akhil Mittal
 
MoodLocator HwT
MoodLocator HwTMoodLocator HwT
MoodLocator HwT
JDihlmann
 
Inteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for CodeInteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for Code
Luciano Resende
 
UCD components
UCD components UCD components
UCD components
IBM Rational software
 
C 4 Aspnet 4 And Wpf With Visual Studio 2010 Jump Start Christian Nagel
C 4 Aspnet 4 And Wpf With Visual Studio 2010 Jump Start Christian NagelC 4 Aspnet 4 And Wpf With Visual Studio 2010 Jump Start Christian Nagel
C 4 Aspnet 4 And Wpf With Visual Studio 2010 Jump Start Christian Nagel
tixierpipun63
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
mwillmer
 
Functional programming in Java
Functional programming in Java  Functional programming in Java
Functional programming in Java
Haim Michael
 
Diving into VS 2015 Day3
Diving into VS 2015 Day3Diving into VS 2015 Day3
Diving into VS 2015 Day3
Akhil Mittal
 
Day1 Lab1
Day1 Lab1Day1 Lab1
Day1 Lab1
Ron Liu
 
Create New Android Activity
Create New Android ActivityCreate New Android Activity
Create New Android Activity
Transpose Solutions Inc
 
Rethink Frontend Development With Elm
Rethink Frontend Development With ElmRethink Frontend Development With Elm
Rethink Frontend Development With Elm
Brian Hogan
 
How to Use Sim CFD (to your advantage): A Primer for Computational Fluid Dyna...
How to Use Sim CFD (to your advantage): A Primer for Computational Fluid Dyna...How to Use Sim CFD (to your advantage): A Primer for Computational Fluid Dyna...
How to Use Sim CFD (to your advantage): A Primer for Computational Fluid Dyna...
Synergis Engineering Design Solutions
 
Application Frameworks an Experience Report
Application Frameworks an Experience ReportApplication Frameworks an Experience Report
Application Frameworks an Experience Report
ESUG
 
Use of Classes and functions#include iostreamusing name.docx
 Use of Classes and functions#include iostreamusing name.docx Use of Classes and functions#include iostreamusing name.docx
Use of Classes and functions#include iostreamusing name.docx
aryan532920
 
Standards-Based Executable UML: Today's Reality and Tomorrow's Promise
Standards-Based Executable UML: Today's Reality and Tomorrow's PromiseStandards-Based Executable UML: Today's Reality and Tomorrow's Promise
Standards-Based Executable UML: Today's Reality and Tomorrow's Promise
Ed Seidewitz
 
Vb introduction.
Vb introduction.Vb introduction.
Vb introduction.
sagaroceanic11
 
Debugger & Profiler in NetBeans
Debugger & Profiler in NetBeansDebugger & Profiler in NetBeans
Debugger & Profiler in NetBeans
Huu Bang Le Phan
 
Chapter 08
Chapter 08Chapter 08
Chapter 08
llmeade
 
Alfresco - You probably didn't know that
Alfresco - You probably didn't know thatAlfresco - You probably didn't know that
Alfresco - You probably didn't know that
David Ciamberlano
 
Diving into VS 2015 Day4
Diving into VS 2015 Day4Diving into VS 2015 Day4
Diving into VS 2015 Day4
Akhil Mittal
 
MoodLocator HwT
MoodLocator HwTMoodLocator HwT
MoodLocator HwT
JDihlmann
 
Inteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for CodeInteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for Code
Luciano Resende
 
C 4 Aspnet 4 And Wpf With Visual Studio 2010 Jump Start Christian Nagel
C 4 Aspnet 4 And Wpf With Visual Studio 2010 Jump Start Christian NagelC 4 Aspnet 4 And Wpf With Visual Studio 2010 Jump Start Christian Nagel
C 4 Aspnet 4 And Wpf With Visual Studio 2010 Jump Start Christian Nagel
tixierpipun63
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
mwillmer
 
Functional programming in Java
Functional programming in Java  Functional programming in Java
Functional programming in Java
Haim Michael
 
Diving into VS 2015 Day3
Diving into VS 2015 Day3Diving into VS 2015 Day3
Diving into VS 2015 Day3
Akhil Mittal
 
Day1 Lab1
Day1 Lab1Day1 Lab1
Day1 Lab1
Ron Liu
 
Rethink Frontend Development With Elm
Rethink Frontend Development With ElmRethink Frontend Development With Elm
Rethink Frontend Development With Elm
Brian Hogan
 
How to Use Sim CFD (to your advantage): A Primer for Computational Fluid Dyna...
How to Use Sim CFD (to your advantage): A Primer for Computational Fluid Dyna...How to Use Sim CFD (to your advantage): A Primer for Computational Fluid Dyna...
How to Use Sim CFD (to your advantage): A Primer for Computational Fluid Dyna...
Synergis Engineering Design Solutions
 
Application Frameworks an Experience Report
Application Frameworks an Experience ReportApplication Frameworks an Experience Report
Application Frameworks an Experience Report
ESUG
 
Use of Classes and functions#include iostreamusing name.docx
 Use of Classes and functions#include iostreamusing name.docx Use of Classes and functions#include iostreamusing name.docx
Use of Classes and functions#include iostreamusing name.docx
aryan532920
 
Standards-Based Executable UML: Today's Reality and Tomorrow's Promise
Standards-Based Executable UML: Today's Reality and Tomorrow's PromiseStandards-Based Executable UML: Today's Reality and Tomorrow's Promise
Standards-Based Executable UML: Today's Reality and Tomorrow's Promise
Ed Seidewitz
 
Debugger & Profiler in NetBeans
Debugger & Profiler in NetBeansDebugger & Profiler in NetBeans
Debugger & Profiler in NetBeans
Huu Bang Le Phan
 

More from Ed Seidewitz (18)

Introduction to the OMG Systems Modeling Language (SysML), Version 2
Introduction to the OMG Systems Modeling Language (SysML), Version 2Introduction to the OMG Systems Modeling Language (SysML), Version 2
Introduction to the OMG Systems Modeling Language (SysML), Version 2
Ed Seidewitz
 
The Very Model of a Modern Metamodeler
The Very Model of a Modern MetamodelerThe Very Model of a Modern Metamodeler
The Very Model of a Modern Metamodeler
Ed Seidewitz
 
SysML v2 and the Next Generation of Modeling Languages
SysML v2 and the Next Generation of Modeling LanguagesSysML v2 and the Next Generation of Modeling Languages
SysML v2 and the Next Generation of Modeling Languages
Ed Seidewitz
 
SysML v2 and MBSE: The next ten years
SysML v2 and MBSE: The next ten yearsSysML v2 and MBSE: The next ten years
SysML v2 and MBSE: The next ten years
Ed Seidewitz
 
Precise Semantics Standards at OMG: Executing on the Vision
Precise Semantics Standards at OMG: Executing on the VisionPrecise Semantics Standards at OMG: Executing on the Vision
Precise Semantics Standards at OMG: Executing on the Vision
Ed Seidewitz
 
Model Driven Architecture without Automation
Model Driven Architecture without AutomationModel Driven Architecture without Automation
Model Driven Architecture without Automation
Ed Seidewitz
 
UML: This Time We Mean It!
UML: This Time We Mean It!UML: This Time We Mean It!
UML: This Time We Mean It!
Ed Seidewitz
 
A Unified View of Modeling and Programming
A Unified View of Modeling and ProgrammingA Unified View of Modeling and Programming
A Unified View of Modeling and Programming
Ed Seidewitz
 
UML as a Programming Language
UML as a Programming LanguageUML as a Programming Language
UML as a Programming Language
Ed Seidewitz
 
Executable UML Roadmap (as of September 2014)
Executable UML Roadmap (as of September 2014)Executable UML Roadmap (as of September 2014)
Executable UML Roadmap (as of September 2014)
Ed Seidewitz
 
Essence: A Common Ground for Flexible Methods
Essence: A Common Ground for Flexible MethodsEssence: A Common Ground for Flexible Methods
Essence: A Common Ground for Flexible Methods
Ed Seidewitz
 
UML: Once More with Meaning
UML: Once More with MeaningUML: Once More with Meaning
UML: Once More with Meaning
Ed Seidewitz
 
Succeeding with Agile in the Federal Government: A Coach's Perspective
Succeeding with Agile in the Federal Government: A Coach's PerspectiveSucceeding with Agile in the Federal Government: A Coach's Perspective
Succeeding with Agile in the Federal Government: A Coach's Perspective
Ed Seidewitz
 
UML 2.5: Specification Simplification
UML 2.5: Specification SimplificationUML 2.5: Specification Simplification
UML 2.5: Specification Simplification
Ed Seidewitz
 
Models, Programs and Executable UML
Models, Programs and Executable UMLModels, Programs and Executable UML
Models, Programs and Executable UML
Ed Seidewitz
 
Architecting Your Enterprise
Architecting Your EnterpriseArchitecting Your Enterprise
Architecting Your Enterprise
Ed Seidewitz
 
Programming in UML: Why and How
Programming in UML: Why and HowProgramming in UML: Why and How
Programming in UML: Why and How
Ed Seidewitz
 
Executable UML and SysML Workshop
Executable UML and SysML WorkshopExecutable UML and SysML Workshop
Executable UML and SysML Workshop
Ed Seidewitz
 
Introduction to the OMG Systems Modeling Language (SysML), Version 2
Introduction to the OMG Systems Modeling Language (SysML), Version 2Introduction to the OMG Systems Modeling Language (SysML), Version 2
Introduction to the OMG Systems Modeling Language (SysML), Version 2
Ed Seidewitz
 
The Very Model of a Modern Metamodeler
The Very Model of a Modern MetamodelerThe Very Model of a Modern Metamodeler
The Very Model of a Modern Metamodeler
Ed Seidewitz
 
SysML v2 and the Next Generation of Modeling Languages
SysML v2 and the Next Generation of Modeling LanguagesSysML v2 and the Next Generation of Modeling Languages
SysML v2 and the Next Generation of Modeling Languages
Ed Seidewitz
 
SysML v2 and MBSE: The next ten years
SysML v2 and MBSE: The next ten yearsSysML v2 and MBSE: The next ten years
SysML v2 and MBSE: The next ten years
Ed Seidewitz
 
Precise Semantics Standards at OMG: Executing on the Vision
Precise Semantics Standards at OMG: Executing on the VisionPrecise Semantics Standards at OMG: Executing on the Vision
Precise Semantics Standards at OMG: Executing on the Vision
Ed Seidewitz
 
Model Driven Architecture without Automation
Model Driven Architecture without AutomationModel Driven Architecture without Automation
Model Driven Architecture without Automation
Ed Seidewitz
 
UML: This Time We Mean It!
UML: This Time We Mean It!UML: This Time We Mean It!
UML: This Time We Mean It!
Ed Seidewitz
 
A Unified View of Modeling and Programming
A Unified View of Modeling and ProgrammingA Unified View of Modeling and Programming
A Unified View of Modeling and Programming
Ed Seidewitz
 
UML as a Programming Language
UML as a Programming LanguageUML as a Programming Language
UML as a Programming Language
Ed Seidewitz
 
Executable UML Roadmap (as of September 2014)
Executable UML Roadmap (as of September 2014)Executable UML Roadmap (as of September 2014)
Executable UML Roadmap (as of September 2014)
Ed Seidewitz
 
Essence: A Common Ground for Flexible Methods
Essence: A Common Ground for Flexible MethodsEssence: A Common Ground for Flexible Methods
Essence: A Common Ground for Flexible Methods
Ed Seidewitz
 
UML: Once More with Meaning
UML: Once More with MeaningUML: Once More with Meaning
UML: Once More with Meaning
Ed Seidewitz
 
Succeeding with Agile in the Federal Government: A Coach's Perspective
Succeeding with Agile in the Federal Government: A Coach's PerspectiveSucceeding with Agile in the Federal Government: A Coach's Perspective
Succeeding with Agile in the Federal Government: A Coach's Perspective
Ed Seidewitz
 
UML 2.5: Specification Simplification
UML 2.5: Specification SimplificationUML 2.5: Specification Simplification
UML 2.5: Specification Simplification
Ed Seidewitz
 
Models, Programs and Executable UML
Models, Programs and Executable UMLModels, Programs and Executable UML
Models, Programs and Executable UML
Ed Seidewitz
 
Architecting Your Enterprise
Architecting Your EnterpriseArchitecting Your Enterprise
Architecting Your Enterprise
Ed Seidewitz
 
Programming in UML: Why and How
Programming in UML: Why and HowProgramming in UML: Why and How
Programming in UML: Why and How
Ed Seidewitz
 
Executable UML and SysML Workshop
Executable UML and SysML WorkshopExecutable UML and SysML Workshop
Executable UML and SysML Workshop
Ed Seidewitz
 

Recently uploaded (20)

wAIred_LearnWithOutAI_LunchAndLearn_27052025.pptx
wAIred_LearnWithOutAI_LunchAndLearn_27052025.pptxwAIred_LearnWithOutAI_LunchAndLearn_27052025.pptx
wAIred_LearnWithOutAI_LunchAndLearn_27052025.pptx
SimonedeGijt
 
Top 5 Odoo Modules for the EPC Industry.pdf
Top 5 Odoo Modules for the EPC Industry.pdfTop 5 Odoo Modules for the EPC Industry.pdf
Top 5 Odoo Modules for the EPC Industry.pdf
SatishKumar2651
 
Scaling up your Snapshot tests, without the friction
Scaling up your Snapshot tests, without the frictionScaling up your Snapshot tests, without the friction
Scaling up your Snapshot tests, without the friction
arnold844201
 
Building AI agents with Java and LangChain4j
Building AI agents with Java and LangChain4jBuilding AI agents with Java and LangChain4j
Building AI agents with Java and LangChain4j
Julien Dubois
 
Contractor Hot Work Permit Software for Work Safety
Contractor Hot Work Permit Software for Work SafetyContractor Hot Work Permit Software for Work Safety
Contractor Hot Work Permit Software for Work Safety
SHEQ Network Limited
 
Improving Engagement with CRM Software for Instance Agents
Improving Engagement with CRM Software for Instance AgentsImproving Engagement with CRM Software for Instance Agents
Improving Engagement with CRM Software for Instance Agents
Insurance Tech Services
 
Frontier AI Regulation: What form should it take?
Frontier AI Regulation: What form should it take?Frontier AI Regulation: What form should it take?
Frontier AI Regulation: What form should it take?
Petar Radanliev
 
Shortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome ThemShortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome Them
TECH EHS Solution
 
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdfBoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
Web Application Development A Comprehensive Guide for 2025.pdf
Web Application Development A Comprehensive Guide for 2025.pdfWeb Application Development A Comprehensive Guide for 2025.pdf
Web Application Development A Comprehensive Guide for 2025.pdf
Secuodsoft
 
Getting Started with BoxLang - CFCamp 2025.pdf
Getting Started with BoxLang - CFCamp 2025.pdfGetting Started with BoxLang - CFCamp 2025.pdf
Getting Started with BoxLang - CFCamp 2025.pdf
Ortus Solutions, Corp
 
Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025
Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025
Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025
BradBedford3
 
system-and-network-administration pptx-.pdf
system-and-network-administration pptx-.pdfsystem-and-network-administration pptx-.pdf
system-and-network-administration pptx-.pdf
Tof Abdu
 
Techdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk takerTechdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk taker
RajaNagendraKumar
 
TUG Brazil - VizQL Data Service - Nik Dutra.pdf
TUG Brazil - VizQL Data Service - Nik Dutra.pdfTUG Brazil - VizQL Data Service - Nik Dutra.pdf
TUG Brazil - VizQL Data Service - Nik Dutra.pdf
Ligia Galvão
 
German Marketo User Group - May 2025 survey results
German Marketo User Group - May 2025 survey resultsGerman Marketo User Group - May 2025 survey results
German Marketo User Group - May 2025 survey results
BradBedford3
 
Playwright, Cypress, or TestGrid: A Feature-by-Feature Breakdown for Test Aut...
Playwright, Cypress, or TestGrid: A Feature-by-Feature Breakdown for Test Aut...Playwright, Cypress, or TestGrid: A Feature-by-Feature Breakdown for Test Aut...
Playwright, Cypress, or TestGrid: A Feature-by-Feature Breakdown for Test Aut...
Shubham Joshi
 
Key Characteristics of High-Performing Insurance Broker Software
Key Characteristics of High-Performing Insurance Broker SoftwareKey Characteristics of High-Performing Insurance Broker Software
Key Characteristics of High-Performing Insurance Broker Software
Insurance Tech Services
 
20200823-Intro-to-FIRRTLllllllllllllllllll
20200823-Intro-to-FIRRTLllllllllllllllllll20200823-Intro-to-FIRRTLllllllllllllllllll
20200823-Intro-to-FIRRTLllllllllllllllllll
JonathanSong28
 
VFP-Report-Copy-Data-Environment details
VFP-Report-Copy-Data-Environment detailsVFP-Report-Copy-Data-Environment details
VFP-Report-Copy-Data-Environment details
manojbkalla
 
wAIred_LearnWithOutAI_LunchAndLearn_27052025.pptx
wAIred_LearnWithOutAI_LunchAndLearn_27052025.pptxwAIred_LearnWithOutAI_LunchAndLearn_27052025.pptx
wAIred_LearnWithOutAI_LunchAndLearn_27052025.pptx
SimonedeGijt
 
Top 5 Odoo Modules for the EPC Industry.pdf
Top 5 Odoo Modules for the EPC Industry.pdfTop 5 Odoo Modules for the EPC Industry.pdf
Top 5 Odoo Modules for the EPC Industry.pdf
SatishKumar2651
 
Scaling up your Snapshot tests, without the friction
Scaling up your Snapshot tests, without the frictionScaling up your Snapshot tests, without the friction
Scaling up your Snapshot tests, without the friction
arnold844201
 
Building AI agents with Java and LangChain4j
Building AI agents with Java and LangChain4jBuilding AI agents with Java and LangChain4j
Building AI agents with Java and LangChain4j
Julien Dubois
 
Contractor Hot Work Permit Software for Work Safety
Contractor Hot Work Permit Software for Work SafetyContractor Hot Work Permit Software for Work Safety
Contractor Hot Work Permit Software for Work Safety
SHEQ Network Limited
 
Improving Engagement with CRM Software for Instance Agents
Improving Engagement with CRM Software for Instance AgentsImproving Engagement with CRM Software for Instance Agents
Improving Engagement with CRM Software for Instance Agents
Insurance Tech Services
 
Frontier AI Regulation: What form should it take?
Frontier AI Regulation: What form should it take?Frontier AI Regulation: What form should it take?
Frontier AI Regulation: What form should it take?
Petar Radanliev
 
Shortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome ThemShortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome Them
TECH EHS Solution
 
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdfBoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
Web Application Development A Comprehensive Guide for 2025.pdf
Web Application Development A Comprehensive Guide for 2025.pdfWeb Application Development A Comprehensive Guide for 2025.pdf
Web Application Development A Comprehensive Guide for 2025.pdf
Secuodsoft
 
Getting Started with BoxLang - CFCamp 2025.pdf
Getting Started with BoxLang - CFCamp 2025.pdfGetting Started with BoxLang - CFCamp 2025.pdf
Getting Started with BoxLang - CFCamp 2025.pdf
Ortus Solutions, Corp
 
Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025
Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025
Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025
BradBedford3
 
system-and-network-administration pptx-.pdf
system-and-network-administration pptx-.pdfsystem-and-network-administration pptx-.pdf
system-and-network-administration pptx-.pdf
Tof Abdu
 
Techdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk takerTechdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk taker
RajaNagendraKumar
 
TUG Brazil - VizQL Data Service - Nik Dutra.pdf
TUG Brazil - VizQL Data Service - Nik Dutra.pdfTUG Brazil - VizQL Data Service - Nik Dutra.pdf
TUG Brazil - VizQL Data Service - Nik Dutra.pdf
Ligia Galvão
 
German Marketo User Group - May 2025 survey results
German Marketo User Group - May 2025 survey resultsGerman Marketo User Group - May 2025 survey results
German Marketo User Group - May 2025 survey results
BradBedford3
 
Playwright, Cypress, or TestGrid: A Feature-by-Feature Breakdown for Test Aut...
Playwright, Cypress, or TestGrid: A Feature-by-Feature Breakdown for Test Aut...Playwright, Cypress, or TestGrid: A Feature-by-Feature Breakdown for Test Aut...
Playwright, Cypress, or TestGrid: A Feature-by-Feature Breakdown for Test Aut...
Shubham Joshi
 
Key Characteristics of High-Performing Insurance Broker Software
Key Characteristics of High-Performing Insurance Broker SoftwareKey Characteristics of High-Performing Insurance Broker Software
Key Characteristics of High-Performing Insurance Broker Software
Insurance Tech Services
 
20200823-Intro-to-FIRRTLllllllllllllllllll
20200823-Intro-to-FIRRTLllllllllllllllllll20200823-Intro-to-FIRRTLllllllllllllllllll
20200823-Intro-to-FIRRTLllllllllllllllllll
JonathanSong28
 
VFP-Report-Copy-Data-Environment details
VFP-Report-Copy-Data-Environment detailsVFP-Report-Copy-Data-Environment details
VFP-Report-Copy-Data-Environment details
manojbkalla
 

Using Alf with Cameo Simulation Toolkit - Part 2: Modeling

  • 1. No Magic World Symposium, Allen TX Ed Seidewitz Model Driven Solutions, Inc. ● http://www.modeldriven.com [email protected] ● @Seidewitz http://slideshare.net/seidewitz Copyright © 2018 Ed Seidewitz Using the Alf Action Language with Cameo Simulation Toolkit Part 2 – Modeling
  • 2. Page 2 About me Ed Seidewitz Chief Technology Officier, Model Driven Solutions, Inc. [email protected] ● @seidewitz • 30 years experience as a project manager, architect, developer and modeler • Involved with UML since version 0.8 • Developer of fUML and Alf Reference Implementations and MagicDraw Alf Plugin • Chair of the OMG fUML and Alf Revision Task Forces; member of the UML Revision Task Force Copyright © 2018 Ed Seidewitz
  • 3. Page 3 Goals Part 1 – Basics (Sunday) • Learn the basics of the Alf action language for Executable UML. • Use the Alf Plugin for MagicDraw. • Practice using Alf with Cameo Simulation Toolkit. Part 2 – Modeling (Today) • Model simulations using the Alf action language. • Use Alf in class and state machine models in MagicDraw. • Creating and run simulations using Alf with Cameo Simulation Toolkit. Copyright © 2018 Ed Seidewitz
  • 4. Page 4 Prerequisites (for Part 2) • Participant – Basic knowledge of class, activity and state machine modeling using MagicDraw – Some experience with model execution using Cameo Simulation Toolkit – Introductory understanding of using Alf in CST (e.g., from Part 1 of this tutorial) • System (for hands-on exercises) – MagicDraw 18.5 – Cameo Simulation Toolkit 18.5sp3 – Alf plugin 18.5 Install MagicDraw, CST and Alf Plugin on line or from USB stick Copyright © 2018 Ed Seidewitz
  • 5. Page 5 5 Installing the Alf plugin Copyright © 2018 Ed Seidewitz Plugin documentation is available at: https://docs.nomagic.com/display/ALFP185/Alf+plugin Under Plugins (commercial), download / install the Alf plugin v18.5. Select Help ► Resource/Plugin Manager to open the Resource/ Plugin Manager window.  A new version will be available for the 19.0 release. Or click here to install from USB stick.
  • 6. Page 6 Class Models Copyright © 2018 Ed Seidewitz
  • 7. Page 7 Object creation and property access Copyright © 2018 Ed Seidewitz order = new Order(); order.product = aProduct; order.quantity = aQuantity; order.amount = aQuantity * aProduct.price; Create a new Order. Set the properties of the new order. aCustomer.orders->add(order); totalAmount = aCustomer.orders.amount-> reduce RealFunctions::'+' ?? 0.0; Add the new order to an existing customer. Navigate associations to compute total amount.  A reduce expression “inserts” a binary function into the elements of a sequence.  Properties must be public to be accessible. A property access
  • 8. Page 8 Operations and methods Copyright © 2018 Ed Seidewitz this.product = product; this.quantity = quantity; return this.quantity * this.product.price; this.orders->add(order); return this.orders.getAmount()-> reduce RealFunctions::'+' ?? 0.0;  The behavior that implements an operation is called its method. An operation call
  • 9. Page 9 Operation invocations Copyright © 2018 Ed Seidewitz order = new Order(aQuantity, aProduct); amount = order.getAmount(); aCustomer.addOrder(order); totalAmount = aCustomer.getTotalAmount(); A constructor can be used to create an object with initialization. A constructor operation has the standard Create stereotype applied.  Operation calls are synchronous invocations. The caller waits until the operation method execution completes.
  • 10. Page 10 Hands On Address Book Copyright © 2018 Ed Seidewitz
  • 11. Page 11 Create the Address Book project Copyright © 2018 Ed Seidewitz In the Alf folder, select the Alf template. Under Other, select Project from Template. Select File ► New Project to open the project creation window. Create an Address Book project.
  • 12. Page 12 Create the Address Book class model Copyright © 2018 Ed Seidewitz Make sure these Entry attributes are public. Give this association end a multiplicity of *.
  • 13. Page 13 Are you using SysML? Copyright © 2018 Ed Seidewitz  CST and Alf assume the use of the UML primitive types. But SysML provides primitive value types that are different than the UML primitive types. Value properties have to have value types, so String here is the SysML type. Remove the ValueProperty stereotype and change the type to the UML primitive type. ✗ ✗  This is resolved in v19.0 for both CST and Alf.
  • 14. Page 14 Create Address Book and Entry operations Copyright © 2018 Ed Seidewitz Create a constructor operation in the usual way, and then apply the standard Create stereotype.
  • 15. Page 15 Create the Entry constructor method Copyright © 2018 Ed Seidewitz Right click on the Entry operation and select Create Method ► Behavior to open this selection window. Choose either Activity or Opaque Behavior. Enter code in the Alf editor window to initialize an Entry.
  • 16. Page 16 Create Address Book operation methods Copyright © 2018 Ed Seidewitz Create methods for the AddressBook operations, and then enter the Alf code shown for them.  A select expression is used to filter a sequence based on a condition. The index [1] ensures that at most one value is selected.  This expression will return either a single value or null, as required by the return multiplicity of 0..1.  The constructor operation is used when creating an instance of the Entry class.  The braces { } are required in if statement clauses in Alf.
  • 17. Page 17 Test the Address Book model Copyright © 2018 Ed Seidewitz Create an AddressBookTest activity with the Alf code below.  The ?? (null-coalescing) operator is used here because get has return multiplicity 0..1 and the + operator requires argument multiplicity 1..1. Run the activity and see if it works!
  • 18. Page 18 State Machine Models Copyright © 2018 Ed Seidewitz
  • 19. Page 19 Classifier behaviors Copyright © 2018 Ed Seidewitz A signal reception declares the ability of instances of a class to handle a signal. A state machine can be attached to a class as a classifier behavior. The state machine reacts to signals that are sent to instances of its context class.
  • 20. Page 20 Transition and state behaviors Copyright © 2018 Ed Seidewitz Alf can be used to define transition and state behaviors in state machines.
  • 21. Page 21 Signal sending Copyright © 2018 Ed Seidewitz fan = new Fan(); fan.TurnOn(); fan.TurnOff(); A signal send has a similar syntax to operation calls, but referencing a signal reception, rather than an operation. The state machine starts running when an object is created.  A signal can only be sent using Alf to an object whose class has a reception declared for the signal.  Signal sends are asynchronous invocations. The sender continues immediately after the signal is sent.
  • 22. Page 22 Hands On Heating Simulation Copyright © 2018 Ed Seidewitz
  • 23. Page 23 Create the Heating Simulation project Copyright © 2018 Ed Seidewitz In the Alf folder, select the Alf template. Under Other, select Project from Template. Select File ► New Project to open the project creation window. Create a Heating Simulation project.
  • 24. Page 24 Create the model package structure Copyright © 2018 Ed Seidewitz
  • 25. Page 25 Create Environment and House classes Copyright © 2018 Ed Seidewitz Create three signals... …and use them to declare signal receptions. Make this attribute public. Make this association composite. Make this operation private. Give both association ends names.
  • 26. Page 26 Create the Environment state machine Copyright © 2018 Ed Seidewitz
  • 27. Page 27 Add triggers to transitions Copyright © 2018 Ed Seidewitz
  • 28. Page 28 Create opaque behavior Copyright © 2018 Ed Seidewitz Under Effect, set the Behavior Type to Opaque Behavior.
  • 29. Page 29 Add Alf code Copyright © 2018 Ed Seidewitz  A signal is sent by invoking the signal reception on the target object. Click on the transition to enter code for its effect behavior in the Alf editor window. Create an opaque behavior and add Alf code for this transition, too.
  • 30. Page 30 Create the House state machine Copyright © 2018 Ed Seidewitz
  • 31. Page 31 Create the cool method Copyright © 2018 Ed Seidewitz Right click on the cool operation and select Create Method ► Behavior to open the Behavior selection window. Enter the Alf code in the Alf editor window. Choose either Activity or Opaque Behavior.  The braces { } are required in if statement clauses in Alf.
  • 32. Page 32 Coming in v19.0! Copyright © 2018 Ed Seidewitz Access event data in transition and state behaviors.
  • 33. Page 33 Create an instance model Copyright © 2018 Ed Seidewitz Add a link for the Environment- House composite association. Be sure to create slots for both ends. Right click on the Environment instance and select Simulation ► Run to execute the model.
  • 34. Page 34 Add a Heater class Copyright © 2018 Ed Seidewitz Add new signals. Add new reception. Add new operation. Make this attribute public. Make this association composite. Add new attribute.
  • 35. Page 35 Update the House state machine Copyright © 2018 Ed Seidewitz Add a new transition triggered by the Heat signal with Alf code to call the heat operation. Create a method behavior for the heat operation.
  • 36. Page 36 Create the Heater state machine Copyright © 2018 Ed Seidewitz
  • 37. Page 37 Update the instance model Copyright © 2018 Ed Seidewitz Add a Heater instance and a link of the House-Heater composite association. Right click on the Environment instance and select Simulation ► Run to execute the model again.
  • 38. Page 38 Add a Thermostat class Copyright © 2018 Ed Seidewitz Make this association composite. Add a new attribute. This association is not composite.
  • 39. Page 39 Update the Heater state machine Copyright © 2018 Ed Seidewitz Use the isOn attribute to record which state the Heater is in.  There is no built-in way in Alf to determine what state a state machine is in.
  • 40. Page 40 Create the monitor method Copyright © 2018 Ed Seidewitz
  • 41. Page 41 Are you using SysML? Copyright © 2018 Ed Seidewitz Alf currently cannot be used to send a signal via a specified port.  To be resolved through further integration of Alf with composite structure semantics.
  • 42. Page 42 Update the House state machine Copyright © 2018 Ed Seidewitz Double click on the running state (as a whole) to open its specification window. Under Entry, set the Behavior Type to Opaque Behavior. Click on just the entry behavior line and enter code in the Alf editor window.
  • 43. Page 43 Update the instance model Copyright © 2018 Ed Seidewitz Add a Thermostat instance and links to the House and Heater instances. Right click on the Environment instance and select Simulation ► Run to execute the model again.

Editor's Notes