Developing	
  and	
  Visualizing	
  
                                   Live	
  Model	
  Queries	
  
                                              Zoltán	
  Ujhelyi,	
  Tamás	
  Szabó	
  
                                               István	
  Ráth,	
  Dániel  Varró  
                                             Ábel	
  Hegedüs	
  (demonstrator)	
  




Budapest  University  of  Technology  and  Economics  
Department  of  Measurement  and  Informa<on  Systems  
What	
  is	
  a	
  Model	
  Query?	
  
  ModelQuery(A,B)	
  
   Cond(A,B)	
  
   o  Retrieve	
  tuples	
  of	
  
      model	
  elements	
  A,B  
   o  SaOsfying	
  the	
  query	
  
      condiOon	
  Cond  
   o  Enumerate	
  	
  
      one	
  /	
  all	
  instances	
  
   o  With	
  A,B	
  as	
  	
  
      input	
  or	
  output	
  
      parameters	
  



                                         2	
  
What	
  is	
  a	
  Model	
  Query?	
  
  ModelQuery(A,B)	
                            AUTOSAR	
  
   Cond(A,B)	
                                   •  Select  pairs  of  SystemSignal	
  and  
   o  Retrieve	
  tuples	
  of	
                    its  signal  group  which  are  not  in  
                                                    the  same  IPDU	
  
      model	
  elements	
  A,B  
   o  SaOsfying	
  the	
  query	
  
      condiOon	
  Cond  
                                                 IMA	
  
                                                 •  Find  instances  of  cri;cal  func;ons  
   o  Enumerate	
  	
                               not  running  on  different  
      one	
  /	
  all	
  instances	
                processors  of  different  chassis	
  
   o  With	
  A,B	
  as	
  	
  
      input	
  or	
  output	
                    BPMN	
  
      parameters	
                               •  Show  sink  ac;vi;es  with  no  
                                                    outgoing  flow	
  



                                         3	
  
What	
  is	
  a	
  Model	
  Query?	
  
  ModelQuery(A,B)	
                            AUTOSAR	
  
   Cond(A,B)	
                                   •  Select  pairs  of  SystemSignal	
  and  
   o  Retrieve	
  tuples	
  of	
                    its  signal  group  which  are  not  in  
                                                    the  same  IPDU	
  
      model	
  elements	
  A,B  
   o  SaOsfying	
  the	
  query	
  
      condiOon	
  Cond  
                                                 IMA	
  
                                                 •  Find  instances  of  cri;cal  func;ons  
   o  Enumerate	
  	
                               not  running  on  different  
      one	
  /	
  all	
  instances	
                processors  of  different  chassis	
  
   o  With	
  A,B	
  as	
  	
  
      input	
  or	
  output	
                    BPMN	
  
      parameters	
                               •  Show  sink  ac;vi;es  with  no  
                                                    outgoing  flow	
  



                                         4	
  
Live	
  Model	
  Queries	
  
  Live	
  Query	
  EvaluaOon:	
  
   Incremental	
  cache	
  of	
  matches	
  
    o  Maintain	
  a	
  cheap	
  cache	
  	
  
       (only	
  memory	
  overhead)	
  
    o  NoOfy	
  about	
  relevant	
  changes	
  
    o  Enable	
  reacOons	
  to	
  complex	
  	
  
       	
  	
  structural	
  events	
  




                                                     5	
  
Live	
  Model	
  Queries	
  
  Live	
  Query	
  EvaluaOon:	
  
   Incremental	
  cache	
  of	
  matches	
  
    o  Maintain	
  a	
  cheap	
  cache	
  	
  
       (only	
  memory	
  overhead)	
  
    o  NoOfy	
  about	
  relevant	
  changes	
  
    o  Enable	
  reacOons	
  to	
  complex	
  	
  
       	
  	
  structural	
  events	
  




                                                     6	
  
Live	
  Model	
  Queries	
  
  Live	
  Query	
  EvaluaOon:	
  
   Incremental	
  cache	
  of	
  matches	
  
    o  Maintain	
  a	
  cheap	
  cache	
  	
  
       (only	
  memory	
  overhead)	
  
    o  NoOfy	
  about	
  relevant	
  changes	
  
    o  Enable	
  reacOons	
  to	
  complex	
  	
  
       	
  	
  structural	
  events	
  




                                                     7	
  
