BOM2UML
 Integrating BOM Specifications into
UML-based Development Environments
       Andrea D’Ambrogio1, Daniele Gianni2 and Marco Grasso1
                             1dambro@uniroma2.it

                        Dept. of Enterprise Engineering
                       University of Roma “Tor Vergata”
                                  Roma (Italy)
                             2daniele.gianni@esa.int

                            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 is the                                          MMB is the
source                                              target
metamodel    MMa             ATL          MMb       metamodel




                      MMa2MMb.atl
              Ma                            Mb
    Ma is the source model         Mb is the target model
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
                       Meta-data       Class Diagram
  Identification

                                    Interaction Overview
                       Dynamic
Pattern of Interplay               Diagram and associated
                       Behavior
                                     Sequence Diagrams

  State Machine          FSM           State Diagram
   Entity Type           Data              Class
   Event Type            Data              Class
High Level Mapping

  BOM Template               Concept           UML Domain

                                            Platform Independent
                               Model             to Platform
   Model Mapping
                           Transformation       Specification
                                               Transformation

  Object Definition        Object Model     UML-HLA Profile*

                                            XML Query on UML
      Lexicon**                 List
                                                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


              Source    Target
 Event                                       Trigger
             Charact-   Charact   Content                Notes
 Type                                       Condition
              Name       Name

Cannon-                                     FiringCom-
             Cannon     Target    ShotId                 NA
 shot                                       mand==true

 Bullet
              Target    Cannon     NA          NA        NA
Explosion
‘Firing’ State Machine for the Cannon

                                      State
 State
           Concep-      State Name       Exit Condition       Not
Machine
          tual Entity                  Action        Next     es
 Name
                                                     State
                                      FireCom-
                          Ready                       Fire    Na
                                        mand
                                                     Bullet
                           Fire      Cannon Fires Travel-     Na
 Firing    Cannon                                     ling
                                        Bullet
                                                              Na
                          Bullet      Explodes
                                                    Ready
                        Travelling
                                     Bullet Faulty            Na
State Diagram for the ‘Firing’ State
                  Machine
                                              The BOM State
                                 Firing     Machine becomes the
The triggering conditions                    UML State Diagram
associated to each BOM
   Event become the
   transitions triggers                            Each BOM state
                                                 becomes a UML State
                                 Ready




              BulletTravelling            Fire



                   Guards and Entry
                    Action remain
                      undefined
‘Firing’ Pattern of Interplay (PoI)
                                (part 1)

                                               Recei-             Condi
PoI                  Seq   Name      Sender             Event
                                                ver               -tion
          Pattern            Fire
                     1               Cannon Target       Fire      Na
          Action           Cannon
                            Throw
         Variation         Handbo    Soldier   Target   Launch     Na
Firing




                             mb
          Pattern          Explode
                     2               Cannon Target Explosion       Na
          Action            Bullet
                           Explode
         Variation          Hand-    Soldier   Target Explosion    Na
                            bomb
‘Firing’ Pattern of Interplay (PoI)
                                   (part 2)



                                              Recei-             Condi-
PoI                  Seq    Name    Sender             Event
                                               ver                tion
                                                                 Bullet-
                           Dischar-                    Faulty
         Exception                   Cannon    NA               Exploded
                           ge Bullet                   Bullet
                                                                 ==false
Firing




                           Dischar-                              Hand-
                                                       Faulty
                              ge                                 Bomb
         Exception                  Soldier    NA      Hand-
                           Handbo                               Exploded
                                                       bomb
                             mb                                  ==false
Interaction Overview Diagram

                                         ref
                                         Discharge Bullet
                       [Faulty Bullet]

     ref                                 ref
       Fire Cannon                       Explode Bullet




     ref                                 ref
             Throw                              Explode
           Handbomb                            Handbomb
                      [Faulty Handbomb]
                                         ref
                                               Discharge
                                               Handbomb
Interaction Overview Diagram

                                                            ref
                                                            Discharge Bullet
                                          [Faulty Bullet]

                        ref                                 ref
                          Fire Cannon                       Explode Bullet




                        ref                                 ref
                                Throw                              Explode
                              Handbomb                            Handbomb
                                         [Faulty Handbomb]
 The BOM Pattern of                                         ref
                                                                  Discharge
Interplay becomes an                                              Handbomb
 Interaction Overview
       Diagram
Interaction Overview Diagram

                                          ref
                                          Discharge Bullet
                        [Faulty Bullet]

      ref                                 ref
        Fire Cannon                       Explode Bullet




      ref                                 ref
              Throw                              Explode
            Handbomb                            Handbomb
                       [Faulty Handbomb]
                                          ref
                                                Discharge
      Each Variation                            Handbomb
        becomes an
    “alternative” Action
Interaction Overview Diagram

                                          ref
                                          Discharge Bullet
                        [Faulty Bullet]

      ref                                 ref
        Fire Cannon                       Explode Bullet




   Each Action becomes
       and Activity
      ref                                 ref
              Throw                              Explode
            Handbomb                            Handbomb
                       [Faulty Handbomb]
                                          ref
                                                Discharge
                                                Handbomb
Interaction Overview Diagram
       Each Action is
       exploded and
                                         ref
     represented as a
                                         Discharge Bullet
    Sequence Diagram
                       [Faulty Bullet]

     ref                                 ref
       Fire Cannon                       Explode Bullet




     ref                                 ref
             Throw                              Explode
           Handbomb                            Handbomb
                      [Faulty Handbomb]
                                         ref
                                               Discharge
                                               Handbomb
