Upload
dgianni
View
618
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Presentation at the 2nd International Workshop on Model-driven Approaches for Simulation Engineering (held within the SCS/IEEE Symposium on Theory of Modeling and Simulation part of SpringSim 2012) Please see: http://www.sel.uniroma2.it/mod4sim12/ for further details
Citation preview
BOM2UML Integrating BOM Specifications into
UML-based Development Environments
Andrea D’Ambrogio1, Daniele Gianni2 and Marco Grasso1
[email protected] Dept. of Enterprise Engineering
University of Roma “Tor Vergata” Roma (Italy)
[email protected] European Space Agency
Noordwijk, The Netherlands
2nd Workshop on Model-driven Approaches for Simulation Engineering (Mod4Sim), in Symposium on Theory of Modeling and Simulation (TMS), SpringSim 2012
Presentation Overview
Background
• IEEE High Level Architecture (HLA) and Basic Object
Model (BOM)
• Atlas Transformation Language (ATL)
BOM2UML:
• High Level Mapping
• Model Transformations
Example application
IEEE High Level Architecture
Prominent standard for distributed simulation
Originally designed to increase simulator reusability and interoperability
The standard consists of four documents:
• Set of compliance rules
• Interfaces for distributed simulation services
• An Object Model Template (OMT) for data interchange
• A development process
The standard addresses software reusability at the coarse level of individual simulators
This is obtained through specification of OMT data
Basic Object Model (BOM)
BOMs document individual (fine grain) simulation components using an abstract notation • http://www.boms.info
BOMs can be coded in tabular and XML (DIF) forms
BOMs can be mapped onto HLA OMT for full compliance with the standard
BOMs can be grouped in: • Model Identification
• Conceptual Model Definition
• Model Mapping
• Object Model Definition
• Notes and Lexicons
Atlas Transformation Language (ATL)
A model transformation language and toolkit
• http://www.eclipse.org/atl
Used in the MDE (model-driven engineering)
field to produce a set of target models from a
set of source models
An ATL model-to-model transformation is
composed of rules that define how source model
elements are matched and navigated to create
and initialize the elements of the target models
Operational context of ATL
MOF
MMa MMb
Ma Mb MMa2MMb.atl
ATL
MMa is the
source
metamodel
Ma is the source model Mb is the target model
MMB is the
target
metamodel
ATL overview Source models and target models are distinct:
• Source models are read-only (they can only be navigated, not modified)
• Target models are write-only (they cannot be navigated)
The language is a declarative-imperative hybrid: • Declarative part:
Matched rules with automatic traceability support
Side-effect free navigation (and query) language: OCL 2.0
• Imperative part: Called rules
Action blocks.
Recommended programming style: declarative
BOM2UML: What is it?
BOM2UML is a first attempt to automatically
derive UML representations for BOM specs
BOM2UML consists of:
• a high-level model mapping between BOM concepts
and UML concepts
• a set of ATL transformations to convert BOM
specifications (coded in XML-based DIF) into UML
diagrams (coded in XMI)
BOM2UML: Why is it needed?
BOM specs cannot be immediately integrated in
UML-based model-driven environments
UML representations contribute to solve
interoperability issues when integrating
simulation components
UML is part of the OMG MDA standard
UML eliminates the investment to retrofit
existing tools for BOM-based development
High Level Mapping
BOM Template Concept UML Domain
Model
Identification Meta-data Class Diagram
Pattern of Interplay Dynamic
Behavior
Interaction Overview
Diagram and associated
Sequence Diagrams
State Machine FSM State Diagram
Entity Type Data Class
Event Type Data Class
High Level Mapping
BOM Template Concept UML Domain
Model Mapping Model
Transformation
Platform Independent
to Platform
Specification
Transformation
Object Definition Object Model UML-HLA Profile*
Lexicon** List XML Query on UML
Model**
Note** Meta-attribute Note**
*Available in literature
**Work-in-progress
Model Transformations
State machine UML State Diagram
• BOM State UML State
• BOM Transition UML State transition
BOM Trigger != UML Trigger
Pattern of Interplay Interaction Overview Diagram
• BOM Action UML Activity
• BOM Variation UML Decision node plus UML Activity
• Each UML Activity is expanded into a Sequence Diagram to
represent the interaction triggering the BOM Event
Example
Application scenario consisting of:
• Cannon firing cannon shots
• Soldier throwing hand bombs
• Set of targets to be destroyed
All the BOMs were developed, but we illustrate
only the Event Types, Cannon State Machine,
and Firing Pattern of Interplay
Part of the defined Event Types
Event
Type
Source
Charact-
Name
Target
Charact
Name
Content Trigger
Condition Notes
Cannon-
shot Cannon Target ShotId
FiringCom-
mand==true NA
Bullet
Explosion Target Cannon NA NA NA
‘Firing’ State Machine for the Cannon
State
Machine
Name
Concep-
tual Entity
State
Not
es State Name Exit Condition
Action Next
State
Firing Cannon
Ready FireCom-
mand Fire Na
Fire Cannon Fires
Bullet
Travel-
ling
Na
Bullet
Travelling
Bullet
Explodes Ready
Na
Bullet Faulty Na
State Diagram for the ‘Firing’ State Machine
Fire
Ready
BulletTravelling
FiringThe triggering conditions
associated to each BOM
Event become the
transitions triggers Each BOM state
becomes a UML State
The BOM State
Machine becomes the
UML State Diagram
Guards and Entry
Action remain
undefined
‘Firing’ Pattern of Interplay (PoI) (part 1)
PoI Seq Name Sender Recei-
ver Event
Condi
-tion
Firin
g
Pattern
Action 1
Fire
Cannon Cannon Target Fire Na
Variation
Throw
Handbo
mb
Soldier Target Launch Na
Pattern
Action 2
Explode
Bullet Cannon Target Explosion Na
Variation
Explode
Hand-
bomb
Soldier Target Explosion Na
‘Firing’ Pattern of Interplay (PoI) (part 2)
PoI Seq Name Sender Recei-
ver Event
Condi-
tion
Firin
g
Exception Dischar-
ge Bullet Cannon NA
Faulty
Bullet
Bullet-
Exploded
==false
Exception
Dischar-
ge
Handbo
mb
Soldier NA
Faulty
Hand-
bomb
Hand-
Bomb
Exploded
==false
Interaction Overview Diagram
Fire Cannon
Throw
Handbomb
Explode Bullet
Explode
Handbomb
Discharge Bullet
Discharge
Handbomb
[Faulty Handbomb]
[Faulty Bullet]
ref
ref
ref
ref
ref
ref
Interaction Overview Diagram
Fire Cannon
Throw
Handbomb
Explode Bullet
Explode
Handbomb
Discharge Bullet
Discharge
Handbomb
[Faulty Handbomb]
[Faulty Bullet]
ref
ref
ref
ref
ref
refThe BOM Pattern of
Interplay becomes an
Interaction Overview
Diagram
Interaction Overview Diagram
Fire Cannon
Throw
Handbomb
Explode Bullet
Explode
Handbomb
Discharge Bullet
Discharge
Handbomb
[Faulty Handbomb]
[Faulty Bullet]
ref
ref
ref
ref
ref
ref
Each Variation
becomes an
“alternative” Action
Interaction Overview Diagram
Fire Cannon
Throw
Handbomb
Explode Bullet
Explode
Handbomb
Discharge Bullet
Discharge
Handbomb
[Faulty Handbomb]
[Faulty Bullet]
ref
ref
ref
ref
ref
ref
Each Action becomes
and Activity
Interaction Overview Diagram
Fire Cannon
Throw
Handbomb
Explode Bullet
Explode
Handbomb
Discharge Bullet
Discharge
Handbomb
[Faulty Handbomb]
[Faulty Bullet]
ref
ref
ref
ref
ref
ref
Each Action is
exploded and
represented as a
Sequence Diagram
Interaction Overview Diagram
Fire Cannon
Throw
Handbomb
Explode Bullet
Explode
Handbomb
Discharge Bullet
Discharge
Handbomb
[Faulty Handbomb]
[Faulty Bullet]
ref
ref
ref
ref
ref
ref
Cannon Target
cannonshot[firingCommand==true]
UML Class
representing the BOM
Event
Conclusions
BOM specs document HLA simulation components using
XML-based formats and thus cannot be exploited within
model-driven approaches for HLA
We have introduced BOM2UML to integrate BOMs into
existing model-driven simulation engineering approaches
BOM2UML consists in:
• a high level mapping between BOM and UML concepts
• a set of ATL transformations to derive UML diagrams
Work is in progress to define both a UML profile for BOM
to further enhance model verification
Backup slides
ATL rules
A declarative rule specifies:
• the source pattern to be matched in the source models
• the target pattern to be created in the target models for each match during rule application
An imperative rule is basically a procedure:
• It is called by its name
• It may take arguments
• It can contain:
A declarative target pattern
An action block (i.e. a sequence of statements)
Both.
Declarative rules: source pattern
The source pattern is composed of:
• A labeled set of types coming from the source metamodels
• A guard (Boolean expression) used to filter matches
A match corresponds to a set of elements coming from the source models that:
• Are of the types specified in the source pattern (one element for each type)
• Satisfy the guard
Declarative rules: target pattern
The target pattern is composed of: • A labeled set of types coming from the target
metamodels
• For each element of this set, a set of bindings
• A binding specifies the initialization of a property of a target element using an expression
For each match, the target pattern is applied: • Elements are created in the target models (one
for each type of the target pattern)
• Target elements are initialized by executing the bindings: First evaluating their value
Then assigning this value to the corresponding property
Example ATL rule rule UMLInteractionOverview{
from patternOfInterplay:BOMs!PatternOfInterplay
to initialNode:UML!InitialNode(name<‐patternOf-
Interplay.Name+'InitialNode'),
finalNode:UML!ActivityFinalNode(
name<‐patternOfInterplay.Name+'FinalNode')
do {
‐‐defining a Decision Node for each Pattern Action
for(pattern in atternOfInterplay.Pattern2PatternAct){
‐‐setting the decision index with the action index
thisModule.indexDecision<‐patternOfInterplay.Pattern-
2PatternAct.indexOf(pattern);
‐‐instantiating a Decision Node per each Pattern Action
thisModule.UMLDecisionNode();
thisModule.entityNameType<‐'PatternAction';
…
}