Live	
  Model	
  Queries	
  
  Live	
  Query	
  EvaluaOon:	
                             Live	
  Model	
  Queries	
  for	
  	
  
                                                             Model	
  TransformaOons	
  
   Incremental	
  cache	
  of	
  matches	
  
    o  Maintain	
  a	
  cheap	
  cache	
  	
                 •  Find	
  all	
  contexts	
  a	
  MT	
  rule	
  is	
  
                                                                applicable	
  for	
  
       (only	
  memory	
  overhead)	
  
                                                             •  Live	
  MT	
  rules:	
  triggered	
  
    o  NoOfy	
  about	
  relevant	
  changes	
                  automaOcally	
  upon	
  change	
  
    o  Enable	
  reacOons	
  to	
  complex	
  	
  
       	
  	
  structural	
  events	
                        Live	
  Model	
  Queries	
  for	
  	
  
                                                             Early	
  ValidaOon	
  
                                                             •  Find	
  all	
  violaOons	
  of	
  	
  
                                                                a	
  well-­‐formedness	
  constraint	
  
                                                             •  Immediate	
  re-­‐validaOon	
  	
  
                                                                upon	
  model	
  change	
  

                                                             Live	
  Model	
  Queries	
  for	
  	
  
                                                             Traceability	
  Management	
  
                                                             •  See	
  talk	
  tomorrow	
  at	
  11:30	
  

                                                     8	
  
Example:	
  ValidaOon	
  of	
  BPMN	
  Models	
  
  BPMN	
  models	
  
   o Describing	
  business	
  processes	
  
   o Models	
  control	
  and	
  dataflow	
  
      •  Flowchart-­‐like	
  notaOon	
  




                                           9	
  
Example:	
  ValidaOon	
  of	
  BPMN	
  Models	
  
  Well-­‐formedness	
  validaOon	
  during	
  ediOng	
  
   o Sink	
  AcOvity:	
  acOvity	
  without	
  outgoing	
  edge	
  




                                        10	
  
Example:	
  ValidaOon	
  of	
  BPMN	
  Models	
  
  Well-­‐formedness	
  validaOon	
  during	
  ediOng	
  
   o Sink	
  AcOvity:	
  acOvity	
  without	
  outgoing	
  edge	
  




                                        11	
  
EMF-­‐IncQuery  Framework  
EMF-­‐IncQuery:	
  Architecture	
  Overview	
  
Application
                      Application code



                     Generated pattern     Generative tooling      Query
                         matcher                                specification


API
      Validation     Derived feature       Interpreted
       Engine           support          pattern matcher




INCQUERY Base      RETE Core       INCQUERY Core

                                                 Framework
EMF-­‐IncQuery:	
  Architecture	
  Overview	
  
Application                                          •  Graph pattern-based
                                                        query language
                      Application code               •  Xtext2-based tooling
                                                     •  Execution, testing and
                                                        debugging for queries

                     Generated pattern     Generative tooling          Query
                         matcher                                    specification


API
      Validation     Derived feature       Interpreted
       Engine           support          pattern matcher




INCQUERY Base      RETE Core       INCQUERY Core

                                                 Framework
EMF-­‐IncQuery:	
  Architecture	
  Overview	
  
Application                                              •  Graph pattern-based
                                                            query language
                          Application code               •  Xtext2-based tooling
Typesafe query
wrappers (DTOs)                                          •  Execution, testing and
for easy integration                                        debugging for queries

                         Generated pattern     Generative tooling          Query
                             matcher                                    specification


API
         Validation      Derived feature       Interpreted
          Engine            support          pattern matcher




 INCQUERY Base         RETE Core       INCQUERY Core

                                                     Framework
EMF-­‐IncQuery:	
  Architecture	
  Overview	
  
Application                                                           •  Graph pattern-based
                                                                         query language
                           Application code                           •  Xtext2-based tooling
Typesafe query
wrappers (DTOs)                                                       •  Execution, testing and
for easy integration                                                     debugging for queries

                          Generated pattern                 Generative tooling          Query
                              matcher                                                specification


API
         Validation       Derived feature              Interpreted
          Engine             support                 pattern matcher
                                                                             •  Easy-to-use API for
On-the-fly validation               Efficient maintenance
                                                                                query
and problem marker                  of derived attributes
                                                                                management
management                          and references
                                                                             •  Support for
                                                                                programmed and
 INCQUERY Base          RETE Core          INCQUERY Core                        dynamic queries
                                                                             •  Fully dynamic
                                                                                parameterization
                                                                  Framework
