summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/uml/duse-mt/src/app/SADuSE.xmi36
-rw-r--r--examples/uml/duse-mt/src/app/SADuse.xmi72
-rw-r--r--scripts/normative-xmi/Duse.xmi49
-rw-r--r--scripts/templates/common.tmpl12
-rw-r--r--src/duse/duse.pri4
-rw-r--r--src/duse/qdusedesigndimension.cpp20
-rw-r--r--src/duse/qdusedesigndimension.h11
-rw-r--r--src/duse/qdusedesigndimensioninstance.cpp28
-rw-r--r--src/duse/qdusedesigndimensioninstance.h6
-rw-r--r--src/duse/qdusedesignspace.cpp2
-rw-r--r--src/duse/qdusemodelchange.cpp138
-rw-r--r--src/duse/qdusemodelchange.h85
-rw-r--r--src/duse/qdusequalitymetric.cpp15
-rw-r--r--src/duse/qdusequalitymetric.h8
-rw-r--r--src/duse/qdusevariationpoint.cpp76
-rw-r--r--src/duse/qdusevariationpoint.h21
-rw-r--r--src/duse/qobjects/qdusedesigndimensioninstanceobject.cpp31
-rw-r--r--src/duse/qobjects/qdusedesigndimensioninstanceobject_p.h12
-rw-r--r--src/duse/qobjects/qdusedesigndimensionobject.cpp26
-rw-r--r--src/duse/qobjects/qdusedesigndimensionobject_p.h14
-rw-r--r--src/duse/qobjects/qdusedesignspaceobject.cpp2
-rw-r--r--src/duse/qobjects/qdusemodelchangeobject.cpp153
-rw-r--r--src/duse/qobjects/qdusemodelchangeobject_p.h99
-rw-r--r--src/duse/qobjects/qdusequalitymetricobject.cpp17
-rw-r--r--src/duse/qobjects/qdusequalitymetricobject_p.h8
-rw-r--r--src/duse/qobjects/qdusevariationpointobject.cpp92
-rw-r--r--src/duse/qobjects/qdusevariationpointobject_p.h22
-rw-r--r--src/modeling/qxmireader.cpp20
-rw-r--r--src/modeling/qxmireader_p.h1
-rw-r--r--src/modelingwidgets/qmodelingobjectpropertymodel.cpp34
-rw-r--r--src/plugins/metamodels/duse/Duse.xmi49
31 files changed, 990 insertions, 173 deletions
diff --git a/examples/uml/duse-mt/src/app/SADuSE.xmi b/examples/uml/duse-mt/src/app/SADuSE.xmi
deleted file mode 100644
index 731e2195..00000000
--- a/examples/uml/duse-mt/src/app/SADuSE.xmi
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:duse="http://liveblue.wordpress.com/Duse">
- <duse:DesignSpace name="SADuSE" xmi:id="SADuSE">
- <qualityMetric xmi:type="duse:QualityMetric" name="Control Robustness" xmi:id="SADuSE-Control Robustness" expression="(1/input[0].ownedElements.length)*120"/>
- <qualityMetric xmi:type="duse:QualityMetric" name="Average Maximum Overshoot" xmi:id="SADuSE-Average Maximum Overshoot" expression="(1/input[0].ownedTypes.length)*120"/>
- <qualityMetric xmi:type="duse:QualityMetric" name="Average Settling Time" xmi:id="SADuSE-Average Settling Time" expression="var ot = input[0].ownedTypes.length; var sum = 0; for (var j = 0; j &lt; ot; ++j) sum = sum+input[0].ownedTypes[j].ownedAttributes.length; var t = sum/(ot+1); t/sum*120"/>
- <qualityMetric xmi:type="duse:QualityMetric" name="Control Overhead" xmi:id="SADuSE-Control Overhead" expression="input[0].ownedAttributes"/>
- <designDimension xmi:type="duse:DesignDimension" name="Control Law" instanceSelectionRule="var inputLength = input.length; var selected = new Array(); for (var i = 0; i &lt; inputLength; ++i) { if (input[i] instanceof QSADuseProfileProcessComponent) selected.push(input[i].base_Component); } selected;" xmi:id="SADuSE-Control Law">
- <variationPoint xmi:type="duse:VariationPoint" name="Proportional" xmi:id="SADuSE-Control Law-Proportional"/>
- <variationPoint xmi:type="duse:VariationPoint" name="Proportional-Integral" xmi:id="SADuSE-Control Law-Proportional-Integral"/>
- <variationPoint xmi:type="duse:VariationPoint" name="Dynamic State Feedback" xmi:id="SADuSE-Control Law-Dynamic State Feedback"/>
- <variationPoint xmi:type="duse:VariationPoint" name="Static State Feedback" xmi:id="SADuSE-Control Law-Static State Feedback"/>
- <variationPoint xmi:type="duse:VariationPoint" name="Proportional-Integral-Derivative" xmi:id="SADuSE-Control Law-Proportional-Integral-Derivative"/>
- <variationPoint xmi:type="duse:VariationPoint" name="Precompensated Static State Feedback" xmi:id="SADuSE-Control Law-Precompensated Static State Feedback"/>
- </designDimension>
- <designDimension xmi:type="duse:DesignDimension" name="Tuning Approach" instanceSelectionRule="var inputLength = input.length; var selected = new Array(); for (var i = 0; i &lt; inputLength; ++i) { if (input[i] instanceof QSADuseProfileProcessComponent) selected.push(input[i].base_Component); } selected;" xmi:id="SADuSE-Tuning Approach">
- <variationPoint xmi:type="duse:VariationPoint" name="Cohen-Coon" xmi:id="SADuSE-Tuning Approach-Cohen-Coon"/>
- <variationPoint xmi:type="duse:VariationPoint" name="CHR-20OS-DR" xmi:id="SADuSE-Tuning Approach-CHR-20OS-DR"/>
- <variationPoint xmi:type="duse:VariationPoint" name="Ziegler-Nichols" xmi:id="SADuSE-Tuning Approach-Ziegler-Nichols"/>
- <variationPoint xmi:type="duse:VariationPoint" name="CHR-20OS-RT" xmi:id="SADuSE-Tuning Approach-CHR-20OS-RT"/>
- <variationPoint xmi:type="duse:VariationPoint" name="CHR-0OS-DR" xmi:id="SADuSE-Tuning Approach-CHR-0OS-DR"/>
- <variationPoint xmi:type="duse:VariationPoint" name="CHR-0OS-RT" xmi:id="SADuSE-Tuning Approach-CHR-0OS-RT"/>
- <variationPoint xmi:type="duse:VariationPoint" name="Linear Quadratic Regulator" xmi:id="SADuSE-Tuning Approach-Linear Quadratic Regulator"/>
- </designDimension>
- <designDimension xmi:type="duse:DesignDimension" name="Control Adaptation" instanceSelectionRule="var inputLength = input.length; var selected = new Array(); for (var i = 0; i &lt; inputLength; ++i) { if (input[i] instanceof QSADuseProfileProcessComponent) selected.push(input[i].base_Component); } selected;" xmi:id="SADuSE-Control Adaptation">
- <variationPoint xmi:type="duse:VariationPoint" name="Gain Scheduling" xmi:id="SADuSE-Control Adaptation-Gain Scheduling"/>
- <variationPoint xmi:type="duse:VariationPoint" name="Model Identification Adaptive Control (MIAC)" xmi:id="SADuSE-Control Adaptation-Model Identification Adaptive Control (MIAC)"/>
- <variationPoint xmi:type="duse:VariationPoint" name="Fixed Gain (no adaptation)" xmi:id="SADuSE-Control Adaptation-Fixed Gain (no adaptation)"/>
- </designDimension>
- <designDimension xmi:type="duse:DesignDimension" name="MAPE Deployment" instanceSelectionRule="var inputLength = input.length; var selected = new Array(); for (var i = 0; i &lt; inputLength; ++i) { if (input[i] instanceof QSADuseProfileProcessComponent) selected.push(input[i].base_Component); } selected;" xmi:id="SADuSE-MAPE Deployment">
- <variationPoint xmi:type="duse:VariationPoint" name="Local Control + Shared Reference" xmi:id="SADuSE-MAPE Deployment-Local Control + Shared Reference"/>
- <variationPoint xmi:type="duse:VariationPoint" name="Local Control + Shared Error" xmi:id="SADuSE-MAPE Deployment-Local Control + Shared Error"/>
- <variationPoint xmi:type="duse:VariationPoint" name="Global Control" xmi:id="SADuSE-MAPE Deployment-Global Control"/>
- </designDimension>
- </duse:DesignSpace>
-</xmi:XMI>
diff --git a/examples/uml/duse-mt/src/app/SADuse.xmi b/examples/uml/duse-mt/src/app/SADuse.xmi
new file mode 100644
index 00000000..57e99bc8
--- /dev/null
+++ b/examples/uml/duse-mt/src/app/SADuse.xmi
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:duse="http://liveblue.wordpress.com/Duse" xmlns:uml="http://www.omg.org/spec/UML/20110701">
+ <duse:DesignSpace name="SADuse" xmi:id="SADuse">
+ <qualityMetric xmi:type="duse:QualityMetric" name="Control Robustness" xmi:id="SADuse-ControlRobustness">
+ <expression xmi:type="uml:OpaqueExpression" xmi:id="SADuse-ControlRobustness-Expression">
+ <language>JavaScript</language>
+ <body>(1/input[0].ownedElements.length)*120</body>
+ </expression>
+ </qualityMetric>
+ <qualityMetric xmi:type="duse:QualityMetric" name="Average Maximum Overshoot" xmi:id="SADuse-AverageMaximumOvershoot">
+ <expression xmi:type="uml:OpaqueExpression" xmi:id="SADuse-AverageMaximumOvershoot-Expression">
+ <language>JavaScript</language>
+ <body>(1/input[0].ownedTypes.length)*120</body>
+ </expression>
+ </qualityMetric>
+ <qualityMetric xmi:type="duse:QualityMetric" name="Average Settling Time" xmi:id="SADuse-AverageSettlingTime">
+ <expression xmi:type="uml:OpaqueExpression" xmi:id="SADuse-AverageSettlingTime-Expression">
+ <language>JavaScript</language>
+ <body>var ot = input[0].ownedTypes.length; var sum = 0; for (var j = 0; j &lt; ot; ++j) sum = sum+input[0].ownedTypes[j].ownedAttributes.length; var t = sum/(ot+1); t/sum*120</body>
+ </expression>
+ </qualityMetric>
+ <qualityMetric xmi:type="duse:QualityMetric" name="Control Overhead" xmi:id="SADuse-ControlOverhead" expression="input[0].ownedAttributes">
+ <expression xmi:type="uml:OpaqueExpression" xmi:id="SADuse-ControlOverhead-Expression">
+ <language>JavaScript</language>
+ <body>input[0].ownedAttributes</body>
+ </expression>
+ </qualityMetric>
+ <designDimension xmi:type="duse:DesignDimension" name="Control Law" xmi:id="SADuse-ControlLaw">
+ <instanceSelectionRule xmi:type="uml:OpaqueExpression" xmi:id="SADuse-ControlLaw-InstanceSelectionRule">
+ <language>JavaScript</language>
+ <body>var inputLength = input.length; var selected = new Array(); for (var i = 0; i &lt; inputLength; ++i) { if (input[i] instanceof QSADuseProfileProcessComponent) selected.push(input[i].base_Component); } selected;</body>
+ </instanceSelectionRule>
+ <variationPoint xmi:type="duse:VariationPoint" name="Proportional" xmi:id="SADuse-ControlLaw-Proportional"/>
+ <variationPoint xmi:type="duse:VariationPoint" name="Proportional-Integral" xmi:id="SADuse-ControlLaw-Proportional-Integral"/>
+ <variationPoint xmi:type="duse:VariationPoint" name="Dynamic State Feedback" xmi:id="SADuse-ControlLaw-Dynamic State Feedback"/>
+ <variationPoint xmi:type="duse:VariationPoint" name="Static State Feedback" xmi:id="SADuse-ControlLaw-Static State Feedback"/>
+ <variationPoint xmi:type="duse:VariationPoint" name="Proportional-Integral-Derivative" xmi:id="SADuse-ControlLaw-Proportional-Integral-Derivative"/>
+ <variationPoint xmi:type="duse:VariationPoint" name="Precompensated Static State Feedback" xmi:id="SADuse-ControlLaw-Precompensated Static State Feedback"/>
+ </designDimension>
+ <designDimension xmi:type="duse:DesignDimension" name="Tuning Approach" xmi:id="SADuse-TunningApproach">
+ <instanceSelectionRule xmi:type="uml:OpaqueExpression" xmi:id="SADuse-TunningApproach-InstanceSelectionRule">
+ <language>JavaScript</language>
+ <body>var inputLength = input.length; var selected = new Array(); for (var i = 0; i &lt; inputLength; ++i) { if (input[i] instanceof QSADuseProfileProcessComponent) selected.push(input[i].base_Component); } selected;</body>
+ </instanceSelectionRule>
+ <variationPoint xmi:type="duse:VariationPoint" name="Cohen-Coon" xmi:id="SADuse-TunningApproach-Cohen-Coon"/>
+ <variationPoint xmi:type="duse:VariationPoint" name="CHR-20OS-DR" xmi:id="SADuse-TunningApproach-CHR-20OS-DR"/>
+ <variationPoint xmi:type="duse:VariationPoint" name="Ziegler-Nichols" xmi:id="SADuse-TunningApproach-Ziegler-Nichols"/>
+ <variationPoint xmi:type="duse:VariationPoint" name="CHR-20OS-RT" xmi:id="SADuse-TunningApproach-CHR-20OS-RT"/>
+ <variationPoint xmi:type="duse:VariationPoint" name="CHR-0OS-DR" xmi:id="SADuse-TunningApproach-CHR-0OS-DR"/>
+ <variationPoint xmi:type="duse:VariationPoint" name="CHR-0OS-RT" xmi:id="SADuse-TunningApproach-CHR-0OS-RT"/>
+ <variationPoint xmi:type="duse:VariationPoint" name="Linear Quadratic Regulator" xmi:id="SADuse-TunningApproach-Linear Quadratic Regulator"/>
+ </designDimension>
+ <designDimension xmi:type="duse:DesignDimension" name="Control Adaptation" xmi:id="SADuse-ControlAdaptation">
+ <instanceSelectionRule xmi:type="uml:OpaqueExpression" xmi:id="SADuse-ControlAdaptation-InstanceSelectionRule">
+ <language>JavaScript</language>
+ <body>var inputLength = input.length; var selected = new Array(); for (var i = 0; i &lt; inputLength; ++i) { if (input[i] instanceof QSADuseProfileProcessComponent) selected.push(input[i].base_Component); } selected;</body>
+ </instanceSelectionRule>
+ <variationPoint xmi:type="duse:VariationPoint" name="Gain Scheduling" xmi:id="SADuse-ControlAdaptation-Gain Scheduling"/>
+ <variationPoint xmi:type="duse:VariationPoint" name="Model Identification Adaptive Control (MIAC)" xmi:id="SADuse-ControlAdaptation-Model Identification Adaptive Control (MIAC)"/>
+ <variationPoint xmi:type="duse:VariationPoint" name="Fixed Gain (no adaptation)" xmi:id="SADuse-ControlAdaptation-Fixed Gain (no adaptation)"/>
+ </designDimension>
+ <designDimension xmi:type="duse:DesignDimension" name="MAPE Deployment" xmi:id="SADuse-MAPEDeployment">
+ <instanceSelectionRule xmi:type="uml:OpaqueExpression" xmi:id="SADuse-MAPEDeployment-InstanceSelectionRule">
+ <language>JavaScript</language>
+ <body>var inputLength = input.length; var selected = new Array(); for (var i = 0; i &lt; inputLength; ++i) { if (input[i] instanceof QSADuseProfileProcessComponent) selected.push(input[i].base_Component); } selected;</body>
+ </instanceSelectionRule>
+ <variationPoint xmi:type="duse:VariationPoint" name="Local Control + Shared Reference" xmi:id="SADuse-MAPEDeployment-Local Control + Shared Reference"/>
+ <variationPoint xmi:type="duse:VariationPoint" name="Local Control + Shared Error" xmi:id="SADuse-MAPEDeployment-Local Control + Shared Error"/>
+ <variationPoint xmi:type="duse:VariationPoint" name="Global Control" xmi:id="SADuse-MAPEDeployment-Global Control"/>
+ </designDimension>
+ </duse:DesignSpace>
+</xmi:XMI>
diff --git a/scripts/normative-xmi/Duse.xmi b/scripts/normative-xmi/Duse.xmi
index fd59f45f..d3e3a99f 100644
--- a/scripts/normative-xmi/Duse.xmi
+++ b/scripts/normative-xmi/Duse.xmi
@@ -7,6 +7,12 @@
<elementImport xmi:type="uml:ElementImport" xmi:id="ElementImport.0">
<importedElement href="http://www.omg.org/spec/UML/20110701/UML.xmi#Property"/>
</elementImport>
+ <elementImport xmi:type="uml:ElementImport" xmi:id="ElementImport.0">
+ <importedElement href="http://www.omg.org/spec/UML/20110701/UML.xmi#OpaqueExpression"/>
+ </elementImport>
+ <elementImport xmi:type="uml:ElementImport" xmi:id="ElementImport.0">
+ <importedElement href="http://www.omg.org/spec/UML/20110701/UML.xmi#Element"/>
+ </elementImport>
<packagedElement xmi:type="uml:Association" name="A_designSpace_designDimension" xmi:id="A_designSpace_designDimension">
<memberEnd xmi:idref="DesignSpace-designDimension"/>
<memberEnd xmi:idref="A_designSpace_designDimension-designSpace"/>
@@ -53,7 +59,7 @@
</ownedComment>
<ownedAttribute xmi:type="uml:Property" name="name" visibility="public" xmi:id="DesignSpace-name">
<ownedComment xmi:type="uml:Comment" xmi:id="DesignSpace-name-_ownedComment.0" annotatedElement="DesignSpace-name">
- <body>The design space's name.</body>
+ <body>The design space name.</body>
</ownedComment>
<type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#String"/>
</ownedAttribute>
@@ -84,11 +90,11 @@
</ownedComment>
<type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#String"/>
</ownedAttribute>
- <ownedAttribute xmi:type="uml:Property" visibility="public" name="instanceSelectionRule" xmi:id="DesignDimension-instanceSelectionRule">
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="instanceSelectionRule" aggregation="composite" xmi:id="DesignDimension-instanceSelectionRule">
<ownedComment xmi:type="uml:Comment" xmi:id="DesignDimension-instanceSelectionRule-_ownedComment.0" annotatedElement="DesignDimension-instanceSelectionRule">
<body>The rule for detecting a specific locus of architectural decision related to this design dimension. Such rule relies on the accompanying UML profile for the specific application domain, in order to identify the decision loci.</body>
</ownedComment>
- <type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#String"/>
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#OpaqueExpression"/>
</ownedAttribute>
<ownedAttribute xmi:type="uml:Property" name="requiredPreviousEvaluation" visibility="public" type="DesignDimension" xmi:id="DesignDimension-requiredPreviousEvaluation">
<ownedComment xmi:type="uml:Comment" xmi:id="DesignDimension-requiredPreviousEvaluation-_ownedComment.0" annotatedElement="DesignDimension-requiredPreviousEvaluation">
@@ -98,7 +104,7 @@
<upperValue xmi:type="uml:LiteralUnlimitedNatural" value="*" xmi:id="DesignDimension-requiredPreviousEvaluation-LiteralUnlimitedNatural.1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="DesignDimension-requiredPreviousEvaluation-LiteralInteger.1"/>
</ownedAttribute>
- <ownedAttribute xmi:type="uml:Property" name="variationPoint" visibility="public" type="VariationPoint" aggregation="composite" xmi:id="DesignDimension-variationPoint">
+ <ownedAttribute xmi:type="uml:Property" name="variationPoint" visibility="public" type="VariationPoint" aggregation="composite" isOrdered="true" xmi:id="DesignDimension-variationPoint">
<ownedComment xmi:type="uml:Comment" xmi:id="DesignDimension-variationPoint-_ownedComment.0" annotatedElement="DesignDimension-variationPoint">
<body>The design dimension's variation points (alternative solutions for the design dimension's concern).</body>
</ownedComment>
@@ -137,23 +143,46 @@
</ownedComment>
<type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#String"/>
</ownedAttribute>
- <ownedAttribute xmi:type="uml:Property" visibility="public" name="preChangeValidationRule" xmi:id="VariationPoint-preChangeValidationRule">
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="preChangeValidationRule" aggregation="composite" xmi:id="VariationPoint-preChangeValidationRule">
<ownedComment xmi:type="uml:Comment" xmi:id="VariationPoint-preChangeValidationRule-_ownedComment.0" annotatedElement="VariationPoint-preChangeValidationRule">
<body>A set of rules which should be evaluated as true if design space locations containing such variation point are to be considered as valid ones.</body>
</ownedComment>
- <type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#String"/>
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#OpaqueExpression"/>
</ownedAttribute>
- <ownedAttribute xmi:type="uml:Property" visibility="public" name="modelChange" isOrdered="true" xmi:id="VariationPoint-modelChange">
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="modelChange" isOrdered="true" type="ModelChange" aggregation="composite" xmi:id="VariationPoint-modelChange">
<ownedComment xmi:type="uml:Comment" xmi:id="VariationPoint-modelChange-_ownedComment.0" annotatedElement="VariationPoint-modelChange">
<body>The architectural changes to be enacted as contributions arosen from this variation point. The complete set of architectural changes is the merge of architectural contributions from all involved variation points.</body>
</ownedComment>
- <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#Property"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" value="*" xmi:id="VariationPoint-modelChange-LiteralUnlimitedNatural.1"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="VariationPoint-modelChange-LiteralInteger.1"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="addedElement" isOrdered="true" xmi:id="VariationPoint-addedElement">
+ <ownedComment xmi:type="uml:Comment" xmi:id="VariationPoint-addedElement-_ownedComment.0" annotatedElement="VariationPoint-addedElement">
+ <body>The architectural elements to be added as part of architecture redesign contribution arising from this variation point. The complete set of added architectural elements is the merge of architectural contributions from all involved variation points.</body>
+ </ownedComment>
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#Element"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" value="*" xmi:id="VariationPoint-addedElements-LiteralUnlimitedNatural.1"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="VariationPoint-addedElements-LiteralInteger.1"/>
</ownedAttribute>
</packagedElement>
<packagedElement xmi:type="uml:Class" name="DesignDimensionInstance" xmi:id="DesignDimensionInstance">
<ownedComment xmi:type="uml:Comment" xmi:id="DesignDimensionInstance-_ownedComment.0" annotatedElement="DesignDimensionInstance">
<body>A specific design dimenstion instance created to tackle a particular locus of architectural decision in the input model.</body>
</ownedComment>
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="targetInstance" xmi:id="DesignDimensionInstance-targetInstance">
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#Element"/>
+ </ownedAttribute>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" name="ModelChange" xmi:id="ModelChange">
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="targetSelectionRule" aggregation="composite" xmi:id="ModelChange-targetSelectionRule">
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#OpaqueExpression"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="valueSelectionRule" aggregation="composite" xmi:id="ModelChange-valueSelectionRule">
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#OpaqueExpression"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="targetProperty" xmi:id="ModelChange-targetProperty">
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#Property"/>
+ </ownedAttribute>
</packagedElement>
<packagedElement xmi:type="uml:Class" name="QualityMetric" xmi:id="QualityMetric">
<ownedComment xmi:type="uml:Comment" xmi:id="QualityMetric-_ownedComment.0" annotatedElement="QualityMetric">
@@ -171,11 +200,11 @@
</ownedComment>
<type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#Real"/>
</ownedAttribute>
- <ownedAttribute xmi:type="uml:Property" visibility="public" name="expression" xmi:id="QualityMetric-expression">
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="expression" aggregation="composite" xmi:id="QualityMetric-expression">
<ownedComment xmi:type="uml:Comment" xmi:id="QualityMetric-expression-_ownedComment.0" annotatedElement="QualityMetric-expression">
<body>The quality metric's evaluation expression.</body>
</ownedComment>
- <type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#String"/>
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#OpaqueExpression"/>
</ownedAttribute>
</packagedElement>
</uml:Package>
diff --git a/scripts/templates/common.tmpl b/scripts/templates/common.tmpl
index e0e205ba..23463ce2 100644
--- a/scripts/templates/common.tmpl
+++ b/scripts/templates/common.tmpl
@@ -9,6 +9,7 @@
};
-%]
[%- MACRO QT_TYPE(namespace, attribute, external) BLOCK -%]
+ [%- SET localNamespace = namespace -%]
[%- SET multiplicity = attribute.findnodes("upperValue").findvalue("@value") -%]
[%- SET isUnique = attribute.findvalue("@isUnique") -%]
[%- SET isOrdered = attribute.findvalue("@isOrdered") -%]
@@ -17,15 +18,15 @@
[%- IF attributeType == "" -%][%- SET attributeType = attribute.findnodes("type").findvalue("@xmi:idref") -%][%- END -%]
[%- IF attributeType == "" -%][%- SET attributeType = attribute.findnodes("type").findvalue("@href") -%][%- END -%]
[%- IF attributeType.split('#').first.split('/').last != attributeType and !attributeType.match('PrimitiveTypes\.xmi') -%]
- [%- SET namespace = attributeType.split('#').first.split('/').last.split('\.').first.lower.ucfirst -%]
+ [%- SET localNamespace = attributeType.split('#').first.split('/').last.split('\.').first.lower.ucfirst -%]
[%- SET attributeType = attributeType.split('#').last -%]
[%- END -%]
[%- IF !attributeType.match('PrimitiveTypes\.xmi') -%]
[%- IF xmi.findnodes("//packagedElement[@xmi:type='uml:Enumeration' and @name='$attributeType']").findvalue("@name") != "" -%]
-Qt${namespace}::${attributeType}
+Qt${localNamespace}::${attributeType}
[%- ELSE -%]
[%- IF attributeType != "" -%]
-[% IF external == "false" %]QObject *[% ELSE %]Q${namespace}${attributeType} *[% END %]
+[% IF external == "false" %]QObject *[% ELSE %]Q${localNamespace}${attributeType} *[% END %]
[%- ELSE %] [% END -%]
[%- END -%]
[%- ELSE -%]
@@ -506,14 +507,15 @@ void Q${namespace}${originalClassName}Object::unset${qtAttribute.remove("^is").u
[%- IF forwardName == "" -%][%- SET forwardName = forward.findvalue('@xmi:idref') -%][%- END -%]
[%- IF forwardName == "" -%][%- SET forwardName = forward.findvalue('@href') -%][%- END -%]
[%- NEXT IF forwardName.match('PrimitiveTypes') -%]
+[%- SET localNamespace = namespace -%]
[%- IF forwardName.split('#').first.split('/').last != forwardName -%]
- [%- SET namespace = forwardName.split('#').first.split('/').last.split('\.').first.lower.ucfirst -%]
+ [%- SET localNamespace = forwardName.split('#').first.split('/').last.split('\.').first.lower.ucfirst -%]
[%- SET forwardName = forwardName.split('#').last -%]
[%- END -%]
[%- IF xmi.findnodes("//packagedElement[@xmi:type='uml:Enumeration' and @name='$forwardName']").findvalue("@name") != "" -%]
[%- useNamespace.push("true") -%]
[%- ELSE -%]
-[%- IF forwardName != className && superclasses.grep("^${namespace}${forwardName}\$").size == 0 -%][%- forwards.push("Qt${namespace}/Q${namespace}${forwardName}") -%][%- END -%]
+[%- IF forwardName != className && superclasses.grep("^${localNamespace}${forwardName}\$").size == 0 -%][%- forwards.push("Qt${localNamespace}/Q${localNamespace}${forwardName}") -%][%- END -%]
[%- END -%]
[%- END -%]
[%- END -%]
diff --git a/src/duse/duse.pri b/src/duse/duse.pri
index 610e010f..e05589ac 100644
--- a/src/duse/duse.pri
+++ b/src/duse/duse.pri
@@ -5,6 +5,7 @@ HEADERS += \
qdusedesigndimension.h \
qdusevariationpoint.h \
qdusedesigndimensioninstance.h \
+ qdusemodelchange.h \
qdusequalitymetric.h
PRIVATE_HEADERS += \
@@ -12,6 +13,7 @@ PRIVATE_HEADERS += \
qobjects/qdusedesigndimensionobject_p.h \
qobjects/qdusevariationpointobject_p.h \
qobjects/qdusedesigndimensioninstanceobject_p.h \
+ qobjects/qdusemodelchangeobject_p.h \
qobjects/qdusequalitymetricobject_p.h
SOURCES += \
@@ -24,5 +26,7 @@ SOURCES += \
qdusevariationpoint.cpp \
qobjects/qdusedesigndimensioninstanceobject.cpp \
qdusedesigndimensioninstance.cpp \
+ qobjects/qdusemodelchangeobject.cpp \
+ qdusemodelchange.cpp \
qobjects/qdusequalitymetricobject.cpp \
qdusequalitymetric.cpp
diff --git a/src/duse/qdusedesigndimension.cpp b/src/duse/qdusedesigndimension.cpp
index a30f1b36..49396aa1 100644
--- a/src/duse/qdusedesigndimension.cpp
+++ b/src/duse/qdusedesigndimension.cpp
@@ -44,6 +44,7 @@
#include <QtDuse/QDuseDesignDimensionInstance>
#include <QtDuse/QDuseVariationPoint>
+#include <QtUml/QUmlOpaqueExpression>
QT_BEGIN_NAMESPACE
@@ -54,7 +55,8 @@ QT_BEGIN_NAMESPACE
\brief A design dimension captures a specific degree of freedom when designing architectures in the given application domain. A design dimension entails a set of variation points which denote alternative solutions for such degree of freedom. Optionally, a variation point may define validation rules which should return a true value if that variation point is to be considered valid for the corresponding input model. A variation point may also specify a set of other variation points which should be previously evaluated, defining a sort of design dimension dependency.
*/
-QDuseDesignDimension::QDuseDesignDimension(bool createQModelingObject)
+QDuseDesignDimension::QDuseDesignDimension(bool createQModelingObject) :
+ _instanceSelectionRule(0)
{
if (createQModelingObject)
_qModelingObject = qobject_cast<QModelingObject *>(new QDuseDesignDimensionObject(this));
@@ -64,7 +66,8 @@ QModelingElement *QDuseDesignDimension::clone() const
{
QDuseDesignDimension *c = new QDuseDesignDimension;
c->setName(name());
- c->setInstanceSelectionRule(instanceSelectionRule());
+ if (instanceSelectionRule())
+ c->setInstanceSelectionRule(dynamic_cast<QUmlOpaqueExpression *>(instanceSelectionRule()->clone()));
foreach (QDuseDesignDimension *element, requiredPreviousEvaluations())
c->addRequiredPreviousEvaluation(dynamic_cast<QDuseDesignDimension *>(element->clone()));
foreach (QDuseVariationPoint *element, variationPoints())
@@ -99,19 +102,22 @@ void QDuseDesignDimension::setName(QString name)
/*!
The rule for detecting a specific locus of architectural decision related to this design dimension. Such rule relies on the accompanying UML profile for the specific application domain, in order to identify the decision loci.
*/
-QString QDuseDesignDimension::instanceSelectionRule() const
+QUmlOpaqueExpression *QDuseDesignDimension::instanceSelectionRule() const
{
// This is a read-write property
return _instanceSelectionRule;
}
-void QDuseDesignDimension::setInstanceSelectionRule(QString instanceSelectionRule)
+void QDuseDesignDimension::setInstanceSelectionRule(QUmlOpaqueExpression *instanceSelectionRule)
{
// This is a read-write property
if (_instanceSelectionRule != instanceSelectionRule) {
_instanceSelectionRule = instanceSelectionRule;
+ if (instanceSelectionRule && instanceSelectionRule->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(instanceSelectionRule->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setInstanceSelectionRule()));
+ instanceSelectionRule->asQModelingObject()->setParent(this->asQModelingObject());
}
}
@@ -148,7 +154,7 @@ void QDuseDesignDimension::removeRequiredPreviousEvaluation(QDuseDesignDimension
/*!
The design dimension's variation points (alternative solutions for the design dimension's concern).
*/
-const QSet<QDuseVariationPoint *> QDuseDesignDimension::variationPoints() const
+const QList<QDuseVariationPoint *> QDuseDesignDimension::variationPoints() const
{
// This is a read-write property
@@ -160,7 +166,7 @@ void QDuseDesignDimension::addVariationPoint(QDuseVariationPoint *variationPoint
// This is a read-write property
if (!_variationPoints.contains(variationPoint)) {
- _variationPoints.insert(variationPoint);
+ _variationPoints.append(variationPoint);
if (variationPoint && variationPoint->asQModelingObject() && this->asQModelingObject())
QObject::connect(variationPoint->asQModelingObject(), SIGNAL(destroyed(QObject*)), this->asQModelingObject(), SLOT(removeVariationPoint(QObject *)));
variationPoint->asQModelingObject()->setParent(this->asQModelingObject());
@@ -172,7 +178,7 @@ void QDuseDesignDimension::removeVariationPoint(QDuseVariationPoint *variationPo
// This is a read-write property
if (_variationPoints.contains(variationPoint)) {
- _variationPoints.remove(variationPoint);
+ _variationPoints.removeAll(variationPoint);
if (variationPoint->asQModelingObject())
variationPoint->asQModelingObject()->setParent(0);
}
diff --git a/src/duse/qdusedesigndimension.h b/src/duse/qdusedesigndimension.h
index 29b75f3f..0561e268 100644
--- a/src/duse/qdusedesigndimension.h
+++ b/src/duse/qdusedesigndimension.h
@@ -53,6 +53,7 @@ QT_MODULE(QtDuse)
class QDuseDesignDimensionInstance;
class QDuseVariationPoint;
+class QUmlOpaqueExpression;
class Q_DUSE_EXPORT QDuseDesignDimension : public QModelingElement
{
@@ -64,12 +65,12 @@ public:
// Owned attributes
QString name() const;
void setName(QString name);
- QString instanceSelectionRule() const;
- void setInstanceSelectionRule(QString instanceSelectionRule);
+ QUmlOpaqueExpression *instanceSelectionRule() const;
+ void setInstanceSelectionRule(QUmlOpaqueExpression *instanceSelectionRule);
const QSet<QDuseDesignDimension *> requiredPreviousEvaluations() const;
void addRequiredPreviousEvaluation(QDuseDesignDimension *requiredPreviousEvaluation);
void removeRequiredPreviousEvaluation(QDuseDesignDimension *requiredPreviousEvaluation);
- const QSet<QDuseVariationPoint *> variationPoints() const;
+ const QList<QDuseVariationPoint *> variationPoints() const;
void addVariationPoint(QDuseVariationPoint *variationPoint);
void removeVariationPoint(QDuseVariationPoint *variationPoint);
const QSet<QDuseDesignDimensionInstance *> designDimensionInstances() const;
@@ -80,9 +81,9 @@ public:
protected:
QString _name;
- QString _instanceSelectionRule;
+ QUmlOpaqueExpression *_instanceSelectionRule;
QSet<QDuseDesignDimension *> _requiredPreviousEvaluations;
- QSet<QDuseVariationPoint *> _variationPoints;
+ QList<QDuseVariationPoint *> _variationPoints;
QSet<QDuseDesignDimensionInstance *> _designDimensionInstances;
bool _enabled;
};
diff --git a/src/duse/qdusedesigndimensioninstance.cpp b/src/duse/qdusedesigndimensioninstance.cpp
index 424c1d3c..4bd53fef 100644
--- a/src/duse/qdusedesigndimensioninstance.cpp
+++ b/src/duse/qdusedesigndimensioninstance.cpp
@@ -42,6 +42,8 @@
#include "private/qdusedesigndimensioninstanceobject_p.h"
+#include <QtUml/QUmlElement>
+
QT_BEGIN_NAMESPACE
/*!
@@ -51,7 +53,8 @@ QT_BEGIN_NAMESPACE
\brief A specific design dimenstion instance created to tackle a particular locus of architectural decision in the input model.
*/
-QDuseDesignDimensionInstance::QDuseDesignDimensionInstance(bool createQModelingObject)
+QDuseDesignDimensionInstance::QDuseDesignDimensionInstance(bool createQModelingObject) :
+ _targetInstance(0)
{
if (createQModelingObject)
_qModelingObject = qobject_cast<QModelingObject *>(new QDuseDesignDimensionInstanceObject(this));
@@ -60,8 +63,31 @@ QDuseDesignDimensionInstance::QDuseDesignDimensionInstance(bool createQModelingO
QModelingElement *QDuseDesignDimensionInstance::clone() const
{
QDuseDesignDimensionInstance *c = new QDuseDesignDimensionInstance;
+ if (targetInstance())
+ c->setTargetInstance(dynamic_cast<QUmlElement *>(targetInstance()->clone()));
return c;
}
+// OWNED ATTRIBUTES
+
+
+QUmlElement *QDuseDesignDimensionInstance::targetInstance() const
+{
+ // This is a read-write property
+
+ return _targetInstance;
+}
+
+void QDuseDesignDimensionInstance::setTargetInstance(QUmlElement *targetInstance)
+{
+ // This is a read-write property
+
+ if (_targetInstance != targetInstance) {
+ _targetInstance = targetInstance;
+ if (targetInstance && targetInstance->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(targetInstance->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setTargetInstance()));
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/duse/qdusedesigndimensioninstance.h b/src/duse/qdusedesigndimensioninstance.h
index aca16342..b4e3c084 100644
--- a/src/duse/qdusedesigndimensioninstance.h
+++ b/src/duse/qdusedesigndimensioninstance.h
@@ -51,6 +51,8 @@ QT_BEGIN_NAMESPACE
QT_MODULE(QtDuse)
+class QUmlElement;
+
class Q_DUSE_EXPORT QDuseDesignDimensionInstance : public QModelingElement
{
public:
@@ -58,8 +60,12 @@ public:
virtual QModelingElement *clone() const;
+ // Owned attributes
+ QUmlElement *targetInstance() const;
+ void setTargetInstance(QUmlElement *targetInstance);
protected:
+ QUmlElement *_targetInstance;
};
QT_END_NAMESPACE
diff --git a/src/duse/qdusedesignspace.cpp b/src/duse/qdusedesignspace.cpp
index 06f91a08..923a5e09 100644
--- a/src/duse/qdusedesignspace.cpp
+++ b/src/duse/qdusedesignspace.cpp
@@ -74,7 +74,7 @@ QModelingElement *QDuseDesignSpace::clone() const
// OWNED ATTRIBUTES
/*!
- The design space's name.
+ The design space name.
*/
QString QDuseDesignSpace::name() const
{
diff --git a/src/duse/qdusemodelchange.cpp b/src/duse/qdusemodelchange.cpp
new file mode 100644
index 00000000..a4649b35
--- /dev/null
+++ b/src/duse/qdusemodelchange.cpp
@@ -0,0 +1,138 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtDuse module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "qdusemodelchange.h"
+
+#include "private/qdusemodelchangeobject_p.h"
+
+#include <QtUml/QUmlOpaqueExpression>
+#include <QtUml/QUmlProperty>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QDuseModelChange
+
+ \inmodule QtDuse
+ */
+QDuseModelChange::QDuseModelChange(bool createQModelingObject) :
+ _targetSelectionRule(0),
+ _valueSelectionRule(0),
+ _targetProperty(0)
+{
+ if (createQModelingObject)
+ _qModelingObject = qobject_cast<QModelingObject *>(new QDuseModelChangeObject(this));
+}
+
+QModelingElement *QDuseModelChange::clone() const
+{
+ QDuseModelChange *c = new QDuseModelChange;
+ if (targetSelectionRule())
+ c->setTargetSelectionRule(dynamic_cast<QUmlOpaqueExpression *>(targetSelectionRule()->clone()));
+ if (valueSelectionRule())
+ c->setValueSelectionRule(dynamic_cast<QUmlOpaqueExpression *>(valueSelectionRule()->clone()));
+ if (targetProperty())
+ c->setTargetProperty(dynamic_cast<QUmlProperty *>(targetProperty()->clone()));
+ return c;
+}
+
+// OWNED ATTRIBUTES
+
+
+QUmlOpaqueExpression *QDuseModelChange::targetSelectionRule() const
+{
+ // This is a read-write property
+
+ return _targetSelectionRule;
+}
+
+void QDuseModelChange::setTargetSelectionRule(QUmlOpaqueExpression *targetSelectionRule)
+{
+ // This is a read-write property
+
+ if (_targetSelectionRule != targetSelectionRule) {
+ _targetSelectionRule = targetSelectionRule;
+ if (targetSelectionRule && targetSelectionRule->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(targetSelectionRule->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setTargetSelectionRule()));
+ targetSelectionRule->asQModelingObject()->setParent(this->asQModelingObject());
+ }
+}
+
+
+QUmlOpaqueExpression *QDuseModelChange::valueSelectionRule() const
+{
+ // This is a read-write property
+
+ return _valueSelectionRule;
+}
+
+void QDuseModelChange::setValueSelectionRule(QUmlOpaqueExpression *valueSelectionRule)
+{
+ // This is a read-write property
+
+ if (_valueSelectionRule != valueSelectionRule) {
+ _valueSelectionRule = valueSelectionRule;
+ if (valueSelectionRule && valueSelectionRule->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(valueSelectionRule->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setValueSelectionRule()));
+ valueSelectionRule->asQModelingObject()->setParent(this->asQModelingObject());
+ }
+}
+
+
+QUmlProperty *QDuseModelChange::targetProperty() const
+{
+ // This is a read-write property
+
+ return _targetProperty;
+}
+
+void QDuseModelChange::setTargetProperty(QUmlProperty *targetProperty)
+{
+ // This is a read-write property
+
+ if (_targetProperty != targetProperty) {
+ _targetProperty = targetProperty;
+ if (targetProperty && targetProperty->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(targetProperty->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setTargetProperty()));
+ }
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/duse/qdusemodelchange.h b/src/duse/qdusemodelchange.h
new file mode 100644
index 00000000..cb4d6517
--- /dev/null
+++ b/src/duse/qdusemodelchange.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtDuse module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QDUSEMODELCHANGE_H
+#define QDUSEMODELCHANGE_H
+
+#include <QtDuse/QtDuseGlobal>
+
+#include <QtModeling/QModelingElement>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(QtDuse)
+
+class QUmlOpaqueExpression;
+class QUmlProperty;
+
+class Q_DUSE_EXPORT QDuseModelChange : public QModelingElement
+{
+public:
+ explicit QDuseModelChange(bool createQModelingObject = true);
+
+ virtual QModelingElement *clone() const;
+
+ // Owned attributes
+ QUmlOpaqueExpression *targetSelectionRule() const;
+ void setTargetSelectionRule(QUmlOpaqueExpression *targetSelectionRule);
+ QUmlOpaqueExpression *valueSelectionRule() const;
+ void setValueSelectionRule(QUmlOpaqueExpression *valueSelectionRule);
+ QUmlProperty *targetProperty() const;
+ void setTargetProperty(QUmlProperty *targetProperty);
+
+protected:
+ QUmlOpaqueExpression *_targetSelectionRule;
+ QUmlOpaqueExpression *_valueSelectionRule;
+ QUmlProperty *_targetProperty;
+};
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QDuseModelChange) *)
+
+QT_END_HEADER
+
+#endif // QDUSEMODELCHANGE_H
+
diff --git a/src/duse/qdusequalitymetric.cpp b/src/duse/qdusequalitymetric.cpp
index 520bbddd..841074aa 100644
--- a/src/duse/qdusequalitymetric.cpp
+++ b/src/duse/qdusequalitymetric.cpp
@@ -42,6 +42,8 @@
#include "private/qdusequalitymetricobject_p.h"
+#include <QtUml/QUmlOpaqueExpression>
+
QT_BEGIN_NAMESPACE
/*!
@@ -51,7 +53,8 @@ QT_BEGIN_NAMESPACE
\brief A quality metric defined for the corresponding design space.
*/
-QDuseQualityMetric::QDuseQualityMetric(bool createQModelingObject)
+QDuseQualityMetric::QDuseQualityMetric(bool createQModelingObject) :
+ _expression(0)
{
if (createQModelingObject)
_qModelingObject = qobject_cast<QModelingObject *>(new QDuseQualityMetricObject(this));
@@ -62,7 +65,8 @@ QModelingElement *QDuseQualityMetric::clone() const
QDuseQualityMetric *c = new QDuseQualityMetric;
c->setName(name());
c->setValue(value());
- c->setExpression(expression());
+ if (expression())
+ c->setExpression(dynamic_cast<QUmlOpaqueExpression *>(expression()->clone()));
return c;
}
@@ -109,19 +113,22 @@ void QDuseQualityMetric::setValue(double value)
/*!
The quality metric's evaluation expression.
*/
-QString QDuseQualityMetric::expression() const
+QUmlOpaqueExpression *QDuseQualityMetric::expression() const
{
// This is a read-write property
return _expression;
}
-void QDuseQualityMetric::setExpression(QString expression)
+void QDuseQualityMetric::setExpression(QUmlOpaqueExpression *expression)
{
// This is a read-write property
if (_expression != expression) {
_expression = expression;
+ if (expression && expression->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(expression->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setExpression()));
+ expression->asQModelingObject()->setParent(this->asQModelingObject());
}
}
diff --git a/src/duse/qdusequalitymetric.h b/src/duse/qdusequalitymetric.h
index 1ca83c94..21867397 100644
--- a/src/duse/qdusequalitymetric.h
+++ b/src/duse/qdusequalitymetric.h
@@ -51,6 +51,8 @@ QT_BEGIN_NAMESPACE
QT_MODULE(QtDuse)
+class QUmlOpaqueExpression;
+
class Q_DUSE_EXPORT QDuseQualityMetric : public QModelingElement
{
public:
@@ -63,13 +65,13 @@ public:
void setName(QString name);
double value() const;
void setValue(double value);
- QString expression() const;
- void setExpression(QString expression);
+ QUmlOpaqueExpression *expression() const;
+ void setExpression(QUmlOpaqueExpression *expression);
protected:
QString _name;
double _value;
- QString _expression;
+ QUmlOpaqueExpression *_expression;
};
QT_END_NAMESPACE
diff --git a/src/duse/qdusevariationpoint.cpp b/src/duse/qdusevariationpoint.cpp
index ea077e74..6b4c8295 100644
--- a/src/duse/qdusevariationpoint.cpp
+++ b/src/duse/qdusevariationpoint.cpp
@@ -42,7 +42,9 @@
#include "private/qdusevariationpointobject_p.h"
-#include <QtUml/QUmlProperty>
+#include <QtDuse/QDuseModelChange>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlOpaqueExpression>
QT_BEGIN_NAMESPACE
@@ -54,7 +56,7 @@ QT_BEGIN_NAMESPACE
\brief A variation point represents a specific solution for a given design dimension. A variation point entails validation rules which check for valid combinations of variation points and a script which defines the architectural changes to be enacted from such solution.
*/
QDuseVariationPoint::QDuseVariationPoint(bool createQModelingObject) :
- _modelChange(0)
+ _preChangeValidationRule(0)
{
if (createQModelingObject)
_qModelingObject = qobject_cast<QModelingObject *>(new QDuseVariationPointObject(this));
@@ -65,9 +67,12 @@ QModelingElement *QDuseVariationPoint::clone() const
QDuseVariationPoint *c = new QDuseVariationPoint;
c->setName(name());
c->setRationale(rationale());
- c->setPreChangeValidationRule(preChangeValidationRule());
- if (modelChange())
- c->setModelChange(dynamic_cast<QUmlProperty *>(modelChange()->clone()));
+ if (preChangeValidationRule())
+ c->setPreChangeValidationRule(dynamic_cast<QUmlOpaqueExpression *>(preChangeValidationRule()->clone()));
+ foreach (QDuseModelChange *element, modelChanges())
+ c->addModelChange(dynamic_cast<QDuseModelChange *>(element->clone()));
+ foreach (QUmlElement *element, addedElements())
+ c->addAddedElement(dynamic_cast<QUmlElement *>(element->clone()));
return c;
}
@@ -114,40 +119,85 @@ void QDuseVariationPoint::setRationale(QString rationale)
/*!
A set of rules which should be evaluated as true if design space locations containing such variation point are to be considered as valid ones.
*/
-QString QDuseVariationPoint::preChangeValidationRule() const
+QUmlOpaqueExpression *QDuseVariationPoint::preChangeValidationRule() const
{
// This is a read-write property
return _preChangeValidationRule;
}
-void QDuseVariationPoint::setPreChangeValidationRule(QString preChangeValidationRule)
+void QDuseVariationPoint::setPreChangeValidationRule(QUmlOpaqueExpression *preChangeValidationRule)
{
// This is a read-write property
if (_preChangeValidationRule != preChangeValidationRule) {
_preChangeValidationRule = preChangeValidationRule;
+ if (preChangeValidationRule && preChangeValidationRule->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(preChangeValidationRule->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setPreChangeValidationRule()));
+ preChangeValidationRule->asQModelingObject()->setParent(this->asQModelingObject());
}
}
/*!
The architectural changes to be enacted as contributions arosen from this variation point. The complete set of architectural changes is the merge of architectural contributions from all involved variation points.
*/
-QUmlProperty *QDuseVariationPoint::modelChange() const
+const QList<QDuseModelChange *> QDuseVariationPoint::modelChanges() const
{
// This is a read-write property
- return _modelChange;
+ return _modelChanges;
}
-void QDuseVariationPoint::setModelChange(QUmlProperty *modelChange)
+void QDuseVariationPoint::addModelChange(QDuseModelChange *modelChange)
{
// This is a read-write property
- if (_modelChange != modelChange) {
- _modelChange = modelChange;
+ if (!_modelChanges.contains(modelChange)) {
+ _modelChanges.append(modelChange);
if (modelChange && modelChange->asQModelingObject() && this->asQModelingObject())
- QObject::connect(modelChange->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setModelChange()));
+ QObject::connect(modelChange->asQModelingObject(), SIGNAL(destroyed(QObject*)), this->asQModelingObject(), SLOT(removeModelChange(QObject *)));
+ modelChange->asQModelingObject()->setParent(this->asQModelingObject());
+ }
+}
+
+void QDuseVariationPoint::removeModelChange(QDuseModelChange *modelChange)
+{
+ // This is a read-write property
+
+ if (_modelChanges.contains(modelChange)) {
+ _modelChanges.removeAll(modelChange);
+ if (modelChange->asQModelingObject())
+ modelChange->asQModelingObject()->setParent(0);
+ }
+}
+
+/*!
+ The architectural elements to be added as part of architecture redesign contribution arising from this variation point. The complete set of added architectural elements is the merge of architectural contributions from all involved variation points.
+ */
+const QList<QUmlElement *> QDuseVariationPoint::addedElements() const
+{
+ // This is a read-write property
+
+ return _addedElements;
+}
+
+void QDuseVariationPoint::addAddedElement(QUmlElement *addedElement)
+{
+ // This is a read-write property
+
+ if (!_addedElements.contains(addedElement)) {
+ _addedElements.append(addedElement);
+ if (addedElement && addedElement->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(addedElement->asQModelingObject(), SIGNAL(destroyed(QObject*)), this->asQModelingObject(), SLOT(removeAddedElement(QObject *)));
+ }
+}
+
+void QDuseVariationPoint::removeAddedElement(QUmlElement *addedElement)
+{
+ // This is a read-write property
+
+ if (_addedElements.contains(addedElement)) {
+ _addedElements.removeAll(addedElement);
}
}
diff --git a/src/duse/qdusevariationpoint.h b/src/duse/qdusevariationpoint.h
index fb94f348..2b2e0ed7 100644
--- a/src/duse/qdusevariationpoint.h
+++ b/src/duse/qdusevariationpoint.h
@@ -51,7 +51,9 @@ QT_BEGIN_NAMESPACE
QT_MODULE(QtDuse)
-class QUmlProperty;
+class QDuseModelChange;
+class QUmlElement;
+class QUmlOpaqueExpression;
class Q_DUSE_EXPORT QDuseVariationPoint : public QModelingElement
{
@@ -65,16 +67,21 @@ public:
void setName(QString name);
QString rationale() const;
void setRationale(QString rationale);
- QString preChangeValidationRule() const;
- void setPreChangeValidationRule(QString preChangeValidationRule);
- QUmlProperty *modelChange() const;
- void setModelChange(QUmlProperty *modelChange);
+ QUmlOpaqueExpression *preChangeValidationRule() const;
+ void setPreChangeValidationRule(QUmlOpaqueExpression *preChangeValidationRule);
+ const QList<QDuseModelChange *> modelChanges() const;
+ void addModelChange(QDuseModelChange *modelChange);
+ void removeModelChange(QDuseModelChange *modelChange);
+ const QList<QUmlElement *> addedElements() const;
+ void addAddedElement(QUmlElement *addedElement);
+ void removeAddedElement(QUmlElement *addedElement);
protected:
QString _name;
QString _rationale;
- QString _preChangeValidationRule;
- QUmlProperty *_modelChange;
+ QUmlOpaqueExpression *_preChangeValidationRule;
+ QList<QDuseModelChange *> _modelChanges;
+ QList<QUmlElement *> _addedElements;
};
QT_END_NAMESPACE
diff --git a/src/duse/qobjects/qdusedesigndimensioninstanceobject.cpp b/src/duse/qobjects/qdusedesigndimensioninstanceobject.cpp
index 12bad7c3..1b51efed 100644
--- a/src/duse/qobjects/qdusedesigndimensioninstanceobject.cpp
+++ b/src/duse/qobjects/qdusedesigndimensioninstanceobject.cpp
@@ -42,6 +42,8 @@
#include "private/qmodelingobject_p.h"
#include <QtDuse/QDuseDesignDimensionInstance>
+#include <QtUml/QUmlElement>
+
QT_BEGIN_NAMESPACE
QDuseDesignDimensionInstanceObject::QDuseDesignDimensionInstanceObject(QDuseDesignDimensionInstance *modelingElement)
@@ -51,6 +53,24 @@ QDuseDesignDimensionInstanceObject::QDuseDesignDimensionInstanceObject(QDuseDesi
setPropertyData();
}
+// OWNED ATTRIBUTES [DesignDimensionInstance]
+
+QObject *QDuseDesignDimensionInstanceObject::targetInstance() const
+{
+ if (!qmodelingelementproperty_cast<QDuseDesignDimensionInstance *>(this)->targetInstance())
+ return 0;
+ else
+ return qmodelingelementproperty_cast<QDuseDesignDimensionInstance *>(this)->targetInstance()->asQModelingObject();
+}
+
+// SLOTS FOR OWNED ATTRIBUTES [DesignDimensionInstance]
+
+void QDuseDesignDimensionInstanceObject::setTargetInstance(QObject *targetInstance)
+{
+ qmodelingelementproperty_cast<QDuseDesignDimensionInstance *>(this)->setTargetInstance(qmodelingelementproperty_cast<QUmlElement *>(targetInstance));
+ emit targetInstanceChanged(this->targetInstance());
+}
+
void QDuseDesignDimensionInstanceObject::setGroupProperties()
{
@@ -61,10 +81,21 @@ void QDuseDesignDimensionInstanceObject::setGroupProperties()
d->groupProperties.insert(QStringLiteral("QObject"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("objectName"))));
d->propertyGroups << QStringLiteral("QDuseDesignDimensionInstance");
+ d->groupProperties.insert(QStringLiteral("QDuseDesignDimensionInstance"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("targetInstance"))));
}
void QDuseDesignDimensionInstanceObject::setPropertyData()
{
+ Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimensionInstance, targetInstance, AggregationRole, QStringLiteral("none"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimensionInstance, targetInstance, PropertyClassRole, QStringLiteral("QDuseDesignDimensionInstance"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimensionInstance, targetInstance, PropertyTypeRole, QStringLiteral("QUmlElement *"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimensionInstance, targetInstance, IsDerivedRole, false);
+ Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimensionInstance, targetInstance, IsDerivedUnionRole, false);
+ Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimensionInstance, targetInstance, DocumentationRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimensionInstance, targetInstance, RedefinedPropertiesRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimensionInstance, targetInstance, SubsettedPropertiesRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimensionInstance, targetInstance, OppositeEndRole, QStringLiteral(""));
+
}
QT_END_NAMESPACE
diff --git a/src/duse/qobjects/qdusedesigndimensioninstanceobject_p.h b/src/duse/qobjects/qdusedesigndimensioninstanceobject_p.h
index e2f14424..d4b44336 100644
--- a/src/duse/qobjects/qdusedesigndimensioninstanceobject_p.h
+++ b/src/duse/qobjects/qdusedesigndimensioninstanceobject_p.h
@@ -59,13 +59,25 @@ class Q_DUSE_EXPORT QDuseDesignDimensionInstanceObject : public QModelingObject
Q_DISABLE_COPY(QDuseDesignDimensionInstanceObject)
Q_DECLARE_PRIVATE(QModelingObject)
+ // Properties [DesignDimensionInstance]
+ Q_PROPERTY(QObject * targetInstance READ targetInstance WRITE setTargetInstance NOTIFY targetInstanceChanged)
+
public:
Q_INVOKABLE explicit QDuseDesignDimensionInstanceObject(QDuseDesignDimensionInstance *modelingElement);
+ // Owned attributes [DesignDimensionInstance]
+ Q_INVOKABLE QObject *targetInstance() const;
+
public Q_SLOTS:
+ // Slots for owned attributes [DesignDimensionInstance]
+ void setTargetInstance(QObject *targetInstance = 0);
+
Q_SIGNALS:
+ // Signals for owned attributes [DesignDimensionInstance]
+ void targetInstanceChanged(QObject *targetInstance);
+
protected:
virtual void setGroupProperties();
virtual void setPropertyData();
diff --git a/src/duse/qobjects/qdusedesigndimensionobject.cpp b/src/duse/qobjects/qdusedesigndimensionobject.cpp
index 6dbb7f26..5c6cd7c6 100644
--- a/src/duse/qobjects/qdusedesigndimensionobject.cpp
+++ b/src/duse/qobjects/qdusedesigndimensionobject.cpp
@@ -44,6 +44,7 @@
#include <QtDuse/QDuseDesignDimension>
#include <QtDuse/QDuseDesignDimensionInstance>
#include <QtDuse/QDuseVariationPoint>
+#include <QtUml/QUmlOpaqueExpression>
QT_BEGIN_NAMESPACE
@@ -61,9 +62,12 @@ QString QDuseDesignDimensionObject::name() const
return qmodelingelementproperty_cast<QDuseDesignDimension *>(this)->name();
}
-QString QDuseDesignDimensionObject::instanceSelectionRule() const
+QObject *QDuseDesignDimensionObject::instanceSelectionRule() const
{
- return qmodelingelementproperty_cast<QDuseDesignDimension *>(this)->instanceSelectionRule();
+ if (!qmodelingelementproperty_cast<QDuseDesignDimension *>(this)->instanceSelectionRule())
+ return 0;
+ else
+ return qmodelingelementproperty_cast<QDuseDesignDimension *>(this)->instanceSelectionRule()->asQModelingObject();
}
const QSet<QObject *> QDuseDesignDimensionObject::requiredPreviousEvaluations() const
@@ -74,12 +78,12 @@ const QSet<QObject *> QDuseDesignDimensionObject::requiredPreviousEvaluations()
return set;
}
-const QSet<QObject *> QDuseDesignDimensionObject::variationPoints() const
+const QList<QObject *> QDuseDesignDimensionObject::variationPoints() const
{
- QSet<QObject *> set;
+ QList<QObject *> list;
foreach (QDuseVariationPoint *element, qmodelingelementproperty_cast<QDuseDesignDimension *>(this)->variationPoints())
- set.insert(element->asQModelingObject());
- return set;
+ list.append(element->asQModelingObject());
+ return list;
}
const QSet<QObject *> QDuseDesignDimensionObject::designDimensionInstances() const
@@ -103,9 +107,9 @@ void QDuseDesignDimensionObject::setName(QString name)
emit nameChanged(this->name());
}
-void QDuseDesignDimensionObject::setInstanceSelectionRule(QString instanceSelectionRule)
+void QDuseDesignDimensionObject::setInstanceSelectionRule(QObject *instanceSelectionRule)
{
- qmodelingelementproperty_cast<QDuseDesignDimension *>(this)->setInstanceSelectionRule(instanceSelectionRule);
+ qmodelingelementproperty_cast<QDuseDesignDimension *>(this)->setInstanceSelectionRule(qmodelingelementproperty_cast<QUmlOpaqueExpression *>(instanceSelectionRule));
emit instanceSelectionRuleChanged(this->instanceSelectionRule());
}
@@ -181,9 +185,9 @@ void QDuseDesignDimensionObject::setPropertyData()
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, name, SubsettedPropertiesRole, QStringLiteral(""));
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, name, OppositeEndRole, QStringLiteral(""));
- Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, instanceSelectionRule, AggregationRole, QStringLiteral("none"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, instanceSelectionRule, AggregationRole, QStringLiteral("composite"));
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, instanceSelectionRule, PropertyClassRole, QStringLiteral("QDuseDesignDimension"));
- Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, instanceSelectionRule, PropertyTypeRole, QStringLiteral("QString"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, instanceSelectionRule, PropertyTypeRole, QStringLiteral("QUmlOpaqueExpression *"));
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, instanceSelectionRule, IsDerivedRole, false);
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, instanceSelectionRule, IsDerivedUnionRole, false);
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, instanceSelectionRule, DocumentationRole, QStringLiteral("The rule for detecting a specific locus of architectural decision related to this design dimension. Such rule relies on the accompanying UML profile for the specific application domain, in order to identify the decision loci."));
@@ -203,7 +207,7 @@ void QDuseDesignDimensionObject::setPropertyData()
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, variationPoints, AggregationRole, QStringLiteral("composite"));
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, variationPoints, PropertyClassRole, QStringLiteral("QDuseDesignDimension"));
- Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, variationPoints, PropertyTypeRole, QStringLiteral("QSet<QDuseVariationPoint *>"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, variationPoints, PropertyTypeRole, QStringLiteral("QList<QDuseVariationPoint *>"));
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, variationPoints, IsDerivedRole, false);
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, variationPoints, IsDerivedUnionRole, false);
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignDimension, variationPoints, DocumentationRole, QStringLiteral("The design dimension's variation points (alternative solutions for the design dimension's concern)."));
diff --git a/src/duse/qobjects/qdusedesigndimensionobject_p.h b/src/duse/qobjects/qdusedesigndimensionobject_p.h
index bf4a3c77..ca2bc5ec 100644
--- a/src/duse/qobjects/qdusedesigndimensionobject_p.h
+++ b/src/duse/qobjects/qdusedesigndimensionobject_p.h
@@ -61,9 +61,9 @@ class Q_DUSE_EXPORT QDuseDesignDimensionObject : public QModelingObject
// Properties [DesignDimension]
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
- Q_PROPERTY(QString instanceSelectionRule READ instanceSelectionRule WRITE setInstanceSelectionRule NOTIFY instanceSelectionRuleChanged)
+ Q_PROPERTY(QObject * instanceSelectionRule READ instanceSelectionRule WRITE setInstanceSelectionRule NOTIFY instanceSelectionRuleChanged)
Q_PROPERTY(QSet<QObject *> requiredPreviousEvaluations READ requiredPreviousEvaluations NOTIFY requiredPreviousEvaluationsChanged)
- Q_PROPERTY(QSet<QObject *> variationPoints READ variationPoints NOTIFY variationPointsChanged)
+ Q_PROPERTY(QList<QObject *> variationPoints READ variationPoints NOTIFY variationPointsChanged)
Q_PROPERTY(QSet<QObject *> designDimensionInstances READ designDimensionInstances NOTIFY designDimensionInstancesChanged)
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
@@ -72,9 +72,9 @@ public:
// Owned attributes [DesignDimension]
Q_INVOKABLE QString name() const;
- Q_INVOKABLE QString instanceSelectionRule() const;
+ Q_INVOKABLE QObject *instanceSelectionRule() const;
Q_INVOKABLE const QSet<QObject *> requiredPreviousEvaluations() const;
- Q_INVOKABLE const QSet<QObject *> variationPoints() const;
+ Q_INVOKABLE const QList<QObject *> variationPoints() const;
Q_INVOKABLE const QSet<QObject *> designDimensionInstances() const;
Q_INVOKABLE bool enabled() const;
@@ -82,7 +82,7 @@ public Q_SLOTS:
// Slots for owned attributes [DesignDimension]
void setName(QString name);
- void setInstanceSelectionRule(QString instanceSelectionRule);
+ void setInstanceSelectionRule(QObject *instanceSelectionRule = 0);
void addRequiredPreviousEvaluation(QObject *requiredPreviousEvaluation);
void removeRequiredPreviousEvaluation(QObject *requiredPreviousEvaluation);
void addVariationPoint(QObject *variationPoint);
@@ -95,9 +95,9 @@ Q_SIGNALS:
// Signals for owned attributes [DesignDimension]
void nameChanged(QString name);
- void instanceSelectionRuleChanged(QString instanceSelectionRule);
+ void instanceSelectionRuleChanged(QObject *instanceSelectionRule);
void requiredPreviousEvaluationsChanged(QSet<QObject *> requiredPreviousEvaluations);
- void variationPointsChanged(QSet<QObject *> variationPoints);
+ void variationPointsChanged(QList<QObject *> variationPoints);
void designDimensionInstancesChanged(QSet<QObject *> designDimensionInstances);
void enabledChanged(bool enabled);
diff --git a/src/duse/qobjects/qdusedesignspaceobject.cpp b/src/duse/qobjects/qdusedesignspaceobject.cpp
index de92618b..47990892 100644
--- a/src/duse/qobjects/qdusedesignspaceobject.cpp
+++ b/src/duse/qobjects/qdusedesignspaceobject.cpp
@@ -131,7 +131,7 @@ void QDuseDesignSpaceObject::setPropertyData()
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignSpace, name, PropertyTypeRole, QStringLiteral("QString"));
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignSpace, name, IsDerivedRole, false);
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignSpace, name, IsDerivedUnionRole, false);
- Q_DECLARE_METAPROPERTY_INFO(QDuseDesignSpace, name, DocumentationRole, QStringLiteral("The design space's name."));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseDesignSpace, name, DocumentationRole, QStringLiteral("The design space name."));
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignSpace, name, RedefinedPropertiesRole, QStringLiteral(""));
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignSpace, name, SubsettedPropertiesRole, QStringLiteral(""));
Q_DECLARE_METAPROPERTY_INFO(QDuseDesignSpace, name, OppositeEndRole, QStringLiteral(""));
diff --git a/src/duse/qobjects/qdusemodelchangeobject.cpp b/src/duse/qobjects/qdusemodelchangeobject.cpp
new file mode 100644
index 00000000..f1cc48c5
--- /dev/null
+++ b/src/duse/qobjects/qdusemodelchangeobject.cpp
@@ -0,0 +1,153 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtDuse module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "qdusemodelchangeobject_p.h"
+#include "private/qmodelingobject_p.h"
+
+#include <QtDuse/QDuseModelChange>
+#include <QtUml/QUmlOpaqueExpression>
+#include <QtUml/QUmlProperty>
+
+QT_BEGIN_NAMESPACE
+
+QDuseModelChangeObject::QDuseModelChangeObject(QDuseModelChange *modelingElement)
+{
+ setProperty("modelingElement", QVariant::fromValue(static_cast<QModelingElement *>(modelingElement)));
+ setGroupProperties();
+ setPropertyData();
+}
+
+// OWNED ATTRIBUTES [ModelChange]
+
+QObject *QDuseModelChangeObject::targetSelectionRule() const
+{
+ if (!qmodelingelementproperty_cast<QDuseModelChange *>(this)->targetSelectionRule())
+ return 0;
+ else
+ return qmodelingelementproperty_cast<QDuseModelChange *>(this)->targetSelectionRule()->asQModelingObject();
+}
+
+QObject *QDuseModelChangeObject::valueSelectionRule() const
+{
+ if (!qmodelingelementproperty_cast<QDuseModelChange *>(this)->valueSelectionRule())
+ return 0;
+ else
+ return qmodelingelementproperty_cast<QDuseModelChange *>(this)->valueSelectionRule()->asQModelingObject();
+}
+
+QObject *QDuseModelChangeObject::targetProperty() const
+{
+ if (!qmodelingelementproperty_cast<QDuseModelChange *>(this)->targetProperty())
+ return 0;
+ else
+ return qmodelingelementproperty_cast<QDuseModelChange *>(this)->targetProperty()->asQModelingObject();
+}
+
+// SLOTS FOR OWNED ATTRIBUTES [ModelChange]
+
+void QDuseModelChangeObject::setTargetSelectionRule(QObject *targetSelectionRule)
+{
+ qmodelingelementproperty_cast<QDuseModelChange *>(this)->setTargetSelectionRule(qmodelingelementproperty_cast<QUmlOpaqueExpression *>(targetSelectionRule));
+ emit targetSelectionRuleChanged(this->targetSelectionRule());
+}
+
+void QDuseModelChangeObject::setValueSelectionRule(QObject *valueSelectionRule)
+{
+ qmodelingelementproperty_cast<QDuseModelChange *>(this)->setValueSelectionRule(qmodelingelementproperty_cast<QUmlOpaqueExpression *>(valueSelectionRule));
+ emit valueSelectionRuleChanged(this->valueSelectionRule());
+}
+
+void QDuseModelChangeObject::setTargetProperty(QObject *targetProperty)
+{
+ qmodelingelementproperty_cast<QDuseModelChange *>(this)->setTargetProperty(qmodelingelementproperty_cast<QUmlProperty *>(targetProperty));
+ emit targetPropertyChanged(this->targetProperty());
+}
+
+
+void QDuseModelChangeObject::setGroupProperties()
+{
+ Q_D(QModelingObject);
+ const QMetaObject *metaObject = this->metaObject();
+
+ d->propertyGroups << QStringLiteral("QObject");
+ d->groupProperties.insert(QStringLiteral("QObject"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("objectName"))));
+
+ d->propertyGroups << QStringLiteral("QDuseModelChange");
+ d->groupProperties.insert(QStringLiteral("QDuseModelChange"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("targetSelectionRule"))));
+ d->groupProperties.insert(QStringLiteral("QDuseModelChange"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("valueSelectionRule"))));
+ d->groupProperties.insert(QStringLiteral("QDuseModelChange"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("targetProperty"))));
+}
+
+void QDuseModelChangeObject::setPropertyData()
+{
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetSelectionRule, AggregationRole, QStringLiteral("composite"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetSelectionRule, PropertyClassRole, QStringLiteral("QDuseModelChange"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetSelectionRule, PropertyTypeRole, QStringLiteral("QUmlOpaqueExpression *"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetSelectionRule, IsDerivedRole, false);
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetSelectionRule, IsDerivedUnionRole, false);
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetSelectionRule, DocumentationRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetSelectionRule, RedefinedPropertiesRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetSelectionRule, SubsettedPropertiesRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetSelectionRule, OppositeEndRole, QStringLiteral(""));
+
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, valueSelectionRule, AggregationRole, QStringLiteral("composite"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, valueSelectionRule, PropertyClassRole, QStringLiteral("QDuseModelChange"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, valueSelectionRule, PropertyTypeRole, QStringLiteral("QUmlOpaqueExpression *"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, valueSelectionRule, IsDerivedRole, false);
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, valueSelectionRule, IsDerivedUnionRole, false);
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, valueSelectionRule, DocumentationRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, valueSelectionRule, RedefinedPropertiesRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, valueSelectionRule, SubsettedPropertiesRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, valueSelectionRule, OppositeEndRole, QStringLiteral(""));
+
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetProperty, AggregationRole, QStringLiteral("none"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetProperty, PropertyClassRole, QStringLiteral("QDuseModelChange"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetProperty, PropertyTypeRole, QStringLiteral("QUmlProperty *"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetProperty, IsDerivedRole, false);
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetProperty, IsDerivedUnionRole, false);
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetProperty, DocumentationRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetProperty, RedefinedPropertiesRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetProperty, SubsettedPropertiesRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseModelChange, targetProperty, OppositeEndRole, QStringLiteral(""));
+
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/duse/qobjects/qdusemodelchangeobject_p.h b/src/duse/qobjects/qdusemodelchangeobject_p.h
new file mode 100644
index 00000000..65fa45a9
--- /dev/null
+++ b/src/duse/qobjects/qdusemodelchangeobject_p.h
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtDuse module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QDUSEMODELCHANGEOBJECT_H
+#define QDUSEMODELCHANGEOBJECT_H
+
+#include <QtDuse/QtDuseGlobal>
+
+#include <QtModeling/QModelingObject>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(QtDuse)
+
+class QDuseModelChange;
+class QModelingObjectPrivate;
+class Q_DUSE_EXPORT QDuseModelChangeObject : public QModelingObject
+{
+ Q_OBJECT
+ Q_DISABLE_COPY(QDuseModelChangeObject)
+ Q_DECLARE_PRIVATE(QModelingObject)
+
+ // Properties [ModelChange]
+ Q_PROPERTY(QObject * targetSelectionRule READ targetSelectionRule WRITE setTargetSelectionRule NOTIFY targetSelectionRuleChanged)
+ Q_PROPERTY(QObject * valueSelectionRule READ valueSelectionRule WRITE setValueSelectionRule NOTIFY valueSelectionRuleChanged)
+ Q_PROPERTY(QObject * targetProperty READ targetProperty WRITE setTargetProperty NOTIFY targetPropertyChanged)
+
+public:
+ Q_INVOKABLE explicit QDuseModelChangeObject(QDuseModelChange *modelingElement);
+
+ // Owned attributes [ModelChange]
+ Q_INVOKABLE QObject *targetSelectionRule() const;
+ Q_INVOKABLE QObject *valueSelectionRule() const;
+ Q_INVOKABLE QObject *targetProperty() const;
+
+public Q_SLOTS:
+
+ // Slots for owned attributes [ModelChange]
+ void setTargetSelectionRule(QObject *targetSelectionRule = 0);
+ void setValueSelectionRule(QObject *valueSelectionRule = 0);
+ void setTargetProperty(QObject *targetProperty = 0);
+
+Q_SIGNALS:
+
+ // Signals for owned attributes [ModelChange]
+ void targetSelectionRuleChanged(QObject *targetSelectionRule);
+ void valueSelectionRuleChanged(QObject *valueSelectionRule);
+ void targetPropertyChanged(QObject *targetProperty);
+
+protected:
+ virtual void setGroupProperties();
+ virtual void setPropertyData();
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDUSEMODELCHANGEOBJECT_H
+
diff --git a/src/duse/qobjects/qdusequalitymetricobject.cpp b/src/duse/qobjects/qdusequalitymetricobject.cpp
index 3e853fed..e1b55421 100644
--- a/src/duse/qobjects/qdusequalitymetricobject.cpp
+++ b/src/duse/qobjects/qdusequalitymetricobject.cpp
@@ -42,6 +42,8 @@
#include "private/qmodelingobject_p.h"
#include <QtDuse/QDuseQualityMetric>
+#include <QtUml/QUmlOpaqueExpression>
+
QT_BEGIN_NAMESPACE
QDuseQualityMetricObject::QDuseQualityMetricObject(QDuseQualityMetric *modelingElement)
@@ -63,9 +65,12 @@ double QDuseQualityMetricObject::value() const
return qmodelingelementproperty_cast<QDuseQualityMetric *>(this)->value();
}
-QString QDuseQualityMetricObject::expression() const
+QObject *QDuseQualityMetricObject::expression() const
{
- return qmodelingelementproperty_cast<QDuseQualityMetric *>(this)->expression();
+ if (!qmodelingelementproperty_cast<QDuseQualityMetric *>(this)->expression())
+ return 0;
+ else
+ return qmodelingelementproperty_cast<QDuseQualityMetric *>(this)->expression()->asQModelingObject();
}
// SLOTS FOR OWNED ATTRIBUTES [QualityMetric]
@@ -82,9 +87,9 @@ void QDuseQualityMetricObject::setValue(double value)
emit valueChanged(this->value());
}
-void QDuseQualityMetricObject::setExpression(QString expression)
+void QDuseQualityMetricObject::setExpression(QObject *expression)
{
- qmodelingelementproperty_cast<QDuseQualityMetric *>(this)->setExpression(expression);
+ qmodelingelementproperty_cast<QDuseQualityMetric *>(this)->setExpression(qmodelingelementproperty_cast<QUmlOpaqueExpression *>(expression));
emit expressionChanged(this->expression());
}
@@ -125,9 +130,9 @@ void QDuseQualityMetricObject::setPropertyData()
Q_DECLARE_METAPROPERTY_INFO(QDuseQualityMetric, value, SubsettedPropertiesRole, QStringLiteral(""));
Q_DECLARE_METAPROPERTY_INFO(QDuseQualityMetric, value, OppositeEndRole, QStringLiteral(""));
- Q_DECLARE_METAPROPERTY_INFO(QDuseQualityMetric, expression, AggregationRole, QStringLiteral("none"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseQualityMetric, expression, AggregationRole, QStringLiteral("composite"));
Q_DECLARE_METAPROPERTY_INFO(QDuseQualityMetric, expression, PropertyClassRole, QStringLiteral("QDuseQualityMetric"));
- Q_DECLARE_METAPROPERTY_INFO(QDuseQualityMetric, expression, PropertyTypeRole, QStringLiteral("QString"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseQualityMetric, expression, PropertyTypeRole, QStringLiteral("QUmlOpaqueExpression *"));
Q_DECLARE_METAPROPERTY_INFO(QDuseQualityMetric, expression, IsDerivedRole, false);
Q_DECLARE_METAPROPERTY_INFO(QDuseQualityMetric, expression, IsDerivedUnionRole, false);
Q_DECLARE_METAPROPERTY_INFO(QDuseQualityMetric, expression, DocumentationRole, QStringLiteral("The quality metric's evaluation expression."));
diff --git a/src/duse/qobjects/qdusequalitymetricobject_p.h b/src/duse/qobjects/qdusequalitymetricobject_p.h
index c0fb70b7..208e357b 100644
--- a/src/duse/qobjects/qdusequalitymetricobject_p.h
+++ b/src/duse/qobjects/qdusequalitymetricobject_p.h
@@ -62,7 +62,7 @@ class Q_DUSE_EXPORT QDuseQualityMetricObject : public QModelingObject
// Properties [QualityMetric]
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(double value READ value WRITE setValue NOTIFY valueChanged)
- Q_PROPERTY(QString expression READ expression WRITE setExpression NOTIFY expressionChanged)
+ Q_PROPERTY(QObject * expression READ expression WRITE setExpression NOTIFY expressionChanged)
public:
Q_INVOKABLE explicit QDuseQualityMetricObject(QDuseQualityMetric *modelingElement);
@@ -70,21 +70,21 @@ public:
// Owned attributes [QualityMetric]
Q_INVOKABLE QString name() const;
Q_INVOKABLE double value() const;
- Q_INVOKABLE QString expression() const;
+ Q_INVOKABLE QObject *expression() const;
public Q_SLOTS:
// Slots for owned attributes [QualityMetric]
void setName(QString name);
void setValue(double value);
- void setExpression(QString expression);
+ void setExpression(QObject *expression = 0);
Q_SIGNALS:
// Signals for owned attributes [QualityMetric]
void nameChanged(QString name);
void valueChanged(double value);
- void expressionChanged(QString expression);
+ void expressionChanged(QObject *expression);
protected:
virtual void setGroupProperties();
diff --git a/src/duse/qobjects/qdusevariationpointobject.cpp b/src/duse/qobjects/qdusevariationpointobject.cpp
index ffdcd1eb..1aa6994c 100644
--- a/src/duse/qobjects/qdusevariationpointobject.cpp
+++ b/src/duse/qobjects/qdusevariationpointobject.cpp
@@ -42,7 +42,9 @@
#include "private/qmodelingobject_p.h"
#include <QtDuse/QDuseVariationPoint>
-#include <QtUml/QUmlProperty>
+#include <QtDuse/QDuseModelChange>
+#include <QtUml/QUmlElement>
+#include <QtUml/QUmlOpaqueExpression>
QT_BEGIN_NAMESPACE
@@ -65,17 +67,28 @@ QString QDuseVariationPointObject::rationale() const
return qmodelingelementproperty_cast<QDuseVariationPoint *>(this)->rationale();
}
-QString QDuseVariationPointObject::preChangeValidationRule() const
+QObject *QDuseVariationPointObject::preChangeValidationRule() const
{
- return qmodelingelementproperty_cast<QDuseVariationPoint *>(this)->preChangeValidationRule();
+ if (!qmodelingelementproperty_cast<QDuseVariationPoint *>(this)->preChangeValidationRule())
+ return 0;
+ else
+ return qmodelingelementproperty_cast<QDuseVariationPoint *>(this)->preChangeValidationRule()->asQModelingObject();
}
-QObject *QDuseVariationPointObject::modelChange() const
+const QList<QObject *> QDuseVariationPointObject::modelChanges() const
{
- if (!qmodelingelementproperty_cast<QDuseVariationPoint *>(this)->modelChange())
- return 0;
- else
- return qmodelingelementproperty_cast<QDuseVariationPoint *>(this)->modelChange()->asQModelingObject();
+ QList<QObject *> list;
+ foreach (QDuseModelChange *element, qmodelingelementproperty_cast<QDuseVariationPoint *>(this)->modelChanges())
+ list.append(element->asQModelingObject());
+ return list;
+}
+
+const QList<QObject *> QDuseVariationPointObject::addedElements() const
+{
+ QList<QObject *> list;
+ foreach (QUmlElement *element, qmodelingelementproperty_cast<QDuseVariationPoint *>(this)->addedElements())
+ list.append(element->asQModelingObject());
+ return list;
}
// SLOTS FOR OWNED ATTRIBUTES [VariationPoint]
@@ -92,16 +105,34 @@ void QDuseVariationPointObject::setRationale(QString rationale)
emit rationaleChanged(this->rationale());
}
-void QDuseVariationPointObject::setPreChangeValidationRule(QString preChangeValidationRule)
+void QDuseVariationPointObject::setPreChangeValidationRule(QObject *preChangeValidationRule)
{
- qmodelingelementproperty_cast<QDuseVariationPoint *>(this)->setPreChangeValidationRule(preChangeValidationRule);
+ qmodelingelementproperty_cast<QDuseVariationPoint *>(this)->setPreChangeValidationRule(qmodelingelementproperty_cast<QUmlOpaqueExpression *>(preChangeValidationRule));
emit preChangeValidationRuleChanged(this->preChangeValidationRule());
}
-void QDuseVariationPointObject::setModelChange(QObject *modelChange)
+void QDuseVariationPointObject::addModelChange(QObject *modelChange)
+{
+ qmodelingelementproperty_cast<QDuseVariationPoint *>(this)->addModelChange(qmodelingelementproperty_cast<QDuseModelChange *>(modelChange));
+ emit modelChangesChanged(this->modelChanges());
+}
+
+void QDuseVariationPointObject::removeModelChange(QObject *modelChange)
+{
+ qmodelingelementproperty_cast<QDuseVariationPoint *>(this)->removeModelChange(qmodelingelementproperty_cast<QDuseModelChange *>(modelChange));
+ emit modelChangesChanged(this->modelChanges());
+}
+
+void QDuseVariationPointObject::addAddedElement(QObject *addedElement)
+{
+ qmodelingelementproperty_cast<QDuseVariationPoint *>(this)->addAddedElement(qmodelingelementproperty_cast<QUmlElement *>(addedElement));
+ emit addedElementsChanged(this->addedElements());
+}
+
+void QDuseVariationPointObject::removeAddedElement(QObject *addedElement)
{
- qmodelingelementproperty_cast<QDuseVariationPoint *>(this)->setModelChange(qmodelingelementproperty_cast<QUmlProperty *>(modelChange));
- emit modelChangeChanged(this->modelChange());
+ qmodelingelementproperty_cast<QDuseVariationPoint *>(this)->removeAddedElement(qmodelingelementproperty_cast<QUmlElement *>(addedElement));
+ emit addedElementsChanged(this->addedElements());
}
@@ -117,7 +148,8 @@ void QDuseVariationPointObject::setGroupProperties()
d->groupProperties.insert(QStringLiteral("QDuseVariationPoint"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("name"))));
d->groupProperties.insert(QStringLiteral("QDuseVariationPoint"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("rationale"))));
d->groupProperties.insert(QStringLiteral("QDuseVariationPoint"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("preChangeValidationRule"))));
- d->groupProperties.insert(QStringLiteral("QDuseVariationPoint"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("modelChange"))));
+ d->groupProperties.insert(QStringLiteral("QDuseVariationPoint"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("modelChanges"))));
+ d->groupProperties.insert(QStringLiteral("QDuseVariationPoint"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("addedElements"))));
}
void QDuseVariationPointObject::setPropertyData()
@@ -142,9 +174,9 @@ void QDuseVariationPointObject::setPropertyData()
Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, rationale, SubsettedPropertiesRole, QStringLiteral(""));
Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, rationale, OppositeEndRole, QStringLiteral(""));
- Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, preChangeValidationRule, AggregationRole, QStringLiteral("none"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, preChangeValidationRule, AggregationRole, QStringLiteral("composite"));
Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, preChangeValidationRule, PropertyClassRole, QStringLiteral("QDuseVariationPoint"));
- Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, preChangeValidationRule, PropertyTypeRole, QStringLiteral("QString"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, preChangeValidationRule, PropertyTypeRole, QStringLiteral("QUmlOpaqueExpression *"));
Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, preChangeValidationRule, IsDerivedRole, false);
Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, preChangeValidationRule, IsDerivedUnionRole, false);
Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, preChangeValidationRule, DocumentationRole, QStringLiteral("A set of rules which should be evaluated as true if design space locations containing such variation point are to be considered as valid ones."));
@@ -152,15 +184,25 @@ void QDuseVariationPointObject::setPropertyData()
Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, preChangeValidationRule, SubsettedPropertiesRole, QStringLiteral(""));
Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, preChangeValidationRule, OppositeEndRole, QStringLiteral(""));
- Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChange, AggregationRole, QStringLiteral("none"));
- Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChange, PropertyClassRole, QStringLiteral("QDuseVariationPoint"));
- Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChange, PropertyTypeRole, QStringLiteral("QUmlProperty *"));
- Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChange, IsDerivedRole, false);
- Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChange, IsDerivedUnionRole, false);
- Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChange, DocumentationRole, QStringLiteral("The architectural changes to be enacted as contributions arosen from this variation point. The complete set of architectural changes is the merge of architectural contributions from all involved variation points."));
- Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChange, RedefinedPropertiesRole, QStringLiteral(""));
- Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChange, SubsettedPropertiesRole, QStringLiteral(""));
- Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChange, OppositeEndRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChanges, AggregationRole, QStringLiteral("composite"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChanges, PropertyClassRole, QStringLiteral("QDuseVariationPoint"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChanges, PropertyTypeRole, QStringLiteral("QList<QDuseModelChange *>"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChanges, IsDerivedRole, false);
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChanges, IsDerivedUnionRole, false);
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChanges, DocumentationRole, QStringLiteral("The architectural changes to be enacted as contributions arosen from this variation point. The complete set of architectural changes is the merge of architectural contributions from all involved variation points."));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChanges, RedefinedPropertiesRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChanges, SubsettedPropertiesRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, modelChanges, OppositeEndRole, QStringLiteral(""));
+
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, addedElements, AggregationRole, QStringLiteral("none"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, addedElements, PropertyClassRole, QStringLiteral("QDuseVariationPoint"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, addedElements, PropertyTypeRole, QStringLiteral("QList<QUmlElement *>"));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, addedElements, IsDerivedRole, false);
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, addedElements, IsDerivedUnionRole, false);
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, addedElements, DocumentationRole, QStringLiteral("The architectural elements to be added as part of architecture redesign contribution arising from this variation point. The complete set of added architectural elements is the merge of architectural contributions from all involved variation points."));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, addedElements, RedefinedPropertiesRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, addedElements, SubsettedPropertiesRole, QStringLiteral(""));
+ Q_DECLARE_METAPROPERTY_INFO(QDuseVariationPoint, addedElements, OppositeEndRole, QStringLiteral(""));
}
diff --git a/src/duse/qobjects/qdusevariationpointobject_p.h b/src/duse/qobjects/qdusevariationpointobject_p.h
index 44fc3454..0e3f363e 100644
--- a/src/duse/qobjects/qdusevariationpointobject_p.h
+++ b/src/duse/qobjects/qdusevariationpointobject_p.h
@@ -62,8 +62,9 @@ class Q_DUSE_EXPORT QDuseVariationPointObject : public QModelingObject
// Properties [VariationPoint]
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(QString rationale READ rationale WRITE setRationale NOTIFY rationaleChanged)
- Q_PROPERTY(QString preChangeValidationRule READ preChangeValidationRule WRITE setPreChangeValidationRule NOTIFY preChangeValidationRuleChanged)
- Q_PROPERTY(QObject * modelChange READ modelChange WRITE setModelChange NOTIFY modelChangeChanged)
+ Q_PROPERTY(QObject * preChangeValidationRule READ preChangeValidationRule WRITE setPreChangeValidationRule NOTIFY preChangeValidationRuleChanged)
+ Q_PROPERTY(QList<QObject *> modelChanges READ modelChanges NOTIFY modelChangesChanged)
+ Q_PROPERTY(QList<QObject *> addedElements READ addedElements NOTIFY addedElementsChanged)
public:
Q_INVOKABLE explicit QDuseVariationPointObject(QDuseVariationPoint *modelingElement);
@@ -71,24 +72,29 @@ public:
// Owned attributes [VariationPoint]
Q_INVOKABLE QString name() const;
Q_INVOKABLE QString rationale() const;
- Q_INVOKABLE QString preChangeValidationRule() const;
- Q_INVOKABLE QObject *modelChange() const;
+ Q_INVOKABLE QObject *preChangeValidationRule() const;
+ Q_INVOKABLE const QList<QObject *> modelChanges() const;
+ Q_INVOKABLE const QList<QObject *> addedElements() const;
public Q_SLOTS:
// Slots for owned attributes [VariationPoint]
void setName(QString name);
void setRationale(QString rationale);
- void setPreChangeValidationRule(QString preChangeValidationRule);
- void setModelChange(QObject *modelChange = 0);
+ void setPreChangeValidationRule(QObject *preChangeValidationRule = 0);
+ void addModelChange(QObject *modelChange);
+ void removeModelChange(QObject *modelChange);
+ void addAddedElement(QObject *addedElement);
+ void removeAddedElement(QObject *addedElement);
Q_SIGNALS:
// Signals for owned attributes [VariationPoint]
void nameChanged(QString name);
void rationaleChanged(QString rationale);
- void preChangeValidationRuleChanged(QString preChangeValidationRule);
- void modelChangeChanged(QObject *modelChange);
+ void preChangeValidationRuleChanged(QObject *preChangeValidationRule);
+ void modelChangesChanged(QList<QObject *> modelChanges);
+ void addedElementsChanged(QList<QObject *> addedElements);
protected:
virtual void setGroupProperties();
diff --git a/src/modeling/qxmireader.cpp b/src/modeling/qxmireader.cpp
index 6be15833..bfe7ec63 100644
--- a/src/modeling/qxmireader.cpp
+++ b/src/modeling/qxmireader.cpp
@@ -96,6 +96,7 @@ QList<QModelingElement *> QXmiReader::readFile(QIODevice *device, QString import
d->idMap.clear();
d->errors.clear();
d->xmlNamespaceToImplementationNamespace.clear();
+ d->xmlNamespaceToNamespaceUri.clear();
}
QXmlStreamReader reader;
reader.setDevice(device);
@@ -151,6 +152,7 @@ QList<QModelingElement *> QXmiReader::readFile(QIODevice *device, QString import
}
foreach (const QXmlStreamNamespaceDeclaration &namespaceDeclaration, reader.namespaceDeclarations()) {
+ d->xmlNamespaceToNamespaceUri.insert(namespaceDeclaration.prefix().toString(), namespaceDeclaration.namespaceUri().toString());
QMetaModelPlugin *metaModelPlugin = d->metaModelPlugins.value(namespaceDeclaration.namespaceUri().toString()).first;
if (metaModelPlugin) {
d->xmlNamespaceToImplementationNamespace.insert(namespaceDeclaration.prefix().toString(), d->metaModelPlugins.value(namespaceDeclaration.namespaceUri().toString()).second.value(QStringLiteral("MetaModelPrefix")).toString());
@@ -164,11 +166,12 @@ QList<QModelingElement *> QXmiReader::readFile(QIODevice *device, QString import
xmiType = reader.qualifiedName().toString();
if (xmiType.isEmpty() || d->xmlNamespaceToImplementationNamespace[xmiType.split(':').first()].isEmpty())
continue;
+ QString typeNamespaceUri = d->xmlNamespaceToNamespaceUri[xmiType.split(':').first()];
xmiType = QStringLiteral("%1%2").arg(d->xmlNamespaceToImplementationNamespace[xmiType.split(':').first()]).arg(xmiType.split(':').last());
QString instanceName = reader.attributes().value(QStringLiteral("name")).toString();
if (instanceName.isEmpty())
instanceName = reader.attributes().value(QStringLiteral("xmi:id")).toString();
- QModelingElement *modelingObject = createInstance(currentNamespaceUri, xmiType, instanceName);
+ QModelingElement *modelingObject = createInstance(typeNamespaceUri, xmiType, instanceName);
if (modelingObject) {
d->idMap.insert(reader.attributes().value(QStringLiteral("xmi:id")).toString(), modelingObject);
if (!rootElement) {
@@ -219,6 +222,14 @@ QList<QModelingElement *> QXmiReader::readFile(QIODevice *device, QString import
reader.readNext();
top->setProperty(propertyName.toLatin1(), reader.text().toLatin1());
}
+ QString elementName = reader.name().toString();
+ elementName = elementName.left(1).toUpper() + elementName.mid(1);
+ int methodIndex;
+ if ((methodIndex = top->metaObject()->indexOfMethod(QStringLiteral("add%1(QString)").arg(elementName).toLatin1())) != -1) {
+ QMetaMethod metaMethod = top->metaObject()->method(methodIndex);
+ reader.readNext();
+ metaMethod.invoke(top, ::Q_ARG(QString, reader.text().toString()));
+ }
continue;
}
@@ -228,7 +239,10 @@ QList<QModelingElement *> QXmiReader::readFile(QIODevice *device, QString import
const QMetaObject *metaObject = modelingObject->asQModelingObject()->metaObject();
foreach (QXmlStreamAttribute attribute, reader.attributes()) {
int propertyIndex;
- if ((propertyIndex = metaObject->indexOfProperty(attribute.name().toString().toLatin1())) != -1) {
+ QString elementName = attribute.name().toString();
+ elementName = elementName.left(1).toUpper() + elementName.mid(1);
+ if ((propertyIndex = metaObject->indexOfProperty(attribute.name().toString().toLatin1())) != -1 ||
+ metaObject->indexOfMethod(QStringLiteral("add%1").arg(elementName).toLatin1()) != -1) {
QMetaProperty metaProperty = metaObject->property(propertyIndex);
if (metaProperty.type() == QVariant::Bool) {
if (!modelingObject->asQModelingObject()->setProperty(attribute.name().toString().toLatin1(), attribute.value().toString() == QStringLiteral("true") ? true:false))
@@ -252,8 +266,6 @@ QList<QModelingElement *> QXmiReader::readFile(QIODevice *device, QString import
else if (QString::fromLatin1(metaProperty.typeName()).endsWith('*')) {
QModelingElement *propertyObject = d->idMap.value(attribute.value().toString());
if (propertyObject) {
- QString elementName = attribute.name().toString();
- elementName = elementName.left(1).toUpper() + elementName.mid(1);
int methodCount = modelingObject->asQModelingObject()->metaObject()->methodCount();
int i;
for (i = 0; i < methodCount; ++i) {
diff --git a/src/modeling/qxmireader_p.h b/src/modeling/qxmireader_p.h
index 100a7eb7..1ea41499 100644
--- a/src/modeling/qxmireader_p.h
+++ b/src/modeling/qxmireader_p.h
@@ -67,6 +67,7 @@ public:
QHash<QString, QModelingElement *> idMap;
QHash< QString, QPair<QMetaModelPlugin *, QJsonObject> > metaModelPlugins;
QHash<QString, QString> xmlNamespaceToImplementationNamespace;
+ QHash<QString, QString> xmlNamespaceToNamespaceUri;
QStringList errors;
};
diff --git a/src/modelingwidgets/qmodelingobjectpropertymodel.cpp b/src/modelingwidgets/qmodelingobjectpropertymodel.cpp
index 00913d3a..ade40982 100644
--- a/src/modelingwidgets/qmodelingobjectpropertymodel.cpp
+++ b/src/modelingwidgets/qmodelingobjectpropertymodel.cpp
@@ -166,26 +166,50 @@ QVariant QModelingObjectPropertyModel::data(const QModelIndex &index, int role)
else
return QVariant();
}
- else if (typeName.contains(QStringLiteral("QSet")) && variant.isValid()) {
+ else if (typeName.contains(QStringLiteral("QSet")) && typeName.contains('*') && variant.isValid()) {
QSet<QModelingObject *> elements = *(static_cast<QSet<QModelingObject *> *>(variant.data()));
QString str;
if (elements.size() > 0) {
str.append('[');
foreach (QModelingObject *modelingObject, elements)
if (modelingObject)
- str.append((modelingObject)->objectName().append(QStringLiteral(", ")));
+ str.append(modelingObject->objectName().append(QStringLiteral(", ")));
str.chop(2);
str.append(']');
}
return !str.isEmpty() ? str:QVariant();
}
- else if (typeName.contains(QStringLiteral("QList")) && variant.isValid()) {
+ else if (typeName.contains(QStringLiteral("QList")) && typeName.contains('*') && variant.isValid()) {
QList<QModelingObject *> elements = *(static_cast<QList<QModelingObject *> *>(variant.data()));
QString str;
if (elements.size() > 0) {
str.append('[');
- foreach (QModelingObject *object, elements)
- str.append((object)->objectName().append(QStringLiteral(", ")));
+ foreach (QModelingObject *modelingObject, elements)
+ str.append(modelingObject->objectName().append(QStringLiteral(", ")));
+ str.chop(2);
+ str.append(']');
+ }
+ return !str.isEmpty() ? str:QVariant();
+ }
+ else if (typeName.contains(QStringLiteral("QSet")) && typeName.contains(QStringLiteral("QString")) && variant.isValid()) {
+ QSet<QString> elements = *(static_cast<QSet<QString> *>(variant.data()));
+ QString str;
+ if (elements.size() > 0) {
+ str.append('[');
+ foreach (QString string, elements)
+ str.append(string.append(QStringLiteral(", ")));
+ str.chop(2);
+ str.append(']');
+ }
+ return !str.isEmpty() ? str:QVariant();
+ }
+ else if (typeName.contains(QStringLiteral("QList")) && typeName.contains(QStringLiteral("QString")) && variant.isValid()) {
+ QList<QString> elements = *(static_cast<QList<QString> *>(variant.data()));
+ QString str;
+ if (elements.size() > 0) {
+ str.append('[');
+ foreach (QString string, elements)
+ str.append(string.append(QStringLiteral(", ")));
str.chop(2);
str.append(']');
}
diff --git a/src/plugins/metamodels/duse/Duse.xmi b/src/plugins/metamodels/duse/Duse.xmi
index fd59f45f..d3e3a99f 100644
--- a/src/plugins/metamodels/duse/Duse.xmi
+++ b/src/plugins/metamodels/duse/Duse.xmi
@@ -7,6 +7,12 @@
<elementImport xmi:type="uml:ElementImport" xmi:id="ElementImport.0">
<importedElement href="http://www.omg.org/spec/UML/20110701/UML.xmi#Property"/>
</elementImport>
+ <elementImport xmi:type="uml:ElementImport" xmi:id="ElementImport.0">
+ <importedElement href="http://www.omg.org/spec/UML/20110701/UML.xmi#OpaqueExpression"/>
+ </elementImport>
+ <elementImport xmi:type="uml:ElementImport" xmi:id="ElementImport.0">
+ <importedElement href="http://www.omg.org/spec/UML/20110701/UML.xmi#Element"/>
+ </elementImport>
<packagedElement xmi:type="uml:Association" name="A_designSpace_designDimension" xmi:id="A_designSpace_designDimension">
<memberEnd xmi:idref="DesignSpace-designDimension"/>
<memberEnd xmi:idref="A_designSpace_designDimension-designSpace"/>
@@ -53,7 +59,7 @@
</ownedComment>
<ownedAttribute xmi:type="uml:Property" name="name" visibility="public" xmi:id="DesignSpace-name">
<ownedComment xmi:type="uml:Comment" xmi:id="DesignSpace-name-_ownedComment.0" annotatedElement="DesignSpace-name">
- <body>The design space's name.</body>
+ <body>The design space name.</body>
</ownedComment>
<type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#String"/>
</ownedAttribute>
@@ -84,11 +90,11 @@
</ownedComment>
<type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#String"/>
</ownedAttribute>
- <ownedAttribute xmi:type="uml:Property" visibility="public" name="instanceSelectionRule" xmi:id="DesignDimension-instanceSelectionRule">
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="instanceSelectionRule" aggregation="composite" xmi:id="DesignDimension-instanceSelectionRule">
<ownedComment xmi:type="uml:Comment" xmi:id="DesignDimension-instanceSelectionRule-_ownedComment.0" annotatedElement="DesignDimension-instanceSelectionRule">
<body>The rule for detecting a specific locus of architectural decision related to this design dimension. Such rule relies on the accompanying UML profile for the specific application domain, in order to identify the decision loci.</body>
</ownedComment>
- <type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#String"/>
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#OpaqueExpression"/>
</ownedAttribute>
<ownedAttribute xmi:type="uml:Property" name="requiredPreviousEvaluation" visibility="public" type="DesignDimension" xmi:id="DesignDimension-requiredPreviousEvaluation">
<ownedComment xmi:type="uml:Comment" xmi:id="DesignDimension-requiredPreviousEvaluation-_ownedComment.0" annotatedElement="DesignDimension-requiredPreviousEvaluation">
@@ -98,7 +104,7 @@
<upperValue xmi:type="uml:LiteralUnlimitedNatural" value="*" xmi:id="DesignDimension-requiredPreviousEvaluation-LiteralUnlimitedNatural.1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="DesignDimension-requiredPreviousEvaluation-LiteralInteger.1"/>
</ownedAttribute>
- <ownedAttribute xmi:type="uml:Property" name="variationPoint" visibility="public" type="VariationPoint" aggregation="composite" xmi:id="DesignDimension-variationPoint">
+ <ownedAttribute xmi:type="uml:Property" name="variationPoint" visibility="public" type="VariationPoint" aggregation="composite" isOrdered="true" xmi:id="DesignDimension-variationPoint">
<ownedComment xmi:type="uml:Comment" xmi:id="DesignDimension-variationPoint-_ownedComment.0" annotatedElement="DesignDimension-variationPoint">
<body>The design dimension's variation points (alternative solutions for the design dimension's concern).</body>
</ownedComment>
@@ -137,23 +143,46 @@
</ownedComment>
<type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#String"/>
</ownedAttribute>
- <ownedAttribute xmi:type="uml:Property" visibility="public" name="preChangeValidationRule" xmi:id="VariationPoint-preChangeValidationRule">
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="preChangeValidationRule" aggregation="composite" xmi:id="VariationPoint-preChangeValidationRule">
<ownedComment xmi:type="uml:Comment" xmi:id="VariationPoint-preChangeValidationRule-_ownedComment.0" annotatedElement="VariationPoint-preChangeValidationRule">
<body>A set of rules which should be evaluated as true if design space locations containing such variation point are to be considered as valid ones.</body>
</ownedComment>
- <type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#String"/>
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#OpaqueExpression"/>
</ownedAttribute>
- <ownedAttribute xmi:type="uml:Property" visibility="public" name="modelChange" isOrdered="true" xmi:id="VariationPoint-modelChange">
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="modelChange" isOrdered="true" type="ModelChange" aggregation="composite" xmi:id="VariationPoint-modelChange">
<ownedComment xmi:type="uml:Comment" xmi:id="VariationPoint-modelChange-_ownedComment.0" annotatedElement="VariationPoint-modelChange">
<body>The architectural changes to be enacted as contributions arosen from this variation point. The complete set of architectural changes is the merge of architectural contributions from all involved variation points.</body>
</ownedComment>
- <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#Property"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" value="*" xmi:id="VariationPoint-modelChange-LiteralUnlimitedNatural.1"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="VariationPoint-modelChange-LiteralInteger.1"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="addedElement" isOrdered="true" xmi:id="VariationPoint-addedElement">
+ <ownedComment xmi:type="uml:Comment" xmi:id="VariationPoint-addedElement-_ownedComment.0" annotatedElement="VariationPoint-addedElement">
+ <body>The architectural elements to be added as part of architecture redesign contribution arising from this variation point. The complete set of added architectural elements is the merge of architectural contributions from all involved variation points.</body>
+ </ownedComment>
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#Element"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" value="*" xmi:id="VariationPoint-addedElements-LiteralUnlimitedNatural.1"/>
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="VariationPoint-addedElements-LiteralInteger.1"/>
</ownedAttribute>
</packagedElement>
<packagedElement xmi:type="uml:Class" name="DesignDimensionInstance" xmi:id="DesignDimensionInstance">
<ownedComment xmi:type="uml:Comment" xmi:id="DesignDimensionInstance-_ownedComment.0" annotatedElement="DesignDimensionInstance">
<body>A specific design dimenstion instance created to tackle a particular locus of architectural decision in the input model.</body>
</ownedComment>
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="targetInstance" xmi:id="DesignDimensionInstance-targetInstance">
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#Element"/>
+ </ownedAttribute>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" name="ModelChange" xmi:id="ModelChange">
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="targetSelectionRule" aggregation="composite" xmi:id="ModelChange-targetSelectionRule">
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#OpaqueExpression"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="valueSelectionRule" aggregation="composite" xmi:id="ModelChange-valueSelectionRule">
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#OpaqueExpression"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="targetProperty" xmi:id="ModelChange-targetProperty">
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#Property"/>
+ </ownedAttribute>
</packagedElement>
<packagedElement xmi:type="uml:Class" name="QualityMetric" xmi:id="QualityMetric">
<ownedComment xmi:type="uml:Comment" xmi:id="QualityMetric-_ownedComment.0" annotatedElement="QualityMetric">
@@ -171,11 +200,11 @@
</ownedComment>
<type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#Real"/>
</ownedAttribute>
- <ownedAttribute xmi:type="uml:Property" visibility="public" name="expression" xmi:id="QualityMetric-expression">
+ <ownedAttribute xmi:type="uml:Property" visibility="public" name="expression" aggregation="composite" xmi:id="QualityMetric-expression">
<ownedComment xmi:type="uml:Comment" xmi:id="QualityMetric-expression-_ownedComment.0" annotatedElement="QualityMetric-expression">
<body>The quality metric's evaluation expression.</body>
</ownedComment>
- <type href="http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi#String"/>
+ <type href="http://www.omg.org/spec/UML/20110701/UML.xmi#OpaqueExpression"/>
</ownedAttribute>
</packagedElement>
</uml:Package>