Interaction Overview Diagram
                  UML Class
             representing the BOM
                    Event                                       [Faul
       Cannon                        Target
                                              ref

[firingCommand==true]
                        cannonshot              Fire Cannon




                                              ref
                                                      Throw
                                                    Handbomb
                                                               [Faulty
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';
       …
     }

BOM2UML: Integrating BOM Specifications into UML-based Development Environments

  • 1.
    BOM2UML Integrating BOMSpecifications into UML-based Development Environments Andrea D’Ambrogio1, Daniele Gianni2 and Marco Grasso1 1dambro@uniroma2.it Dept. of Enterprise Engineering University of Roma “Tor Vergata” Roma (Italy) 2daniele.gianni@esa.int 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
  • 2.
    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
  • 3.
    IEEE High LevelArchitecture  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
  • 4.
    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
  • 5.
    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
  • 6.
    Operational context ofATL MOF MMa is the MMB is the source target metamodel MMa ATL MMb metamodel MMa2MMb.atl Ma Mb Ma is the source model Mb is the target model
  • 7.
    ATL overview  Sourcemodels 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
  • 8.
    BOM2UML: What isit?  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)
  • 9.
    BOM2UML: Why isit 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
  • 10.
    High Level Mapping BOM Template Concept UML Domain Model Meta-data Class Diagram Identification Interaction Overview Dynamic Pattern of Interplay Diagram and associated Behavior Sequence Diagrams State Machine FSM State Diagram Entity Type Data Class Event Type Data Class
  • 11.
    High Level Mapping BOM Template Concept UML Domain Platform Independent Model to Platform Model Mapping Transformation Specification Transformation Object Definition Object Model UML-HLA Profile* XML Query on UML Lexicon** List Model** Note** Meta-attribute Note** *Available in literature **Work-in-progress
  • 12.
    Model Transformations  Statemachine  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
  • 13.
    Example  Application scenarioconsisting 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
  • 14.
    Part of thedefined Event Types Source Target Event Trigger Charact- Charact Content Notes Type Condition Name Name Cannon- FiringCom- Cannon Target ShotId NA shot mand==true Bullet Target Cannon NA NA NA Explosion
  • 15.
    ‘Firing’ State Machinefor the Cannon State State Concep- State Name Exit Condition Not Machine tual Entity Action Next es Name State FireCom- Ready Fire Na mand Bullet Fire Cannon Fires Travel- Na Firing Cannon ling Bullet Na Bullet Explodes Ready Travelling Bullet Faulty Na
  • 16.
    State Diagram forthe ‘Firing’ State Machine The BOM State Firing Machine becomes the The triggering conditions UML State Diagram associated to each BOM Event become the transitions triggers Each BOM state becomes a UML State Ready BulletTravelling Fire Guards and Entry Action remain undefined
  • 17.
    ‘Firing’ Pattern ofInterplay (PoI) (part 1) Recei- Condi PoI Seq Name Sender Event ver -tion Pattern Fire 1 Cannon Target Fire Na Action Cannon Throw Variation Handbo Soldier Target Launch Na Firing mb Pattern Explode 2 Cannon Target Explosion Na Action Bullet Explode Variation Hand- Soldier Target Explosion Na bomb
  • 18.
    ‘Firing’ Pattern ofInterplay (PoI) (part 2) Recei- Condi- PoI Seq Name Sender Event ver tion Bullet- Dischar- Faulty Exception Cannon NA Exploded ge Bullet Bullet ==false Firing Dischar- Hand- Faulty ge Bomb Exception Soldier NA Hand- Handbo Exploded bomb mb ==false
  • 19.
    Interaction Overview Diagram ref Discharge Bullet [Faulty Bullet] ref ref Fire Cannon Explode Bullet ref ref Throw Explode Handbomb Handbomb [Faulty Handbomb] ref Discharge Handbomb
  • 20.
    Interaction Overview Diagram ref Discharge Bullet [Faulty Bullet] ref ref Fire Cannon Explode Bullet ref ref Throw Explode Handbomb Handbomb [Faulty Handbomb] The BOM Pattern of ref Discharge Interplay becomes an Handbomb Interaction Overview Diagram
  • 21.
    Interaction Overview Diagram ref Discharge Bullet [Faulty Bullet] ref ref Fire Cannon Explode Bullet ref ref Throw Explode Handbomb Handbomb [Faulty Handbomb] ref Discharge Each Variation Handbomb becomes an “alternative” Action
  • 22.
    Interaction Overview Diagram ref Discharge Bullet [Faulty Bullet] ref ref Fire Cannon Explode Bullet Each Action becomes and Activity ref ref Throw Explode Handbomb Handbomb [Faulty Handbomb] ref Discharge Handbomb
  • 23.
    Interaction Overview Diagram Each Action is exploded and ref represented as a Discharge Bullet Sequence Diagram [Faulty Bullet] ref ref Fire Cannon Explode Bullet ref ref Throw Explode Handbomb Handbomb [Faulty Handbomb] ref Discharge Handbomb
  • 24.
    Interaction Overview Diagram UML Class representing the BOM Event [Faul Cannon Target ref [firingCommand==true] cannonshot Fire Cannon ref Throw Handbomb [Faulty
  • 25.
    Conclusions  BOM specsdocument 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
  • 26.
  • 27.
    ATL rules  Adeclarative 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.
  • 28.
    Declarative rules: sourcepattern  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
  • 29.
    Declarative rules: targetpattern  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
  • 30.
    Example ATL rule ruleUMLInteractionOverview{ 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'; … }