EMF-­‐IncQuery:	
  Architecture	
  Overview	
  
 Application                                                              •  Graph pattern-based
                                                                             query language
                               Application code                           •  Xtext2-based tooling
 Typesafe query
 wrappers (DTOs)                                                          •  Execution, testing and
 for easy integration                                                        debugging for queries

                              Generated pattern                 Generative tooling          Query
                                  matcher                                                specification


 API
          Validation          Derived feature              Interpreted
           Engine                support                 pattern matcher
                                                                                 •  Easy-to-use API for
 On-the-fly validation                  Efficient maintenance
                                                                                    query
 and problem marker                     of derived attributes
                                                                                    management
 management                             and references
                                                                                 •  Support for
                                                                                    programmed and
  INCQUERY Base            RETE Core           INCQUERY Core                        dynamic queries
                                                                                 •  Fully dynamic
High performance         Scalable evaluation for                                    parameterization
backward getters and     complex queries
                                                                      Framework
transitive closure       (over 2 000 000 EObjects)
Simple	
  Graph	
  Pajern	
  in	
  EMF-­‐IncQuery	
  
pattern  sequenceFlowEdge   
     
    
    
(Flow:SequenceEdge,
     
  Src:Activity,  Dst:Activity)=  {
      
SequenceEdge.source(Flow,  Src);
       
SequenceEdge.target(Flow,  Dst);
}
                      source	
       Flow:	
         target	
  
       Src	
  :	
                                                  Dst:	
  
                                   Sequence
      AcOvity	
                                                   AcOvity	
  
                                     Edge	
  




                                            18	
  
And	
  Some	
  More	
  Complex	
  Examples…	
  
pattern  hasOutEdge(A:  Activity)  {
    find  sequenceFlowEdge(_Fr,  A,  _Other);
  }  or  {
    find  messageFlowEdge(_Fr,  A,  _Other);
      Pajern	
  composiOon	
  
}
          (for	
  reuse)	
  
pattern  sinkActivityNames(Name)  {
       
Activity(A);
        
Activity.name(A,  Name);
         
neg  find  hasOutEdge(A);
}
                             NegaOve	
  composiOon	
  
                            (negaOon,	
  quanOficaOon)	
  
                             19	
  
EMF-­‐INCQUERY	
  Development	
  Tools	
  
EMF-­‐INCQUERY	
  Development	
  Tools	
  




       Pajern	
  Editor	
       EMF	
  Instance	
  Model	
  




                                       Query	
  Explorer	
  
EMF-­‐INCQUERY	
  Development	
  Tools	
  




       Pajern	
  Editor	
       EMF	
  Instance	
  Model	
  




                                       Query	
  Explorer	
  
EMF-­‐INCQUERY	
  Development	
  Tools	
  
                                      •  Works	
  with	
  most	
  	
  
                                         EMF	
  editors	
  	
  
                                         out-­‐of-­‐the-­‐box	
  
                                      •  Reveals	
  matches	
  	
  
                                         as	
  selecOon	
  


               Pajern	
  Editor	
                  EMF	
  Instance	
  Model	
  


Query	
  results	
  
recalculated	
  	
  
on-­‐the-­‐fly	
  
                                                           Query	
  Explorer	
  
Visualiza<on  of  Live  Model  Queries  
         in  EMF-­‐IncQuery  
Requirements	
  for	
  Query	
  VisualizaOon	
  
Genericity	
                                  Incrementality	
  
•  MulOple	
  Model	
  Sources	
              •  Query	
  Changes	
  
   •  Model	
  Editors	
                      •  Model	
  Changes	
  
   •  Current	
  SelecOon	
  


Traceability	
                                PresentaOon	
  
•  Query	
  DefiniOons	
                       •  Filtering	
  
•  Input	
  Model	
                           •  Grouping	
  


                                     25	
  
Proposed	
  Architecture	
  of	
  Query	
  Visualizer	
  
                                     Edited	
  
                                  Model	
  
                                   Edited	
  
                                     Query	
                               Other	
  Model	
  
                                    Query	
  
                                  Editors	
                                  Sources	
  

                                                            Connectors	
  
                                                                              Model	
  and	
  
                           Filtered	
  group	
  of	
                          NoOficaOons	
  
                                queries	
                     Query	
  
            Query	
  
          Repository	
                                        Engine	
  
  Query	
                                                                  Query	
  Result	
  
                            Query	
  Results	
  
  DefiniOon	
                                                               Deltas	
  

                      Query	
  Result	
  Viewer	
  


                                                   26	
  
