blob: 5a9ae7414fd86314c25365bb78a3b3981f09d8b1 [file] [log] [blame]
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QVT Declarative Documentation</title>
<link href="book.css" rel="stylesheet" type="text/css">
<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="book" title="QVT Declarative Documentation">
<div class="titlepage">
<div>
<div>
<h1 class="title">
<a name="N10001"></a>QVT Declarative Documentation</h1>
</div>
</div>
<hr>
</div>
<div class="toc">
<p>
<b>Table of Contents</b>
</p>
<dl>
<dt>
<span class="chapter"><a href="#OverviewandGettingStarted">1. Overview and Getting Started</a></span>
</dt>
<dd>
<dl>
<dt>
<span class="section"><a href="#WhatisQVTQueryViewTransformation">What is
<em class="glossterm">QVT</em>?
</a></span>
</dt>
<dt>
<span class="section"><a href="#HowDoesItWork">How Does It Work?</a></span>
</dt>
<dt>
<span class="section"><a href="#WhoisBehindEclipseQVTd">Who is Behind Eclipse QVTd?</a></span>
</dt>
<dt>
<span class="section"><a href="#GettingStarted">Getting Started</a></span>
</dt>
<dt>
<span class="section"><a href="#Extensions">Extensions</a></span>
</dt>
</dl>
</dd>
<dt>
<span class="chapter"><a href="#pivot">2.
<span class="bold"><strong>
<code class="code">pivot</code>
</strong></span>
</a></span>
</dt>
<dd>
<dl>
<dt>
<span class="section"><a href="#OCLExpression">
<span class="bold"><strong>
<code class="code">OCLExpression</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#Property">
<span class="bold"><strong>
<code class="code">Property</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#VariableDeclaration">
<span class="bold"><strong>
<code class="code">VariableDeclaration</code>
</strong></span>
</a></span>
</dt>
</dl>
</dd>
<dt>
<span class="chapter"><a href="#qvtimperative">3.
<span class="bold"><strong>
<code class="code">qvtimperative</code>
</strong></span>
</a></span>
</dt>
<dd>
<dl>
<dt>
<span class="section"><a href="#AddStatement">
<span class="bold"><strong>
<code class="code">AddStatement</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#AppendParameter">
<span class="bold"><strong>
<code class="code">AppendParameter</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#AppendParameterBinding">
<span class="bold"><strong>
<code class="code">AppendParameterBinding</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#BufferStatement">
<span class="bold"><strong>
<code class="code">BufferStatement</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#CheckStatement">
<span class="bold"><strong>
<code class="code">CheckStatement</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#ConnectionVariable">
<span class="bold"><strong>
<code class="code">ConnectionVariable</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#DeclareStatement">
<span class="bold"><strong>
<code class="code">DeclareStatement</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#GuardParameter">
<span class="bold"><strong>
<code class="code">GuardParameter</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#GuardParameterBinding">
<span class="bold"><strong>
<code class="code">GuardParameterBinding</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#ImperativeModel">
<span class="bold"><strong>
<code class="code">ImperativeModel</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#ImperativeTransformation">
<span class="bold"><strong>
<code class="code">ImperativeTransformation</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#ImperativeTypedModel">
<span class="bold"><strong>
<code class="code">ImperativeTypedModel</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#LoopParameterBinding">
<span class="bold"><strong>
<code class="code">LoopParameterBinding</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#LoopVariable">
<span class="bold"><strong>
<code class="code">LoopVariable</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#Mapping">
<span class="bold"><strong>
<code class="code">Mapping</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#MappingCall">
<span class="bold"><strong>
<code class="code">MappingCall</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#MappingLoop">
<span class="bold"><strong>
<code class="code">MappingLoop</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#MappingParameter">
<span class="bold"><strong>
<code class="code">MappingParameter</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#MappingParameterBinding">
<span class="bold"><strong>
<code class="code">MappingParameterBinding</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#MappingStatement">
<span class="bold"><strong>
<code class="code">MappingStatement</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#NewStatement">
<span class="bold"><strong>
<code class="code">NewStatement</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#ObservableStatement">
<span class="bold"><strong>
<code class="code">ObservableStatement</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#SetStatement">
<span class="bold"><strong>
<code class="code">SetStatement</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#SimpleParameter">
<span class="bold"><strong>
<code class="code">SimpleParameter</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#SimpleParameterBinding">
<span class="bold"><strong>
<code class="code">SimpleParameterBinding</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#Statement">
<span class="bold"><strong>
<code class="code">Statement</code>
</strong></span>
</a></span>
</dt>
<dt>
<span class="section"><a href="#VariableStatement">
<span class="bold"><strong>
<code class="code">VariableStatement</code>
</strong></span>
</a></span>
</dt>
</dl>
</dd>
<dt>
<span class="appendix"><a href="#glossary">A. Glossary</a></span>
</dt>
</dl>
</div>
<div class="chapter" title="Chapter&nbsp;1.&nbsp;Overview and Getting Started">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="OverviewandGettingStarted"></a>Chapter&nbsp;1.&nbsp;Overview and Getting Started</h2>
</div>
</div>
</div>
<p>For a quick demonstration of QVTc or QVTr editing and execution go to
<a class="link" href="#GettingStarted" title="Getting Started">Getting Started</a>.
</p>
<p>A PDF version of this documentation is available at
<a class="ulink" href="http://download.eclipse.org/qvtd/doc/0.14.0/qvtd.pdf" target="_new">QVTd 0.14.0 Documentation</a>.
</p>
<div class="section" title="What is QVT?">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="WhatisQVTQueryViewTransformation"></a>What is
<em class="glossterm">QVT</em>?
</h2>
</div>
</div>
</div>
<p>The
<a class="ulink" href="http://www.omg.org/spec/QVT/" target="_new">Query/View/Transformation language</a> is the model transformation language specified by the
<em class="glossterm">OMG</em> (Object Management Group). Or rather it is three specified languages to which Eclipse QVTd adds five intermediate languages.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>QVTo &ndash; Operation Mappings is an imperative transformation language supported by the
<a class="ulink" href="https://projects.eclipse.org/projects/modeling.mmt.qvt-oml" target="_new">Eclipse QVTo project</a>.
</p>
</li>
</ul>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>QVTr &ndash; Relations is a rich declarative transformation language.</p>
</li>
</ul>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>QVTc &ndash; Core is a simple core declarative transformation language.</p>
</li>
</ul>
</div>
<p>QVTc and QVTr, generically referred to as QVTd, are supported the
<a class="ulink" href="https://projects.eclipse.org/projects/modeling.mmt.qvtd" target="_new">Eclipse QVTd project</a> (QVT Declarative) and documented here.
</p>
<p>
</p>
<div class="mediaobject">
<img src="images/QVThorizontalAlphabet.png"></div>
<p>
</p>
<p>The Eclipse QVTd support involves a transformation chain from QVTr via QVTc to executable form. The stages in this chain are:</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>QVTu &ndash; a unidirectional declarative transformation language &ndash; a simplification of QVTc.</p>
</li>
</ul>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>QVTm &ndash; a minimal declarative transformation language &ndash; a further simplification of QVTc.</p>
</li>
</ul>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>QVTp &ndash; a partitioned declarative transformation language &ndash; a further simplification of QVTc.</p>
</li>
</ul>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>QVTs &ndash; a graphical declarative transformation language suitable for schedule determination.</p>
</li>
</ul>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>QVTi &ndash; an executable imperative transformation language &ndash; a variant of QVTc.</p>
</li>
</ul>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>Java &ndash; the ultimate executable form</p>
</li>
</ul>
</div>
<p>Note that QVTu, QVTm, QVTp, QVTs and QVTi are not defined by the current OMG specification. It is possible that they may contribute to a future specification.</p>
<div class="section" title="Modeling Layers">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="ModelingLayers"></a>Modeling Layers</h3>
</div>
</div>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>
<span class="emphasis"><em>EMF is Modeled Structure</em></span>
</p>
</li>
</ul>
</div>
<p>The Eclipse Modeling Framework (
<em class="glossterm">EMF</em>) supports the definition of structural meta-models and the subsequent use of models conforming to these meta-models. EMF also supports generating of Java code to represent the meta-models. Additional Java code can be provided to add behavior to the structural meta-models.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>
<span class="emphasis"><em>OCL is EMF and Modeled Behavior</em></span>
</p>
</li>
</ul>
</div>
<p>
<em class="glossterm">OCL</em> provides a modeling language that allows the behavior to be embedded within the structural meta-models or provided as a complement to those meta-models. As a modeling language, OCL understands the models and so OCL code is much more compact than the equivalent Java. OCL code can be statically checked, whereas the corresponding Java code often uses reflection and so cannot be checked.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>
<span class="emphasis"><em>QVT is Modeled Model Execution</em></span>
</p>
</li>
</ul>
</div>
<p>Eclipse QVTd is an implementation of the OMG QVT 1.3 specification for use with Ecore and UML meta-models.</p>
<p>Eclipse QVTd exploits the extensibility of the Eclipse OCL Pivot model.</p>
</div>
</div>
<div class="section" title="How Does It Work?">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="HowDoesItWork"></a>How Does It Work?</h2>
</div>
</div>
</div>
<p>QVTr and QVTc are programming languages, so you will want to edit them, execute them and debug them.</p>
<div class="section" title="Editing">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="Editing"></a>Editing</h3>
</div>
</div>
</div>
<p>Eclipse QVTd provides QVTr, QVTc and QVTi editors developed using Xtext. The QVTc editor may be used to view or maintain the intermediate QVTu, QVTm and QVTp models.</p>
<p>The editor may be opened conventionally by double clicking a *.qvtr, *.qvtc, or *.qvti text file name in an Explorer view. This displays the source text with syntax highlighting and an outline of the Abstract Syntax.</p>
<p>The QVTc and QVTi editors may also be used to view *.qvtcas and *.qvtias XMI files as source text. </p>
<div class="section" title="Status">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="Status"></a>Status</h4>
</div>
</div>
</div>
<p>These editors have been available since QVTd 0.9.0. They are useful, but currently have only limited well-formedness validation.</p>
<p>Editing *.qvtcas and *.qvtias files should be possible but is not recommended in the current release.</p>
<p>Hopefully 1.0.0 (Oxygen) will offer UMLX as a graphical alternative to the QVTr textual exposition of a transformation.</p>
</div>
</div>
<div class="section" title="Execution">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="Execution"></a>Execution</h3>
</div>
</div>
</div>
<p>The 0.14.0 release provides one UMLX, one QVTr and one QVTc example project that can be installed and executed. However execution functionality is very new and not suitable for more than experimental use.</p>
<div class="section" title="Status">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="Status2"></a>Status</h4>
</div>
</div>
</div>
<p>QVTi execution has been available since 0.11.0 (Luna). It demonstrates the extensibility of the Eclipse OCL interpreter, Java code generator and debugger. QVTi is a low level intermediate; it is not intended as a primary programming language.</p>
<p>A very preliminary form of QVTc execution was available in 0.12.0 (Mars) using an Epsilon prototype of the transformation chain.</p>
<p>0.13.0 (Neon) introduces a Java re-implementation of the full transformation chain so that QVTr and QVTc transformations can be executed. It is only suitable for researchers.</p>
<p>The current execution supports only creation of output models. Checking, updated, incremental, in-place execution and views are work in progress.</p>
<p>0.14.0 (Neon) has much better transformaion, scheduling and execution but functionality such as RElation overriding and In-Place transformation are largely missing and certainly not usefully functional.</p>
<p>Hopefully 1.0.0 (Photon) will have more substantial functionality and will be used internally to replace some of the manual Java transformations by QVTr / UMLX transformations.</p>
</div>
</div>
<div class="section" title="Debugger">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="Debugger"></a>Debugger</h3>
</div>
</div>
</div>
<p>The QVTi debugger extends the OCL debugger.</p>
<div class="section" title="Status">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="Status3"></a>Status</h4>
</div>
</div>
</div>
<p>The further extension to provide QVTc and QVTr debugging is work in progress.</p>
</div>
</div>
</div>
<div class="section" title="Who is Behind Eclipse QVTd?">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="WhoisBehindEclipseQVTd"></a>Who is Behind Eclipse QVTd?</h2>
</div>
</div>
</div>
<p>Eclipse QVTd is an Open Source project. All code has been developed under the auspices of Eclipse.</p>
<p>Eclipse QVTd is a largely one man development by Ed Willink who has been the OMG QVT
<em class="glossterm">RTF</em> (Revision Task Force) chair since QVT 1.2. Expect further revisions of the QVT specification to exploit feedback from the Eclipse QVTo and QVTd projects.
</p>
<p>There is now a significant personnel and corporate overlap between the Eclipse QVTd committers and the OMG QVT RTF and so Eclipse OCL is pioneering solutions to many of the under-specification problems in the OCL specification.</p>
<p>Ed Willink is also project lead of the Eclipse OCL where the new pivot-based implementation prototypes solutions to many problems with the OMG OCL specification for which Ed Willink has been the RTF chair since OCL 2.4.</p>
<p>The many aspects of OCL and QVTd are converging; help welcome.</p>
</div>
<div class="section" title="Getting Started">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="GettingStarted"></a>Getting Started</h2>
</div>
</div>
</div>
<p>
<span class="bold"><strong>Warning: Eclipse QVTd 0.14.0 execution is not sufficiently mature for more than experimental/research usage.</strong></span>
</p>
<p>For a very quick demonstration of QVTc or QVTr you may install the appropriate example project.</p>
<div class="section" title="QVTr Example Project">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="QVTrExampleProject"></a>QVTr Example Project</h3>
</div>
</div>
</div>
<p>Invoke
<span class="bold"><strong>File-&gt;New-&gt;Example...</strong></span> then select
<span class="bold"><strong>Examples</strong></span> then
<span class="bold"><strong>QVT (Query/View/Transformation Language) Projects</strong></span> then select either
<span class="bold"><strong>QVTr HSTM2FSTM Project</strong></span> then
<span class="bold"><strong>Finish</strong></span> to create a small example project called
<span class="bold"><strong>org.eclipse.qvtd.examples.qvtrelation.hstm2fstm</strong></span>.
</p>
<p>A QVTr or QVTc editor opens to show the transformation.</p>
<p>
</p>
<div class="mediaobject">
<img src="images/QVTrEditor.png"></div>
<p>
</p>
<p>The image shows one of the mappings with hovertext elaborating the declaration referenced by
<span class="bold"><strong>name</strong></span>.
</p>
<p>The QVT editors extend the OCL editor and so the OCL context menu provides useful functionality such as saving the transformation in Abstyract Syntax form.</p>
<p>A QVTr project is currently just a normal Java project. (A QVTd nature may be added in the future to support auto-building.)</p>
<p>
</p>
<div class="mediaobject">
<img src="images/QVTrProject.png"></div>
<p>
</p>
<p>The QVTr Hierarchical to Flat State Machine example contains</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>
<span class="bold"><strong>HierarchicalStateMachine2FlatStateMachine.qvtr</strong></span> - the transformation
</p>
</li>
<li class="listitem">
<p>
<span class="bold"><strong>HierarchicalStateMachine.ecore</strong></span> - the source metamodel
</p>
</li>
<li class="listitem">
<p>
<span class="bold"><strong>FlatStateMachine.ecore</strong></span> - the target metamodel
</p>
</li>
<li class="listitem">
<p>
<span class="bold"><strong>hier.xmi</strong></span> - an example model to exercise the execution
</p>
</li>
<li class="listitem">
<p>
<span class="bold"><strong>expected.xmi</strong></span> - the expected execution result
</p>
</li>
<li class="listitem">
<p>
<span class="bold"><strong>HierarchicalStateMachine2FlatStateMachine.qvtr.launch</strong></span> - a launch configuration for execution
</p>
</li>
</ul>
</div>
<p>You may execute the transformation on the
<span class="bold"><strong>hier.xmi</strong></span> input by invoking
<span class="bold"><strong>Run-&gt;Run Configurations...</strong></span> then
<span class="bold"><strong>QVTr (Relations) transformation</strong></span> then
<span class="bold"><strong>HierarchicalStateMachine2FlatStateMachine.qvtr</strong></span>.
</p>
<p>
</p>
<div class="mediaobject">
<img src="images/QVTrLaunch.png"></div>
<p>
</p>
<p>The launch is currently cluttered by an excess of development information and not yet implemented facilities. The important fields are:</p>
<div class="section" title="Project / Transformation">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="ProjectTransformation"></a>Project / Transformation</h4>
</div>
</div>
</div>
<p>The project name provides a default name against which other filenames are resolved to reduce screen clutter.</p>
<p>The transformation name is the transformation to be executed.</p>
<p>The mode can only be enforce creation/overwrite of the output model at present.</p>
<p>The direction selects the output direction when executing a multi-directional transformation.</p>
</div>
<div class="section" title="Inputs">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="Inputs"></a>Inputs</h4>
</div>
</div>
</div>
<p>The file bound to each input domain must be specified.</p>
</div>
<div class="section" title="New outputs">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="Newoutputs"></a>New outputs</h4>
</div>
</div>
</div>
<p>The file bound to each output domain must be specified.</p>
</div>
<div class="section" title="Intermediates">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="Intermediates"></a>Intermediates</h4>
</div>
</div>
</div>
<p>The location of each intermediate file in the transformation chain is identified. Their default location is a
<span class="bold"><strong>temp</strong></span> subfolder of the transformation&rsquo;s parent folder. You can change them.
</p>
<p>If you click
<span class="bold"><strong>Compile</strong></span> you can see the compilation progress as the grey
<span class="bold"><strong>Stale</strong></span> texts change to green
<span class="bold"><strong>Ready</strong></span> text.
</p>
</div>
<div class="section" title="Build">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="Build"></a>Build</h4>
</div>
</div>
</div>
<p>The
<span class="bold"><strong>Interpreted</strong></span> check box selects between interpreted execution (fast start, slow run) or code generated execution (slow start, fast run).
</p>
<p>The interpreted compilation synthesizes a QVTc middle metamodel and a genmodel.</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>
<span class="bold"><strong>HierarchicalStateMachine2FlatStateMachine.ecore</strong></span>
</p>
</li>
<li class="listitem">
<p>
<span class="bold"><strong>HierarchicalStateMachine2FlatStateMachine.genmodel</strong></span>
</p>
</li>
</ul>
</div>
<p>The code generated compilation additionally synthesizes a Java class to implement the transformation and the Java classes for the QVTc middle model.</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>
<span class="bold"><strong>HierarchicalStateMachine2FlatStateMachine.java</strong></span>
</p>
</li>
</ul>
</div>
<p>The generated files are generated to a distinct
<span class="bold"><strong>src-gen</strong></span> tree which you may need to refresh to see all files. Java problem markers come and go during the synthesis and build. The errors should all be gone before execution proceeds. Elimination of warnings is a work in progress.
</p>
<div class="section" title="Run">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="Run"></a>Run</h5>
</div>
</div>
</div>
<p>Clicking on
<span class="bold"><strong>Run</strong></span> will
<span class="bold"><strong>Compile</strong></span> automatically if you have not already done so.
</p>
<p>The result should be a
<span class="bold"><strong>flat.xmi</strong></span> file that is similar to the
<span class="bold"><strong>expected.xmi</strong></span> file.
</p>
</div>
</div>
</div>
<div class="section" title="QVTc Example Project">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="QVTcExampleProject"></a>QVTc Example Project</h3>
</div>
</div>
</div>
<p>The OMG QVTc variant of the traditional UML to RDBMS transformation may be installed by:</p>
<p>Invoke
<span class="bold"><strong>File-&gt;New-&gt;Example...</strong></span> then select
<span class="bold"><strong>Examples</strong></span> then
<span class="bold"><strong>QVT (Query/View/Transformation Language) Projects</strong></span> then select either
<span class="bold"><strong>QVTc UML2RDBMS Project</strong></span> then
<span class="bold"><strong>Finish</strong></span> to create a small example project called
<span class="bold"><strong>org.eclipse.qvtd.examples.qvtcore.uml2rdbms</strong></span>.
</p>
<p>The QVTc editor opens to show the transformation.</p>
<p>The QVTc tooling is very similar to the QVTr tooling. The main difference is that for QVTc the middle model and its genmodel are designed by the user, whereas the QVTr middle model and genmodel are synthesized automatically. If code generated Java execution is required, using the genmodel to generate Java code for the middle model is again a manual user responsibility. </p>
</div>
</div>
<div class="section" title="Extensions">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="Extensions"></a>Extensions</h2>
</div>
</div>
</div>
<div class="section" title="Import">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="Import"></a>Import</h3>
</div>
</div>
</div>
<p>The Eclipse support for OCL, QVTc and QVTr adds an import statement to define the location of the metamodels.</p>
<div class="literallayout">
<p>
<code class="code">import&nbsp;SimpleUML&nbsp;:&nbsp;'SimpleUml.ecore'::umlMM;<br>
</code>
</p>
</div>
<p>This specifies that the
<span class="bold"><strong>SimpleUml.ecore</strong></span> metamodel is loaded. The metamodel root prefixes a navigation to select an imported element. In the example above the
<span class="bold"><strong>umlMM</strong></span> package is selected and made available with a
<span class="bold"><strong>SimpleUML</strong></span> alias. If alias-name and colon separator are omitted, the imported element is accessible by its own name.
</p>
<p>The quoted name may be importing-file-relative file name as above, or a an absolute path such as
<span class="bold"><strong>platform:/resource/org.eclipse.emf.examples.library/model/extlibrary.ecore</strong></span> or a registered namespace URI such as
<span class="bold"><strong>http://www.eclipse.org/emf/2002/Ecore</strong></span>.
</p>
</div>
<div class="section" title="Packages">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="Packages"></a>Packages</h3>
</div>
</div>
</div>
<p>The Eclipse support for QVTc and QVTr supports declaration of transformations within a package hierarchy. A Transformation therefore extends just a Class, not a Class and a Package as specified by OMG. The Transformation is declared nested within one of more Packages by qualifying the transformation name with one of more package names. For compatibility, if no Package is declared, the Transformation is contained by a Package with a blank name.</p>
<p>The package hierarchy declared for the Transformation is re-used to define the Java package hierarchy when Java code is generated from the Transformation.</p>
<div class="literallayout">
<p>
<code class="code">transformation&nbsp;org::eclipse::qvtd::xtext::qvtrelation::tests::hstm2fstm::HierarchicalStateMachine2FlatStateMachine(hier:hierMM,&nbsp;flat:flatMM)<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;...<br>
}<br>
</code>
</p>
</div>
<p>Alternatively a package declaration may be used. This may also optionally define the package URI and/or namespace prefix.</p>
<div class="literallayout">
<p>
<code class="code">package&nbsp;org::eclipse::qvtd::xtext::qvtrelation::tests::hstm2fstm&nbsp;:&nbsp;nsPrefix&nbsp;=&nbsp;'nsURI'<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;transformation&nbsp;HierarchicalStateMachine2FlatStateMachine(hier:hierMM,&nbsp;flat:flatMM)<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
}<br>
</code>
</p>
</div>
</div>
<div class="section" title="Contextual Operations and Properties">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="Contextual Operations and Properties"></a>Contextual Operations and Properties</h3>
</div>
</div>
</div>
<p>A
<span class="bold"><strong>package</strong></span> declaration may contain nested packages, classes or transformations. Within class declarations operations and properties may be declared analoguously to QVTo&rsquo;s contextual operatuions and properties, or to additional declarations from an imported Complete OCL document. The syntax is the same as OCLinECore which emulates typical OMG specification source text.
</p>
<div class="literallayout">
<p>
<code class="code">package&nbsp;MyPackage<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;class&nbsp;MyClass<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;operation&nbsp;op(p&nbsp;:&nbsp;String[1])&nbsp;:&nbsp;String[1]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;body:&nbsp;p.toUpper();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;property&nbsp;name&nbsp;:&nbsp;String[1];<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;transformation&nbsp;MyTx(...)<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
}<br>
</code>
</p>
</div>
</div>
<div class="section" title="QVTc Middle Model">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="QVTc Middle Model"></a>QVTc Middle Model</h3>
</div>
</div>
</div>
<p>The QVTc part of the specification is unclear as to how the middle metamodel is defined.</p>
<p>Eclipse QVTc imports the middle metamodel in the same way as any other metamodel. This is then used as a used-package of an unnamed domain.</p>
<div class="literallayout">
<p>
<code class="code">import&nbsp;SimpleUML&nbsp;:&nbsp;'SimpleUml.ecore'::umlMM;<br>
import&nbsp;SimpleUMLtoRDBMS&nbsp;:&nbsp;'SimpleUMLtoRDBMS.ecore'::uml2rdbms;<br>
import&nbsp;SimpleRDBMS&nbsp;:&nbsp;'SimpleRdbms.ecore'::rdbmsMM;<br>
</code>
</p>
</div>
<div class="literallayout">
<p>
<code class="code">transformation&nbsp;umlRdbms&nbsp;{<br>
uml&nbsp;imports&nbsp;SimpleUML;<br>
rdbms&nbsp;imports&nbsp;SimpleRDBMS;<br>
imports&nbsp;SimpleUMLtoRDBMS;<br>
}<br>
</code>
</p>
</div>
</div>
<div class="section" title="QVTr Middle Model">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="QVTr Middle Model"></a>QVTr Middle Model</h3>
</div>
</div>
</div>
<p>The QVTr part of the specification appears to specify how the middle metamodel is synthesized. The specification however ignores details such as Models, Packages and Collections. There is also a lack of clarity as to whether the trace is the minimum required to support non-re-invocation of mappings or whether it should contain everything necessary for minimal incremental re-execution. The Eclipse QVTd implementation is work-in-progress.</p>
</div>
<div class="section" title="QVTr Collection Templates">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="Collection Templates"></a>QVTr Collection Templates</h3>
</div>
</div>
</div>
<p>The QVTr part of the specification omits almost all detail of the semantics of Collections and in particular Collection Templates. The implementation in Eclipse QVTd is therefore language design work-in-progress rather than implementation work-in-progress.</p>
</div>
<div class="section" title="OCL/EMOF Metamodels">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="OCL/EMOF Metamodels"></a>OCL/EMOF Metamodels</h3>
</div>
</div>
</div>
<p>The QVT specification provides layered metamodels for QVTrelation, QVTtemplate, QVTcore and QVTbase layered on top of EssentialOCL and EMOF. The EssentialOCL and EMOF metamodels are very strongly influenced by OCL and MOF specifications, but are ot formally compliant.</p>
<p>Eclipse QVTd provides layered metamodels for QVTrelation, QVTtemplate, QVTcore and QVTbase layered on top of Pivot which is derived from the UML 2.5 metamodel and work towards a future OCL specification. (QVTimperative shares some QVTcore functionality through a QVTcoreBase abstraction.)</p>
<p>A consequence of extending the Eclipse OCL Pivot is that Eclipse QVTd has preliminary support for templated types, extensible libraries and safe navigation.</p>
</div>
<div class="section" title="this">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="this"></a>this</h3>
</div>
</div>
</div>
<p>QVTo defines
<span class="bold"><strong>this</strong></span> as a reserved variable for the instance of the executing transformation.
</p>
<p>Eclipse QVTd provides
<span class="bold"><strong>this</strong></span> for QVTc and QVTr and thereby solves an OCL compatibility problem with respect to the source of an operation call of a query. In Eclipse QVTd, queries, using the Function class, are operations of the Transformation class and are invoked with an implicit
<span class="bold"><strong>this</strong></span>. An explicit
<span class="bold"><strong>this</strong></span> can be used, and is used when viewing the equivalent source text for the Abstract Syntax model.
</p>
</div>
</div>
</div>
<div class="chapter" title="Chapter&nbsp;2.&nbsp; pivot">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="pivot"></a>Chapter&nbsp;2.&nbsp;
<span class="bold"><strong>
<code class="code">pivot</code>
</strong></span>
</h2>
</div>
</div>
</div>
<div class="section" title="OCLExpression">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="OCLExpression"></a>
<span class="bold"><strong>
<code class="code">OCLExpression</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">AddStatement : qvtimperative::AddStatement[?]</code>
</p>
<p>
<code class="code">BufferStatement : qvtimperative::BufferStatement[?]</code>
</p>
<p>
<code class="code">CheckStatement : qvtimperative::CheckStatement[?]</code>
</p>
<p>
<code class="code">DeclareStatement : qvtimperative::DeclareStatement[?]</code>
</p>
<p>
<code class="code">MappingLoop : qvtimperative::MappingLoop[?]</code>
</p>
<p>
<code class="code">NewStatement : qvtimperative::NewStatement[?]</code>
</p>
<p>
<code class="code">SetStatement : qvtimperative::SetStatement[?]</code>
</p>
<p>
<code class="code">SimpleParameterBinding : qvtimperative::SimpleParameterBinding[?]</code>
</p>
</div>
<div class="section" title="Property">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="Property"></a>
<span class="bold"><strong>
<code class="code">Property</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">ObservableStatement : Bag(qvtimperative::ObservableStatement)</code>
</p>
<p>
<code class="code">SetStatement : Bag(qvtimperative::SetStatement)</code>
</p>
</div>
<div class="section" title="VariableDeclaration">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="VariableDeclaration"></a>
<span class="bold"><strong>
<code class="code">VariableDeclaration</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">SetStatement : Bag(qvtimperative::SetStatement)</code>
</p>
</div>
</div>
<div class="chapter" title="Chapter&nbsp;3.&nbsp; qvtimperative">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="qvtimperative"></a>Chapter&nbsp;3.&nbsp;
<span class="bold"><strong>
<code class="code">qvtimperative</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>The Package for an Imperative QVT transformation.</p>
<p>An Imperative QVT trabsformation is expected to be created by an autogenerator that observes the following run-time restrictions:</p>
<p>A mapping that my be re-invoked must have MappingCall.isInfinite set for every possible invocation.</p>
<p>A mapping that reads object slots before they are guaranteed to have been assigned must declare the slots property in a corresponding ImperativeArea.checkedProperties entry.</p>
<p>A mapping that assigns an object slot that any mapping may access before assignment is guaranteed must declare declare the slots property in a corresponding ImperativeArea.enforcedProperties entry.</p>
<p>All reads by Functions/Queries must be guaranteed to succeed; i.e. the invoking mapping must check readiness before calling the query.</p>
<p>All writes to multi-valued properties must be guaranteed to occur before any read of the property.</p>
<div class="section" title="AddStatement">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="AddStatement"></a>
<span class="bold"><strong>
<code class="code">AddStatement</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>An AddStatement appends the value of an expression to a connection.</p>
<p>syntax:
<code class="code">add connection := expression;</code>
</p>
<p>conformsTo
<a class="link" href="#MappingStatement" title="MappingStatement">
<code class="code">MappingStatement</code>
</a>,
<a class="link" href="#ObservableStatement" title="ObservableStatement">
<code class="code">ObservableStatement</code>
</a>
</p>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">isEnforcedUnique : Boolean[?]</code>
</p>
<p>True if the append is suppressed after a check for uniqueness of the value.</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">ownedExpression : OCLExpression[1]</code>
</p>
<p>The expression whose evaluation yields the value to append.</p>
<p>
<code class="code">targetVariable : ::ConnectionVariable[1]</code>
</p>
<p>The connection to be appended.</p>
</div>
<div class="section" title="AppendParameter">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="AppendParameter"></a>
<span class="bold"><strong>
<code class="code">AppendParameter</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>An AppendParameter of a Mapping defines an output connection to which values may be appended.</p>
<p>syntax:
<code class="code">append name : type;</code>
</p>
<p>conformsTo
<a class="link" href="#ConnectionVariable" title="ConnectionVariable">
<code class="code">ConnectionVariable</code>
</a>,
<a class="link" href="#MappingParameter" title="MappingParameter">
<code class="code">MappingParameter</code>
</a>
</p>
</div>
<div class="section" title="AppendParameterBinding">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="AppendParameterBinding"></a>
<span class="bold"><strong>
<code class="code">AppendParameterBinding</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>An AppendParameterBinding binds an AppendParameter of an invoked Mapping to a connection of the invoker.
Execution of the mapping may append to the connection.</p>
<p>syntax:
<code class="code">formalName appendsTo connection;</code>
</p>
<p>conformsTo
<a class="link" href="#MappingParameterBinding" title="MappingParameterBinding">
<code class="code">MappingParameterBinding</code>
</a>
</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">value : ::ConnectionVariable[1]</code>
</p>
<p>The value or collection of values to bind to boundVariable</p>
</div>
<div class="section" title="BufferStatement">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="BufferStatement"></a>
<span class="bold"><strong>
<code class="code">BufferStatement</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A BufferStatement declares a connection buffer and optionally assigns initial content.</p>
<p>syntax:
<code class="code">buffer name : type := expression;</code>
</p>
<p>
<code class="code">type</code> or
<code class="code">expression</code> but not both may be omitted. An omitted type is deduced from the initial expression values.
</p>
<p>conformsTo
<a class="link" href="#ConnectionVariable" title="ConnectionVariable">
<code class="code">ConnectionVariable</code>
</a>,
<a class="link" href="#VariableStatement" title="VariableStatement">
<code class="code">VariableStatement</code>
</a>,
<a class="link" href="#ObservableStatement" title="ObservableStatement">
<code class="code">ObservableStatement</code>
</a>
</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">ownedExpression : OCLExpression[?]</code>
</p>
<p>The optional expression computing initial content values.</p>
</div>
<div class="section" title="CheckStatement">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="CheckStatement"></a>
<span class="bold"><strong>
<code class="code">CheckStatement</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A CheckStatement evaluates a predicate. If the evaluation is false, the mapping execution
terminates fails and does nothing.</p>
<p>syntax:
<code class="code">check expression;</code>
</p>
<p>conformsTo
<a class="link" href="#ObservableStatement" title="ObservableStatement">
<code class="code">ObservableStatement</code>
</a>
</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">ownedExpression : OCLExpression[1]</code>
</p>
</div>
<div class="section" title="ConnectionVariable">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="ConnectionVariable"></a>
<span class="bold"><strong>
<code class="code">ConnectionVariable</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A ConnectionVariable identifes a variable used as a connection buffer.</p>
<p>conformsTo
<a class="link" href="#VariableDeclaration" title="VariableDeclaration">
<code class="code">VariableDeclaration</code>
</a>
</p>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">AddStatement : Bag(qvtimperative::AddStatement)</code>
</p>
<p>
<code class="code">AppendParameterBinding : Bag(qvtimperative::AppendParameterBinding)</code>
</p>
<p>
<code class="code">GuardParameterBinding : Bag(qvtimperative::GuardParameterBinding)</code>
</p>
</div>
<div class="section" title="DeclareStatement">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="DeclareStatement"></a>
<span class="bold"><strong>
<code class="code">DeclareStatement</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A DeclareStatement declares a variable and initial value.</p>
<p>syntax:
<code class="code">check var name : type := expression;</code>
</p>
<p>
<code class="code">type</code> or
<code class="code">expression</code> but not both may be omitted. An omitted type is deduced from the initial expression values.
</p>
<p>
<code class="code">check</code> may be omitted when the expression type is necessarily conformant.
</p>
<p>conformsTo
<a class="link" href="#VariableStatement" title="VariableStatement">
<code class="code">VariableStatement</code>
</a>,
<a class="link" href="#ObservableStatement" title="ObservableStatement">
<code class="code">ObservableStatement</code>
</a>
</p>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">isCheck : Boolean[?]</code>
</p>
<p>True if the initial expression&rsquo;s type must be checked for conformance with the variable&rsquo;s type.
A non-conforming vlaue is a predicate failure causing the mapping to fail without doing anything.
This is a derivation of not ownedInit.type.conformsTo(self.type).</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">ownedExpression : OCLExpression[1]</code>
</p>
<p>The expression computing the variable&rsquo;s value.</p>
</div>
<div class="section" title="GuardParameter">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="GuardParameter"></a>
<span class="bold"><strong>
<code class="code">GuardParameter</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A GuardParameter of a Mapping defines a input at which a value is consumed from a connection.</p>
<p>syntax:
<code class="code">guard:typedModel name : type;</code>
</p>
<p>conformsTo
<a class="link" href="#MappingParameter" title="MappingParameter">
<code class="code">MappingParameter</code>
</a>
</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">referredTypedModel : ::ImperativeTypedModel[1]</code>
</p>
<p>The TypedModel that contains the passed value.</p>
</div>
<div class="section" title="GuardParameterBinding">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="GuardParameterBinding"></a>
<span class="bold"><strong>
<code class="code">GuardParameterBinding</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A GuardParameterBinding binds a guard parameter of an invoked Mapping to a value of a connection.
Execution of the mapping may use the value. A distinct Mapping invocation occurs for each value
in the connection.</p>
<p>syntax:
<code class="code">formalName consumes expression;</code>
</p>
<p>conformsTo
<a class="link" href="#MappingParameterBinding" title="MappingParameterBinding">
<code class="code">MappingParameterBinding</code>
</a>
</p>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">isCheck : Boolean[?]</code>
</p>
<p>True if each consumed value must be checked for conformance with the variable&rsquo;s type.
A non-conforming vlaue is a predicate failure causing the mapping invocation to fail without doing anything.
This is a derivation of not ownedInit.type.conformsTo(self.type).</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">value : ::ConnectionVariable[1]</code>
</p>
<p>The connection providing the invocation values.</p>
</div>
<div class="section" title="ImperativeModel">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="ImperativeModel"></a>
<span class="bold"><strong>
<code class="code">ImperativeModel</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>The Model of an Imperative QVT transformation.</p>
<p>conformsTo
<a class="link" href="#">
<code class="code">BaseModel</code>
</a>
</p>
</div>
<div class="section" title="ImperativeTransformation">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="ImperativeTransformation"></a>
<span class="bold"><strong>
<code class="code">ImperativeTransformation</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>An ImperativeTransfornmation distinguishes a QVTi transformation from other transformations.</p>
<p>conformsTo
<a class="link" href="#">
<code class="code">Transformation</code>
</a>
</p>
</div>
<div class="section" title="ImperativeTypedModel">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="ImperativeTypedModel"></a>
<span class="bold"><strong>
<code class="code">ImperativeTypedModel</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>An ImperativeTypedModel defines an input,middle or output modek for the transformation.</p>
<p>conformsTo
<a class="link" href="#">
<code class="code">TypedModel</code>
</a>
</p>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">GuardParameter : Bag(qvtimperative::GuardParameter)</code>
</p>
<p>
<code class="code">NewStatement : Bag(qvtimperative::NewStatement)</code>
</p>
<p>
<code class="code">SimpleParameter : Bag(qvtimperative::SimpleParameter)</code>
</p>
<p>
<code class="code">isChecked : Boolean[?]</code>
</p>
<p>True for an input model.</p>
<p>
<code class="code">isEnforced : Boolean[?]</code>
</p>
<p>True for an output model.</p>
</div>
<div class="section" title="LoopParameterBinding">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="LoopParameterBinding"></a>
<span class="bold"><strong>
<code class="code">LoopParameterBinding</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A LoopParameterBinding binds a guard parameter of an invoked Mapping to the value of a loop variable
in the invoker. Execution of the mapping may use the value.</p>
<p>syntax:
<code class="code">formalName iterates expression;</code>
</p>
<p>Deprecated &ndash; WIP for a consuming stream</p>
<p>conformsTo
<a class="link" href="#MappingParameterBinding" title="MappingParameterBinding">
<code class="code">MappingParameterBinding</code>
</a>
</p>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">isCheck : Boolean[?]</code>
</p>
<p>Whether the variable initialization needs to be checked as a predicate. This is a derivation of not ownedInit.type.conformsTo(self.type).</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">value : ::LoopVariable[1]</code>
</p>
<p>The value or collection of values to bind to boundVariable</p>
</div>
<div class="section" title="LoopVariable">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="LoopVariable"></a>
<span class="bold"><strong>
<code class="code">LoopVariable</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A LoopVariable defines the iterator of a MappingLoop.</p>
<p>conformsTo
<a class="link" href="#VariableDeclaration" title="VariableDeclaration">
<code class="code">VariableDeclaration</code>
</a>
</p>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">LoopParameterBinding : Bag(qvtimperative::LoopParameterBinding)</code>
</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">owningMappingLoop : ::MappingLoop[1]</code>
</p>
</div>
<div class="section" title="Mapping">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="Mapping"></a>
<span class="bold"><strong>
<code class="code">Mapping</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>An Imperative Mapping extends the abstract declarative mapping to support
explicit nested invocation of mappings with bindings for the invoked mapping&rsquo;s
bound variables.</p>
<p>conformsTo
<a class="link" href="#">
<code class="code">Rule</code>
</a>
</p>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">MappingCall : Bag(qvtimperative::MappingCall)</code>
</p>
<p>
<code class="code">ownedParameters : Set(qvtimperative::MappingParameter)[*|1]</code>
</p>
<p>
<code class="code">ownedStatements : OrderedSet(qvtimperative::Statement)[*|1]</code>
</p>
</div>
<div class="section" title="MappingCall">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="MappingCall"></a>
<span class="bold"><strong>
<code class="code">MappingCall</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A MappingCall specifies the invocation of a referredMapping with a set of bindings.
An installed mapping is invoked asynchronously whenever suitable values are available on consumed connections.
An invoked mapping is invoked synchronously with values provided by the caller.</p>
<p>conformsTo
<a class="link" href="#MappingStatement" title="MappingStatement">
<code class="code">MappingStatement</code>
</a>,
<a class="link" href="#">
<code class="code">ReferringElement</code>
</a>
</p>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">binding : OrderedSet(qvtimperative::MappingParameterBinding)[*|1]</code>
</p>
<p>The Set of bindings of variables or expressions to forma parameters.</p>
<p>
<code class="code">isInfinite : Boolean[?]</code>
</p>
<p>An infinite MappingCall requires re-invocation of the called mapping to be suppressed to avoid an infinite loop.</p>
<p>Deprecated ?? not needed once install works.</p>
<p>
<code class="code">isInstall : Boolean[?]</code>
</p>
<p>An install MappingCall declares a MappingCall that consumes one or more connections and appends to zero or more connections.
Invocations of the mapping are driven by the availability of values in the connection.</p>
<p>
<code class="code">isInvoke : Boolean[?]</code>
</p>
<p>An invoke MappingCall invokes a Mapping that uses one or more values and appends to zero or more connections.
Invocations of the mapping is requested by the caller.</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">referredMapping : ::Mapping[1]</code>
</p>
<p>The Mapping invoked by the MappingCall.</p>
</div>
<div class="section" title="MappingLoop">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="MappingLoop"></a>
<span class="bold"><strong>
<code class="code">MappingLoop</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A MappingLoop supports an iteration of mapping invocations.</p>
<p>syntax:
<code class="code">for name : type in expression {...}</code>
</p>
<p>conformsTo
<a class="link" href="#MappingStatement" title="MappingStatement">
<code class="code">MappingStatement</code>
</a>,
<a class="link" href="#ObservableStatement" title="ObservableStatement">
<code class="code">ObservableStatement</code>
</a>
</p>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">ownedIterators : OrderedSet(qvtimperative::LoopVariable)[*|1]</code>
</p>
<p>The iterator loop variable.</p>
<p>
<code class="code">ownedMappingStatements : OrderedSet(qvtimperative::MappingStatement)[*|1]</code>
</p>
<p>The statements to be iterated, typically a single MappingCall.</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">ownedExpression : OCLExpression[1]</code>
</p>
<p>The expression whose values provide the iterator values.</p>
</div>
<div class="section" title="MappingParameter">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="MappingParameter"></a>
<span class="bold"><strong>
<code class="code">MappingParameter</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A MappingParameter defines a formal parameter of a mapping. The parameter is bound by the
mapping invocation to satisfy the requirements of the derived parameter class.</p>
<p>conformsTo
<a class="link" href="#VariableDeclaration" title="VariableDeclaration">
<code class="code">VariableDeclaration</code>
</a>
</p>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">MappingParameterBinding : Bag(qvtimperative::MappingParameterBinding)</code>
</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">Mapping : ::Mapping[?]</code>
</p>
</div>
<div class="section" title="MappingParameterBinding">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="MappingParameterBinding"></a>
<span class="bold"><strong>
<code class="code">MappingParameterBinding</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A MappingCallBinding specifies the binding of a single variable or value to
the formal parameter of a mapping as part of its inviocatuon or installation.</p>
<p>conformsTo
<a class="link" href="#">
<code class="code">Element</code>
</a>
</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">boundVariable : ::MappingParameter[1]</code>
</p>
<p>The formal parameter bound by the call.</p>
<p>
<code class="code">mappingCall : ::MappingCall[?]</code>
</p>
<p>The containing MappingCall.</p>
</div>
<div class="section" title="MappingStatement">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="MappingStatement"></a>
<span class="bold"><strong>
<code class="code">MappingStatement</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A MappingCall specifies the invocation of a referredMapping with a set of bindings
of the bound variables of the referredMapping to values provided in the invocation.
Where Collections of values are provided for isLoop bindings, a distinct invocation
is performed for each distinct permutation of Collection elements.</p>
<p>conformsTo
<a class="link" href="#Statement" title="Statement">
<code class="code">Statement</code>
</a>
</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">MappingLoop : ::MappingLoop[?]</code>
</p>
</div>
<div class="section" title="NewStatement">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="NewStatement"></a>
<span class="bold"><strong>
<code class="code">NewStatement</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A NewStatement creates an instance of a class and binds a name to it.</p>
<p>syntax:
<code class="code">new:typedModel name : type := expression;</code>
</p>
<p>If expression is omitted, a new instance if the tyope is created. If expression is provided, it
computes the &lsquo;new&rsquo; object, typically a singlton supervisor fpr a QVTr key.</p>
<p>conformsTo
<a class="link" href="#VariableStatement" title="VariableStatement">
<code class="code">VariableStatement</code>
</a>,
<a class="link" href="#ObservableStatement" title="ObservableStatement">
<code class="code">ObservableStatement</code>
</a>
</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">ownedExpression : OCLExpression[?]</code>
</p>
<p>Optional expression that constructs the new object.</p>
<p>
<code class="code">referredTypedModel : ::ImperativeTypedModel[1]</code>
</p>
<p>The TypedModel to which the new object is added.</p>
</div>
<div class="section" title="ObservableStatement">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="ObservableStatement"></a>
<span class="bold"><strong>
<code class="code">ObservableStatement</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>An ObservableStatement may involve evaluation of an expression that accesses object properties whose
values may not be available. If not ready,the mapping execution is suspended until the required value
is made available by a notifying SetStatement.</p>
<p>syntax:
<code class="code">observe class::property ...</code>
</p>
<p>conformsTo
<a class="link" href="#Statement" title="Statement">
<code class="code">Statement</code>
</a>
</p>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">observedProperties : Set(Property)[*|1]</code>
</p>
<p>The properties whose accesses must be checked for readiness.</p>
</div>
<div class="section" title="SetStatement">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="SetStatement"></a>
<span class="bold"><strong>
<code class="code">SetStatement</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A SetStatement sets an object property to a computed value.</p>
<p>syntax:
<code class="code">notify set name : type := expression;</code>
</p>
<p>If
<code class="code">notify</code> is specified, execution defines the property as ready enabling
mappings whose ObservableStatements are waiting for the value to resume.
</p>
<p>conformsTo
<a class="link" href="#ObservableStatement" title="ObservableStatement">
<code class="code">ObservableStatement</code>
</a>
</p>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">isNotify : Boolean[?]</code>
</p>
<p>
<code class="code">isOpposite : Boolean[?]</code>
</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">ownedExpression : OCLExpression[1]</code>
</p>
<p>
<code class="code">targetProperty : Property[1]</code>
</p>
<p>
<code class="code">targetVariable : VariableDeclaration[1]</code>
</p>
</div>
<div class="section" title="SimpleParameter">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="SimpleParameter"></a>
<span class="bold"><strong>
<code class="code">SimpleParameter</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A SimpleParameter of a Mapping defines an input at which a value is passed to the mapping.</p>
<p>syntax:
<code class="code">in:typedModel name : type;</code>
</p>
<p>conformsTo
<a class="link" href="#MappingParameter" title="MappingParameter">
<code class="code">MappingParameter</code>
</a>
</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">referredTypedModel : ::ImperativeTypedModel[1]</code>
</p>
<p>The TypedModel that contains the passed value.</p>
</div>
<div class="section" title="SimpleParameterBinding">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="SimpleParameterBinding"></a>
<span class="bold"><strong>
<code class="code">SimpleParameterBinding</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A SimpleParameterBinding binds a simple parameter of an invoked Mapping to the value of an expression
computed by the invoker. Execution of the mapping may use the value.</p>
<p>syntax:
<code class="code">formalName uses expression;</code>
</p>
<p>conformsTo
<a class="link" href="#MappingParameterBinding" title="MappingParameterBinding">
<code class="code">MappingParameterBinding</code>
</a>
</p>
<p>
<span class="bold"><strong>Attributes</strong></span>
</p>
<p>
<code class="code">isCheck : Boolean[?]</code>
</p>
<p>Whether the variable initialization needs to be checked as a predicate. This is a derivation of not ownedInit.type.conformsTo(self.type).</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">value : OCLExpression[1]</code>
</p>
<p>The value or collection of values to bind to boundVariable</p>
</div>
<div class="section" title="Statement">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="Statement"></a>
<span class="bold"><strong>
<code class="code">Statement</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A Statement is the basis for all execution by a Mapping.</p>
<p>conformsTo
<a class="link" href="#">
<code class="code">NamedElement</code>
</a>
</p>
<p>
<span class="bold"><strong>Associations</strong></span>
</p>
<p>
<code class="code">Mapping : ::Mapping[?]</code>
</p>
</div>
<div class="section" title="VariableStatement">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="VariableStatement"></a>
<span class="bold"><strong>
<code class="code">VariableStatement</code>
</strong></span>
</h2>
</div>
</div>
</div>
<p>A VariableStatement is the basis for a Mapping execution that makes a name available to subsequent starements.</p>
<p>conformsTo
<a class="link" href="#VariableDeclaration" title="VariableDeclaration">
<code class="code">VariableDeclaration</code>
</a>,
<a class="link" href="#Statement" title="Statement">
<code class="code">Statement</code>
</a>
</p>
</div>
</div>
<div class="appendix" title="Appendix&nbsp;A.&nbsp;Glossary">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="glossary"></a>Appendix&nbsp;A.&nbsp;Glossary</h2>
</div>
</div>
</div>
<div class="glosslist">
<dl>
<dt>EMF</dt>
<dd>
<p>Eclipse Modeling Framework</p>
</dd>
<dt>OCL</dt>
<dd>
<p>Object Constraint Language</p>
</dd>
<dt>OMG</dt>
<dd>
<p>Object Management Group</p>
</dd>
<dt>QVT</dt>
<dd>
<p>Query/View/Transformation</p>
</dd>
<dt>RTF</dt>
<dd>
<p>Revision Task Force</p>
</dd>
</dl>
</div>
</div>
</div>
</body>
</html>