Model	
  Source	
  Connectors	
  for	
  Genericity	
  
  Different	
  model	
  sources	
                                 Edited	
  
                                                                 Edited	
  
                                                                Model	
  
                                                                                               Other	
  
                                                                  Query	
                      Model	
  
   o  Graphical	
  (e.g	
  BPMN,	
  UML)	
                       Query	
  
                                                                Editors	
  
                                                                                              Sources	
  
   o  Textual	
  (e.g.	
  OCL)	
  
                                                                             Connectors	
  
   o  Different	
  implementaOon	
                                                             Model	
  and	
  
      technologies	
                                                           Query	
  
                                                                                              NoOficaOons	
  

Model  source  connectors                                                     Engine	
  

  OperaOons	
  
                                                    Genericity                        Incrementality
   o  Open	
  model	
                               • Multiple Model Sources          • Query	
  Changes
   o  Send	
  noOficaOon	
  upon	
  model	
            • Model	
  Editors
                                                      • Current	
  Selection
                                                                                      • Model	
  Changes

      change	
  
   o  Get	
  current	
  selecOon	
                  Traceability
                                                    • Query	
  Definitions
                                                                                      Presentation
                                                                                      • Filtering
   o  Close	
  editor	
                             • Input	
  Model                  • Grouping



                                           27	
  
Query-­‐based	
  Indexing	
  for	
  Incrementality	
  
  Update	
  query	
  results	
                                            Query-­‐based  indexing  
   incrementally	
  upon	
  
    o  Model	
  updates	
                                                  • Contains	
  model	
  elements	
  accessed	
  
            •  E.g.	
  using	
  the	
  built-­‐in	
  editor	
                by	
  the	
  query	
  
            •  Engine:	
  handles	
  this	
  case	
                        • Populated	
  by	
  an	
  exhausOve	
  model	
  
               internally	
                                                  traversal	
  (can	
  be	
  slow!)	
  
    o  Query	
  updates	
                                                  • Goal:	
  Avoid	
  unnecessary	
  re-­‐
            •  E.g.	
  using	
  the	
  query	
  editor	
                     traversal	
  
            •  Engine:	
  rebuilds	
  internal	
  model	
  
               indexes	
                                                   Strategy	
  1:	
  	
  
                                                                           Generic	
  model	
  indexer	
  
   Genericity                        Incrementality
                                                                           • “Wildcard	
  mode”:	
  	
  
   • Multiple Model Sources          • Query	
  Changes
     • Model	
  Editors              • Model	
  Changes
                                                                             index	
  every	
  model	
  element	
  
     • Current	
  Selection                                                • Higher	
  memory	
  consumpOon	
  

   Traceability                      Presentation                          Strategy	
  2:	
  	
  
   • Query	
  Definitions            • Filtering                           Group	
  iniOalizaOon	
  
   • Input	
  Model                  • Grouping
                                                                           • IniOalize	
  several	
  pajerns	
  together	
  

                                                                  28	
  
Traceability	
  and	
  NavigaOon	
  
  Maintaining	
  source	
  models	
                        Query	
  
                                                            Editor	
  
                                                                                   Edited	
  
                                                                                  Edited	
  
                                                                                 Model	
  
                                                                                   Query	
  
                                                                                  Query	
  
                                                                                 Editors	
  
                                                                                                         Other	
  Model	
  
                                                                                                           Sources	
  
   and	
  queries	
                                                                        Connectors	
  

  Support	
  for	
  navigaOng	
  to/
   highlighOng	
                                           Query	
  
                                                         Repository	
  
                                                                                                Query	
  
                                                                                                Engine	
  

   o Corresponding	
  query	
  
     definiOons	
                                                         Query	
  Result	
  Viewer	
  

       •  HighlighOng	
  funcOonality	
  in	
  the	
  
          query	
  editor	
                         Genericity                              Incrementality
   o Referenced	
  model	
  element(s)	
  • Multiple Model Sources
                                            • Model	
  Editors
                                                                                            • Query	
  Changes
                                                                                            • Model	
  Changes
       •  Editor-­‐dependent	
                          • Current	
  Selection

          implementaOon	
                             Traceability                          Presentation
       •  Model  source  connector                    • Query	
  Definitions                • Filtering
          handles	
  funcOonality	
                   • Input	
  Model                      • Grouping


                                             29	
  
Traceability	
  in	
  Query	
  Visualizer	
  




      Pajern	
  Editor	
           EMF	
  Instance	
  Model	
  




                                          Query	
  Explorer	
  
Traceability	
  in	
  Query	
  Visualizer	
  




      Pajern	
  Editor	
           EMF	
  Instance	
  Model	
  




                                          Query	
  Explorer	
  
Grouping	
  and	
  Filtering	
  for	
  PresentaOon	
  
  Define	
  query	
  groups	
  
   („related”	
  queries)	
                   Query	
                  Query	
                  Query	
  Result	
  
    o StaOc	
  groups	
                       DefiniOons	
              Results	
                Deltas	
  
        •  E.g.	
  Namespaces	
                                       Query	
  Result	
  Viewer	
  
    o Dynamic	
  groups	
  
        •  E.g.	
  Dependency	
  based	
  
  Filtering	
  
                                                         Genericity                     Incrementality
    o Filter	
  visible	
  queries	
                     • Multiple Model Sources       • Query	
  Changes
                                                           • Model	
  Editors           • Model	
  Changes
        •  Uses	
  hints	
  from	
  developer	
            • Current	
  Selection

        •  Manual	
  overriding	
  
                                                         Traceability                   Presentation
    o Filter	
  query	
  results	
                       • Query	
  Definitions         • Filtering
                                                         • Input	
  Model               • Grouping
        •  By	
  binding	
  query	
  parameters	
  
                                                32	
  
Result	
  Viewer	
  




         33	
  
Result	
  Viewer	
  
Different	
  model	
  
    Szöveg	
  
   sources	
  




                  34	
  
Result	
  Viewer	
  
                       Loaded	
  
                       Queries	
  




         35	
  
Result	
  Viewer	
  




                       Query	
  Results	
  




         36	
  
Filtering	
  Visible	
  Queries	
  




                 37	
  
Filtering	
  Visible	
  Queries	
  




Elements	
  in	
  Query	
  
    Registry	
  

                              38	
  
Filtering	
  Visible	
  Queries	
  




                           Queries	
  Loaded	
  



                 39	
  
Query	
  Result	
  Filtering	
  




               40	
  
Query	
  Result	
  Filtering	
  




               41	
  
Conclusions	
  and	
  Future	
  Work	
  
 R1.	
  Genericity	
                  Edited	
  
                                   Model	
  
                                    Edited	
  
                                                                            Other	
  Model	
  
R3.	
  Traceability	
                 Query	
  
                                     Query	
  
                                   Editors	
                                  Sources	
  

R3.	
  Traceability	
                                        Connectors	
  
R4.	
  PresentaOon	
  
                                                                               Model	
  and	
  
                            Filtered	
  group	
  of	
                          R2.	
  Incrementality	
  
                                                                               NoOficaOons	
  
                                 queries	
                     Query	
  
             Query	
  
           Repository	
                                        Engine	
  
                                                                            Query	
  Result	
  
  Query	
                     Query	
  Results	
                            Deltas	
  
  DefiniOon	
  

                          Query	
  Result	
  Viewer	
                          R4.	
  PresentaOon	
  


                                                    42	
  
Conclusions	
  and	
  Future	
  Work	
  
    R1.	
  Genericity	
                   Edited	
  
                                       Model	
  
                                        Edited	
  
                                                                                Other	
  Model	
  
   R3.	
  Traceability	
                  Query	
  
                                         Query	
  
                                       Editors	
                                  Sources	
  

    R3.	
  Traceability	
                                        Connectors	
  
    R4.	
  PresentaOon	
  
                                                                                   Model	
  and	
  
                                Filtered	
  group	
  of	
                          R2.	
  Incrementality	
  
                                                                                   NoOficaOons	
  
                                     queries	
                     Query	
  
                Query	
  
              Repository	
                                         Engine	
  
                                                                                Query	
  Result	
  
      Query	
                     Query	
  Results	
                            Deltas	
  
      DefiniOon	
  

                              Query	
  Result	
  Viewer	
                          R4.	
  PresentaOon	
  
Future	
  Plans	
  
•  Analysis-­‐based	
  grouping	
  
•  Graph-­‐based	
  result	
  visualizaOon	
            43	
  

Developing and Visualizing Live Model Queries

  • 1.
    Developing  and  Visualizing   Live  Model  Queries   Zoltán  Ujhelyi,  Tamás  Szabó   István  Ráth,  Dániel  Varró   Ábel  Hegedüs  (demonstrator)   Budapest  University  of  Technology  and  Economics   Department  of  Measurement  and  Informa<on  Systems  
  • 2.
    What  is  a  Model  Query?     ModelQuery(A,B)   Cond(A,B)   o  Retrieve  tuples  of   model  elements  A,B   o  SaOsfying  the  query   condiOon  Cond   o  Enumerate     one  /  all  instances   o  With  A,B  as     input  or  output   parameters   2  
  • 3.
    What  is  a  Model  Query?     ModelQuery(A,B)   AUTOSAR   Cond(A,B)   •  Select  pairs  of  SystemSignal  and   o  Retrieve  tuples  of   its  signal  group  which  are  not  in   the  same  IPDU   model  elements  A,B   o  SaOsfying  the  query   condiOon  Cond   IMA   •  Find  instances  of  cri;cal  func;ons   o  Enumerate     not  running  on  different   one  /  all  instances   processors  of  different  chassis   o  With  A,B  as     input  or  output   BPMN   parameters   •  Show  sink  ac;vi;es  with  no   outgoing  flow   3  
  • 4.
    What  is  a  Model  Query?     ModelQuery(A,B)   AUTOSAR   Cond(A,B)   •  Select  pairs  of  SystemSignal  and   o  Retrieve  tuples  of   its  signal  group  which  are  not  in   the  same  IPDU   model  elements  A,B   o  SaOsfying  the  query   condiOon  Cond   IMA   •  Find  instances  of  cri;cal  func;ons   o  Enumerate     not  running  on  different   one  /  all  instances   processors  of  different  chassis   o  With  A,B  as     input  or  output   BPMN   parameters   •  Show  sink  ac;vi;es  with  no   outgoing  flow   4  
  • 5.
    Live  Model  Queries     Live  Query  EvaluaOon:   Incremental  cache  of  matches   o  Maintain  a  cheap  cache     (only  memory  overhead)   o  NoOfy  about  relevant  changes   o  Enable  reacOons  to  complex        structural  events   5  
  • 6.
    Live  Model  Queries     Live  Query  EvaluaOon:   Incremental  cache  of  matches   o  Maintain  a  cheap  cache     (only  memory  overhead)   o  NoOfy  about  relevant  changes   o  Enable  reacOons  to  complex        structural  events   6  
  • 7.
    Live  Model  Queries     Live  Query  EvaluaOon:   Incremental  cache  of  matches   o  Maintain  a  cheap  cache     (only  memory  overhead)   o  NoOfy  about  relevant  changes   o  Enable  reacOons  to  complex        structural  events   7  
  • 8.
    Live  Model  Queries     Live  Query  EvaluaOon:   Live  Model  Queries  for     Model  TransformaOons   Incremental  cache  of  matches   o  Maintain  a  cheap  cache     •  Find  all  contexts  a  MT  rule  is   applicable  for   (only  memory  overhead)   •  Live  MT  rules:  triggered   o  NoOfy  about  relevant  changes   automaOcally  upon  change   o  Enable  reacOons  to  complex        structural  events   Live  Model  Queries  for     Early  ValidaOon   •  Find  all  violaOons  of     a  well-­‐formedness  constraint   •  Immediate  re-­‐validaOon     upon  model  change   Live  Model  Queries  for     Traceability  Management   •  See  talk  tomorrow  at  11:30   8  
  • 9.
    Example:  ValidaOon  of  BPMN  Models     BPMN  models   o Describing  business  processes   o Models  control  and  dataflow   •  Flowchart-­‐like  notaOon   9  
  • 10.
    Example:  ValidaOon  of  BPMN  Models     Well-­‐formedness  validaOon  during  ediOng   o Sink  AcOvity:  acOvity  without  outgoing  edge   10  
  • 11.
    Example:  ValidaOon  of  BPMN  Models     Well-­‐formedness  validaOon  during  ediOng   o Sink  AcOvity:  acOvity  without  outgoing  edge   11  
  • 12.
  • 13.
    EMF-­‐IncQuery:  Architecture  Overview   Application Application code Generated pattern Generative tooling Query matcher specification API Validation Derived feature Interpreted Engine support pattern matcher INCQUERY Base RETE Core INCQUERY Core Framework
  • 14.
    EMF-­‐IncQuery:  Architecture  Overview   Application •  Graph pattern-based query language Application code •  Xtext2-based tooling •  Execution, testing and debugging for queries Generated pattern Generative tooling Query matcher specification API Validation Derived feature Interpreted Engine support pattern matcher INCQUERY Base RETE Core INCQUERY Core Framework
  • 15.
    EMF-­‐IncQuery:  Architecture  Overview   Application •  Graph pattern-based query language Application code •  Xtext2-based tooling Typesafe query wrappers (DTOs) •  Execution, testing and for easy integration debugging for queries Generated pattern Generative tooling Query matcher specification API Validation Derived feature Interpreted Engine support pattern matcher INCQUERY Base RETE Core INCQUERY Core Framework
  • 16.
    EMF-­‐IncQuery:  Architecture  Overview   Application •  Graph pattern-based query language Application code •  Xtext2-based tooling Typesafe query wrappers (DTOs) •  Execution, testing and for easy integration debugging for queries Generated pattern Generative tooling Query matcher specification API Validation Derived feature Interpreted Engine support pattern matcher •  Easy-to-use API for On-the-fly validation Efficient maintenance query and problem marker of derived attributes management management and references •  Support for programmed and INCQUERY Base RETE Core INCQUERY Core dynamic queries •  Fully dynamic parameterization Framework
  • 17.
    EMF-­‐IncQuery:  Architecture  Overview   Application •  Graph pattern-based query language Application code •  Xtext2-based tooling Typesafe query wrappers (DTOs) •  Execution, testing and for easy integration debugging for queries Generated pattern Generative tooling Query matcher specification API Validation Derived feature Interpreted Engine support pattern matcher •  Easy-to-use API for On-the-fly validation Efficient maintenance query and problem marker of derived attributes management management and references •  Support for programmed and INCQUERY Base RETE Core INCQUERY Core dynamic queries •  Fully dynamic High performance Scalable evaluation for parameterization backward getters and complex queries Framework transitive closure (over 2 000 000 EObjects)
  • 18.
    Simple  Graph  Pajern  in  EMF-­‐IncQuery   pattern  sequenceFlowEdge           (Flow:SequenceEdge,  Src:Activity,  Dst:Activity)=  { SequenceEdge.source(Flow,  Src); SequenceEdge.target(Flow,  Dst); } source   Flow:   target   Src  :   Dst:   Sequence AcOvity   AcOvity   Edge   18  
  • 19.
    And  Some  More  Complex  Examples…   pattern  hasOutEdge(A:  Activity)  {    find  sequenceFlowEdge(_Fr,  A,  _Other);  }  or  {    find  messageFlowEdge(_Fr,  A,  _Other); Pajern  composiOon   } (for  reuse)   pattern  sinkActivityNames(Name)  { Activity(A); Activity.name(A,  Name); neg  find  hasOutEdge(A); } NegaOve  composiOon   (negaOon,  quanOficaOon)   19  
  • 20.
  • 21.
    EMF-­‐INCQUERY  Development  Tools   Pajern  Editor   EMF  Instance  Model   Query  Explorer  
  • 22.
    EMF-­‐INCQUERY  Development  Tools   Pajern  Editor   EMF  Instance  Model   Query  Explorer  
  • 23.
    EMF-­‐INCQUERY  Development  Tools   •  Works  with  most     EMF  editors     out-­‐of-­‐the-­‐box   •  Reveals  matches     as  selecOon   Pajern  Editor   EMF  Instance  Model   Query  results   recalculated     on-­‐the-­‐fly   Query  Explorer  
  • 24.
    Visualiza<on  of  Live Model  Queries   in  EMF-­‐IncQuery  
  • 25.
    Requirements  for  Query  VisualizaOon   Genericity   Incrementality   •  MulOple  Model  Sources   •  Query  Changes   •  Model  Editors   •  Model  Changes   •  Current  SelecOon   Traceability   PresentaOon   •  Query  DefiniOons   •  Filtering   •  Input  Model   •  Grouping   25  
  • 26.
    Proposed  Architecture  of  Query  Visualizer   Edited   Model   Edited   Query   Other  Model   Query   Editors   Sources   Connectors   Model  and   Filtered  group  of   NoOficaOons   queries   Query   Query   Repository   Engine   Query   Query  Result   Query  Results   DefiniOon   Deltas   Query  Result  Viewer   26  
  • 27.
    Model  Source  Connectors  for  Genericity     Different  model  sources   Edited   Edited   Model   Other   Query   Model   o  Graphical  (e.g  BPMN,  UML)   Query   Editors   Sources   o  Textual  (e.g.  OCL)   Connectors   o  Different  implementaOon   Model  and   technologies   Query   NoOficaOons   Model  source  connectors   Engine     OperaOons   Genericity Incrementality o  Open  model   • Multiple Model Sources • Query  Changes o  Send  noOficaOon  upon  model   • Model  Editors • Current  Selection • Model  Changes change   o  Get  current  selecOon   Traceability • Query  Definitions Presentation • Filtering o  Close  editor   • Input  Model • Grouping 27  
  • 28.
    Query-­‐based  Indexing  for  Incrementality     Update  query  results   Query-­‐based  indexing   incrementally  upon   o  Model  updates   • Contains  model  elements  accessed   •  E.g.  using  the  built-­‐in  editor   by  the  query   •  Engine:  handles  this  case   • Populated  by  an  exhausOve  model   internally   traversal  (can  be  slow!)   o  Query  updates   • Goal:  Avoid  unnecessary  re-­‐ •  E.g.  using  the  query  editor   traversal   •  Engine:  rebuilds  internal  model   indexes   Strategy  1:     Generic  model  indexer   Genericity Incrementality • “Wildcard  mode”:     • Multiple Model Sources • Query  Changes • Model  Editors • Model  Changes index  every  model  element   • Current  Selection • Higher  memory  consumpOon   Traceability Presentation Strategy  2:     • Query  Definitions • Filtering Group  iniOalizaOon   • Input  Model • Grouping • IniOalize  several  pajerns  together   28  
  • 29.
    Traceability  and  NavigaOon     Maintaining  source  models   Query   Editor   Edited   Edited   Model   Query   Query   Editors   Other  Model   Sources   and  queries   Connectors     Support  for  navigaOng  to/ highlighOng   Query   Repository   Query   Engine   o Corresponding  query   definiOons   Query  Result  Viewer   •  HighlighOng  funcOonality  in  the   query  editor   Genericity Incrementality o Referenced  model  element(s)  • Multiple Model Sources • Model  Editors • Query  Changes • Model  Changes •  Editor-­‐dependent   • Current  Selection implementaOon   Traceability Presentation •  Model  source  connector     • Query  Definitions • Filtering handles  funcOonality   • Input  Model • Grouping 29  
  • 30.
    Traceability  in  Query  Visualizer   Pajern  Editor   EMF  Instance  Model   Query  Explorer  
  • 31.
    Traceability  in  Query  Visualizer   Pajern  Editor   EMF  Instance  Model   Query  Explorer  
  • 32.
    Grouping  and  Filtering  for  PresentaOon     Define  query  groups   („related”  queries)   Query   Query   Query  Result   o StaOc  groups   DefiniOons   Results   Deltas   •  E.g.  Namespaces   Query  Result  Viewer   o Dynamic  groups   •  E.g.  Dependency  based     Filtering   Genericity Incrementality o Filter  visible  queries   • Multiple Model Sources • Query  Changes • Model  Editors • Model  Changes •  Uses  hints  from  developer   • Current  Selection •  Manual  overriding   Traceability Presentation o Filter  query  results   • Query  Definitions • Filtering • Input  Model • Grouping •  By  binding  query  parameters   32  
  • 33.
  • 34.
    Result  Viewer   Different  model   Szöveg   sources   34  
  • 35.
    Result  Viewer   Loaded   Queries   35  
  • 36.
    Result  Viewer   Query  Results   36  
  • 37.
  • 38.
    Filtering  Visible  Queries   Elements  in  Query   Registry   38  
  • 39.
    Filtering  Visible  Queries   Queries  Loaded   39  
  • 40.
  • 41.
  • 42.
    Conclusions  and  Future  Work   R1.  Genericity   Edited   Model   Edited   Other  Model   R3.  Traceability   Query   Query   Editors   Sources   R3.  Traceability   Connectors   R4.  PresentaOon   Model  and   Filtered  group  of   R2.  Incrementality   NoOficaOons   queries   Query   Query   Repository   Engine   Query  Result   Query   Query  Results   Deltas   DefiniOon   Query  Result  Viewer   R4.  PresentaOon   42  
  • 43.
    Conclusions  and  Future  Work   R1.  Genericity   Edited   Model   Edited   Other  Model   R3.  Traceability   Query   Query   Editors   Sources   R3.  Traceability   Connectors   R4.  PresentaOon   Model  and   Filtered  group  of   R2.  Incrementality   NoOficaOons   queries   Query   Query   Repository   Engine   Query  Result   Query   Query  Results   Deltas   DefiniOon   Query  Result  Viewer   R4.  PresentaOon   Future  Plans   •  Analysis-­‐based  grouping   •  Graph-­‐based  result  visualizaOon   43