Commit dd104860 authored by Chen Wenwen's avatar Chen Wenwen
Browse files

YELLOW +1312

refs 1005
parent 698e3146
......@@ -12,14 +12,6 @@
<eTypeArguments eClassifier="#//Requirement"/>
</eGenericType>
</eOperations>
<eOperations name="getRequirementRelationsList">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return AnalysisStaticImpl.getRequirementRelationsList(this);"/>
</eAnnotations>
<eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList">
<eTypeArguments eClassifier="#//RequirementRelation"/>
</eGenericType>
</eOperations>
<eOperations name="getGlossariesList">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return AnalysisStaticImpl.getGlossariesList(this);"/>
......@@ -52,6 +44,10 @@
<eTypeArguments eClassifier="#//RequirementsContainer"/>
</eGenericType>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EReference" name="requirementRelation" upperBound="-1"
eType="#//RequirementRelation" containment="true" eOpposite="#//RequirementRelation/analysis"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="requirementRelationStatus"
upperBound="-1" eType="#//relations/RequirementRelationStatus" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Requirement" eSuperTypes="platform:/plugin/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement platform:/plugin/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement #//IImageContainer">
<eOperations name="getAnalysis" eType="#//Analysis">
......@@ -59,27 +55,6 @@
<details key="body" value="return RequirementStaticImpl.getAnalysis(this);"/>
</eAnnotations>
</eOperations>
<eOperations name="getRequirementConnector" eType="#//RequirementConnector">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return RequirementStaticImpl.getRequirementConnector(this);"/>
</eAnnotations>
</eOperations>
<eOperations name="getIncomingRelationsList">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return RequirementStaticImpl.getIncomingRelationsList(this);"/>
</eAnnotations>
<eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList">
<eTypeArguments eClassifier="#//RequirementRelation"/>
</eGenericType>
</eOperations>
<eOperations name="getOutgoingRelationsList">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return RequirementStaticImpl.getOutgoingRelationsList(this);"/>
</eAnnotations>
<eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList">
<eTypeArguments eClassifier="#//RequirementRelation"/>
</eGenericType>
</eOperations>
<eOperations name="getFormalSpecifications">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return RequirementStaticImpl.getFormalSpecifications(this);"/>
......@@ -109,18 +84,24 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="todo" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="reqId" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
defaultValueLiteral="" iD="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="outgoingRequirementRelation"
upperBound="-1" eType="#//RequirementRelation" eOpposite="#//RequirementRelation/sourceRequirement"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="incomingRequirementRelation"
upperBound="-1" eType="#//RequirementRelation" eOpposite="#//RequirementRelation/targetRequirement"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RequirementRelation" eSuperTypes="platform:/plugin/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement platform:/plugin/org.fortiss.tooling.base/model/base.ecore#//element/IConnection">
<eOperations name="getSourceRequirement" eType="#//Requirement">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return RequirementRelationStaticImpl.getSourceRequirement(this);"/>
</eAnnotations>
</eOperations>
<eOperations name="getTargetRequirement" eType="#//Requirement">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return RequirementRelationStaticImpl.getTargetRequirement(this);"/>
</eAnnotations>
</eOperations>
<eClassifiers xsi:type="ecore:EClass" name="RequirementRelation" eSuperTypes="platform:/plugin/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="author" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="analysis" lowerBound="1"
eType="#//Analysis" eOpposite="#//Analysis/requirementRelation"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="requirementRelationType"
lowerBound="1" eType="#//relations/RequirementRelationType" containment="true"
eOpposite="#//relations/RequirementRelationType/requirementRelation"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="sourceRequirement" upperBound="-1"
eType="#//Requirement" eOpposite="#//Requirement/outgoingRequirementRelation"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="targetRequirement" lowerBound="1"
upperBound="-1" eType="#//Requirement" eOpposite="#//Requirement/incomingRequirementRelation"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="requirementRelationStatus"
lowerBound="1" eType="#//relations/RequirementRelationStatus"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RequirementConnector" eSuperTypes="platform:/plugin/org.fortiss.tooling.base/model/base.ecore#//element/IConnector"/>
<eClassifiers xsi:type="ecore:EEnum" name="RequirementStatus">
......@@ -324,13 +305,29 @@
</eSubpackages>
<eSubpackages name="relations" nsURI="http://www.fortiss.org/af3/mira/relations"
nsPrefix="org-fortiss-af3-mira-relations">
<eClassifiers xsi:type="ecore:EClass" name="ConflictedRequirementRelation" eSuperTypes="#//relations/UndirectedRequirementRelation"/>
<eClassifiers xsi:type="ecore:EClass" name="ContradictingRequirementRelation"
eSuperTypes="#//relations/UndirectedRequirementRelation"/>
<eClassifiers xsi:type="ecore:EClass" name="RefinementRequirementRelation" eSuperTypes="#//relations/DirectedRequirementRelation"/>
<eClassifiers xsi:type="ecore:EClass" name="OverridingRequirementRelation" eSuperTypes="#//relations/DirectedRequirementRelation"/>
<eClassifiers xsi:type="ecore:EClass" name="DirectedRequirementRelation" eSuperTypes="#//RequirementRelation"/>
<eClassifiers xsi:type="ecore:EClass" name="UndirectedRequirementRelation" eSuperTypes="#//RequirementRelation"/>
<eClassifiers xsi:type="ecore:EClass" name="ConflictedRequirementRelationType"
eSuperTypes="#//relations/UndirectedRequirementRelationType"/>
<eClassifiers xsi:type="ecore:EClass" name="ContradictingRequirementRelationType"
eSuperTypes="#//relations/UndirectedRequirementRelationType"/>
<eClassifiers xsi:type="ecore:EClass" name="RefinementRequirementRelationType"
eSuperTypes="#//relations/DirectedRequirementRelationType"/>
<eClassifiers xsi:type="ecore:EClass" name="OverridingRequirementRelationType"
eSuperTypes="#//relations/DirectedRequirementRelationType"/>
<eClassifiers xsi:type="ecore:EClass" name="DirectedRequirementRelationType" abstract="true"
eSuperTypes="#//relations/RequirementRelationType"/>
<eClassifiers xsi:type="ecore:EClass" name="UndirectedRequirementRelationType"
abstract="true" eSuperTypes="#//relations/RequirementRelationType"/>
<eClassifiers xsi:type="ecore:EClass" name="DefinedDirectedRequirementRelationType"
eSuperTypes="#//relations/DirectedRequirementRelationType #//relations/DefinedRequirementRelationType"/>
<eClassifiers xsi:type="ecore:EClass" name="DefinedUndirectedRequirementRelationType"
eSuperTypes="#//relations/UndirectedRequirementRelationType #//relations/DefinedRequirementRelationType"/>
<eClassifiers xsi:type="ecore:EClass" name="DefinedRequirementRelationType" abstract="true"
eSuperTypes="platform:/plugin/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement #//relations/RequirementRelationType"/>
<eClassifiers xsi:type="ecore:EClass" name="RequirementRelationType" abstract="true">
<eStructuralFeatures xsi:type="ecore:EReference" name="requirementRelation"
lowerBound="1" eType="#//RequirementRelation" eOpposite="#//RequirementRelation/requirementRelationType"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RequirementRelationStatus" eSuperTypes="platform:/plugin/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement platform:/plugin/org.fortiss.tooling.base/model/base.ecore#//element/IModelElementReference"/>
</eSubpackages>
<eSubpackages name="verification" nsURI="http://www.fortiss.org/af3/mira/verification"
nsPrefix="org-fortiss-af3-mira-verification">
......
......@@ -28,8 +28,9 @@
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//ContextElementStatus/Consolidated"/>
</genEnums>
<genClasses ecoreClass="mira.ecore#//Analysis">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//Analysis/requirementRelation"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//Analysis/requirementRelationStatus"/>
<genOperations ecoreOperation="mira.ecore#//Analysis/getRequirementsList"/>
<genOperations ecoreOperation="mira.ecore#//Analysis/getRequirementRelationsList"/>
<genOperations ecoreOperation="mira.ecore#//Analysis/getGlossariesList"/>
<genOperations ecoreOperation="mira.ecore#//Analysis/getUseCaseList"/>
<genOperations ecoreOperation="mira.ecore#//Analysis/getRequirementSourceList"/>
......@@ -44,17 +45,20 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//Requirement/priority"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//Requirement/todo"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//Requirement/reqId"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference mira.ecore#//Requirement/outgoingRequirementRelation"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference mira.ecore#//Requirement/incomingRequirementRelation"/>
<genOperations ecoreOperation="mira.ecore#//Requirement/getAnalysis"/>
<genOperations ecoreOperation="mira.ecore#//Requirement/getRequirementConnector"/>
<genOperations ecoreOperation="mira.ecore#//Requirement/getIncomingRelationsList"/>
<genOperations ecoreOperation="mira.ecore#//Requirement/getOutgoingRelationsList"/>
<genOperations ecoreOperation="mira.ecore#//Requirement/getFormalSpecifications"/>
<genOperations ecoreOperation="mira.ecore#//Requirement/getRequirementsContainer"/>
<genOperations ecoreOperation="mira.ecore#//Requirement/getRequirementsPackage"/>
</genClasses>
<genClasses ecoreClass="mira.ecore#//RequirementRelation">
<genOperations ecoreOperation="mira.ecore#//RequirementRelation/getSourceRequirement"/>
<genOperations ecoreOperation="mira.ecore#//RequirementRelation/getTargetRequirement"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//RequirementRelation/author"/>
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference mira.ecore#//RequirementRelation/analysis"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//RequirementRelation/requirementRelationType"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference mira.ecore#//RequirementRelation/sourceRequirement"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference mira.ecore#//RequirementRelation/targetRequirement"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference mira.ecore#//RequirementRelation/requirementRelationStatus"/>
</genClasses>
<genClasses ecoreClass="mira.ecore#//RequirementConnector"/>
<genClasses ecoreClass="mira.ecore#//RequirementSpecification">
......@@ -146,12 +150,19 @@
</nestedGenPackages>
<nestedGenPackages prefix="Relations" basePackage="org.fortiss.af3.mira.model"
disposableProviderFactory="true" ecorePackage="mira.ecore#//relations">
<genClasses ecoreClass="mira.ecore#//relations/ConflictedRequirementRelation"/>
<genClasses ecoreClass="mira.ecore#//relations/ContradictingRequirementRelation"/>
<genClasses ecoreClass="mira.ecore#//relations/RefinementRequirementRelation"/>
<genClasses ecoreClass="mira.ecore#//relations/OverridingRequirementRelation"/>
<genClasses ecoreClass="mira.ecore#//relations/DirectedRequirementRelation"/>
<genClasses ecoreClass="mira.ecore#//relations/UndirectedRequirementRelation"/>
<genClasses ecoreClass="mira.ecore#//relations/ConflictedRequirementRelationType"/>
<genClasses ecoreClass="mira.ecore#//relations/ContradictingRequirementRelationType"/>
<genClasses ecoreClass="mira.ecore#//relations/RefinementRequirementRelationType"/>
<genClasses ecoreClass="mira.ecore#//relations/OverridingRequirementRelationType"/>
<genClasses image="false" ecoreClass="mira.ecore#//relations/DirectedRequirementRelationType"/>
<genClasses image="false" ecoreClass="mira.ecore#//relations/UndirectedRequirementRelationType"/>
<genClasses ecoreClass="mira.ecore#//relations/DefinedDirectedRequirementRelationType"/>
<genClasses ecoreClass="mira.ecore#//relations/DefinedUndirectedRequirementRelationType"/>
<genClasses image="false" ecoreClass="mira.ecore#//relations/DefinedRequirementRelationType"/>
<genClasses image="false" ecoreClass="mira.ecore#//relations/RequirementRelationType">
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference mira.ecore#//relations/RequirementRelationType/requirementRelation"/>
</genClasses>
<genClasses ecoreClass="mira.ecore#//relations/RequirementRelationStatus"/>
</nestedGenPackages>
<nestedGenPackages prefix="Verification" basePackage="org.fortiss.af3.mira.model"
disposableProviderFactory="true" ecorePackage="mira.ecore#//verification">
......
......@@ -187,24 +187,34 @@
<extension
point="org.fortiss.af3.mira.relation">
<relation
handler="org.fortiss.af3.mira.relation.handler.RefinementHandler">
handler="org.fortiss.af3.mira.relation.handler.ConflictHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.relations.RefinementRequirementRelation"></modelElementClass>
modelElementClass="org.fortiss.af3.mira.model.relations.ConflictedRequirementRelationType"></modelElementClass>
</relation>
<relation
handler="org.fortiss.af3.mira.relation.handler.ConflictHandler">
handler="org.fortiss.af3.mira.relation.handler.ContradictingHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.relations.ConflictedRequirementRelation"></modelElementClass>
modelElementClass="org.fortiss.af3.mira.model.relations.ContradictingRequirementRelationType"></modelElementClass>
</relation>
<relation
handler="org.fortiss.af3.mira.relation.handler.ContradictingHandler">
handler="org.fortiss.af3.mira.relation.handler.DefinedUndirectedRelationHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.relations.ContradictingRequirementRelation"></modelElementClass>
modelElementClass="org.fortiss.af3.mira.model.relations.DefinedUndirectedRequirementRelationType"></modelElementClass>
</relation>
<relation
handler="org.fortiss.af3.mira.relation.handler.OverridingHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.relations.OverridingRequirementRelation"></modelElementClass>
modelElementClass="org.fortiss.af3.mira.model.relations.OverridingRequirementRelationType"></modelElementClass>
</relation>
<relation
handler="org.fortiss.af3.mira.relation.handler.RefinementHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.relations.RefinementRequirementRelationType"></modelElementClass>
</relation>
<relation
handler="org.fortiss.af3.mira.relation.handler.DefinedDirectedRelationHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.relations.DefinedDirectedRequirementRelationType"></modelElementClass>
</relation>
</extension>
</plugin>
......@@ -17,9 +17,10 @@ $Id$
+--------------------------------------------------------------------------*/
package org.fortiss.af3.mira.command;
import java.util.List;
import org.fortiss.af3.mira.model.Requirement;
import org.fortiss.af3.mira.model.RequirementRelation;
import org.fortiss.af3.mira.relation.IRelationHandler;
/**
* This command creates a requirement relation based on the given relation
......@@ -28,37 +29,28 @@ import org.fortiss.af3.mira.relation.IRelationHandler;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 10233937157A75ECC704A378CE7921A0
* @ConQAT.Rating YELLOW Hash: 916C4C70E1A43BC40D560B5D0BD2911A
*/
public class CreateRelationCommand implements Runnable {
/** the source requirement */
private Requirement source;
public class AddTargetRequirementsCommand implements Runnable {
/** the target requirement */
private Requirement target;
/** the related requirement */
private RequirementRelation relation;
/** the prototype relation */
private IRelationHandler<RequirementRelation> handler;
/** the requirement list */
private List<Requirement> requirements;
/**
* Create the command with source, target requirements and relation
* prototype
*/
public CreateRelationCommand(Requirement source, Requirement target,
IRelationHandler<RequirementRelation> handler) {
this.source = source;
this.target = target;
this.handler = handler;
public AddTargetRequirementsCommand(RequirementRelation relation, List<Requirement> requirements) {
this.relation = relation;
this.requirements = requirements;
}
/** {@inheritDoc} */
@Override
public void run() {
RequirementRelation rel = handler.createInstance();
rel.setSource(source.getRequirementConnector());
rel.setTarget(target.getRequirementConnector());
rel.setOwner(source.getAnalysis());
relation.getTargetRequirementList().addAll(requirements);
}
}
......@@ -19,13 +19,14 @@ package org.fortiss.af3.mira.compose;
import static org.eclipse.emf.ecore.util.EcoreUtil.delete;
import static org.fortiss.af3.mira.utils.MiraUtils.checkAndSetNewReqID;
import static org.fortiss.af3.mira.utils.MiraUtils.getAnalysisFor;
import static org.fortiss.af3.mira.utils.MiraUtils.removeRedundancyRequirementRelation;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.mira.model.Analysis;
import org.fortiss.af3.mira.model.Requirement;
import org.fortiss.af3.mira.model.RequirementRelation;
import org.fortiss.af3.mira.model.RequirementsContainer;
import org.fortiss.af3.mira.model.RequirementsPackage;
import org.fortiss.tooling.base.model.element.IModelElementReference;
import org.fortiss.tooling.kernel.extension.IElementCompositor;
import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
import org.fortiss.tooling.kernel.extension.data.Prototype;
......@@ -36,7 +37,7 @@ import org.fortiss.tooling.kernel.extension.data.Prototype;
* @author wenwenchen
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: BFF2C60901B714FF3FE82E0F8B133BB5
* @ConQAT.Rating YELLOW Hash: 6718082711619DE1E567FA359420FDAB
*/
public class RequirementsContainerCompositor implements IElementCompositor<RequirementsContainer> {
/** {@inheritDoc} */
......@@ -80,25 +81,10 @@ public class RequirementsContainerCompositor implements IElementCompositor<Requi
/** {@inheritDoc} */
@Override
public boolean decompose(EObject contained) {
if(contained instanceof Requirement) {
Requirement r = (Requirement)contained;
for(RequirementRelation rel : r.getAnalysis().getRequirementRelationsList()
// must copy the list, because it will be modified later
.toArray(new RequirementRelation[0])) {
if(rel.getSourceRequirement() == r || rel.getTargetRequirement() == r) {
delete(rel, true);
}
}
for(IModelElementReference ref : r.getReferencedByList()
// must copy the list, because it will be modified later
.toArray(new IModelElementReference[0])) {
delete(ref, true);
}
}
Analysis a = getAnalysisFor(contained);
delete(contained, true);
removeRedundancyRequirementRelation(a);
return true;
}
......
......@@ -19,12 +19,13 @@ package org.fortiss.af3.mira.compose;
import static org.eclipse.emf.ecore.util.EcoreUtil.delete;
import static org.fortiss.af3.mira.utils.MiraUtils.checkAndSetNewReqID;
import static org.fortiss.af3.mira.utils.MiraUtils.getAnalysisFor;
import static org.fortiss.af3.mira.utils.MiraUtils.removeRedundancyRequirementRelation;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.mira.model.Analysis;
import org.fortiss.af3.mira.model.Requirement;
import org.fortiss.af3.mira.model.RequirementRelation;
import org.fortiss.af3.mira.model.RequirementsPackage;
import org.fortiss.tooling.base.model.element.IModelElementReference;
import org.fortiss.tooling.kernel.extension.IElementCompositor;
import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
import org.fortiss.tooling.kernel.extension.data.Prototype;
......@@ -35,7 +36,7 @@ import org.fortiss.tooling.kernel.extension.data.Prototype;
* @author wenwenchen
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 5948B6C980CD93890E02DFADB7F69CA6
* @ConQAT.Rating YELLOW Hash: E5EACDF552BD00F1D3710CD69F2FEAA4
*/
public class RequirementsPackageCompositor implements IElementCompositor<RequirementsPackage> {
......@@ -78,25 +79,9 @@ public class RequirementsPackageCompositor implements IElementCompositor<Require
/** {@inheritDoc} */
@Override
public boolean decompose(EObject contained) {
if(contained instanceof Requirement) {
Requirement r = (Requirement)contained;
for(RequirementRelation rel : r.getAnalysis().getRequirementRelationsList()
// must copy the list, because it will be modified later
.toArray(new RequirementRelation[0])) {
if(rel.getSourceRequirement() == r || rel.getTargetRequirement() == r) {
delete(rel, true);
}
}
for(IModelElementReference ref : r.getReferencedByList()
// must copy the list, because it will be modified later
.toArray(new IModelElementReference[0])) {
delete(ref, true);
}
}
Analysis a = getAnalysisFor(contained);
delete(contained, true);
removeRedundancyRequirementRelation(a);
return true;
}
......
......@@ -17,15 +17,12 @@ $Id$
+--------------------------------------------------------------------------*/
package org.fortiss.af3.mira.model.impl;
import static org.eclipse.emf.common.util.ECollections.unmodifiableEList;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.convertList;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import org.eclipse.emf.common.util.EList;
import org.fortiss.af3.mira.model.Analysis;
import org.fortiss.af3.mira.model.Requirement;
import org.fortiss.af3.mira.model.RequirementRelation;
import org.fortiss.af3.mira.model.RequirementsContainer;
import org.fortiss.af3.mira.model.glossary.Glossary;
import org.fortiss.af3.mira.model.requirementSource.RequirementSource;
......@@ -37,7 +34,7 @@ import org.fortiss.af3.mira.model.usecase.UseCase;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 08006C01CFE62E463BF6CBCA8F9B7AC8
* @ConQAT.Rating YELLOW Hash: 8A8379B948F972E6F1A675D62EDA61DF
*/
public class AnalysisStaticImpl {
......@@ -51,12 +48,6 @@ public class AnalysisStaticImpl {
return getChildrenWithType(analysis, UseCase.class);
}
/** Return {@link RequirementRelation} list */
public static EList<RequirementRelation> getRequirementRelationsList(Analysis analysis) {
return unmodifiableEList(convertList(RequirementRelation.class,
analysis.getConnectionsList()));
}
/** Return {@link Glossary} list */
public static EList<Glossary> getGlossariesList(Analysis analysis) {
return pickInstanceOf(Glossary.class, analysis.getContainedElementsList());
......
......@@ -3,16 +3,11 @@
*/
package org.fortiss.af3.mira.model.impl;
import static org.eclipse.emf.common.util.ECollections.unmodifiableEList;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.convertList;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickFirstInstanceOf;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import org.eclipse.emf.common.util.EList;
import org.fortiss.af3.mira.model.Analysis;
import org.fortiss.af3.mira.model.Requirement;
import org.fortiss.af3.mira.model.RequirementConnector;
import org.fortiss.af3.mira.model.RequirementRelation;
import org.fortiss.af3.mira.model.RequirementsContainer;
import org.fortiss.af3.mira.model.RequirementsPackage;
import org.fortiss.af3.mira.model.functional.FormalSpecification;
......@@ -24,7 +19,7 @@ import org.fortiss.af3.mira.model.functional.FormalSpecification;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: B690CA4977900C658F0658B728391FCA
* @ConQAT.Rating YELLOW Hash: 539B035669EBA23A6D6B1741D877DDEC
*/
class RequirementStaticImpl {
......@@ -36,25 +31,6 @@ class RequirementStaticImpl {
return requirement.getRequirementsContainer().getAnalysis();
}
/**
* Return the default {@link RequirementConnector} of the given {@link Requirement}
*/
public static RequirementConnector getRequirementConnector(Requirement requirement) {
return pickFirstInstanceOf(RequirementConnector.class, requirement.getConnectorsList());
}
/** Return the incoming {@link RequirementRelation}s */
public static EList<RequirementRelation> getIncomingRelationsList(Requirement requirement) {
return unmodifiableEList(convertList(RequirementRelation.class,
getRequirementConnector(requirement).getIncomingList()));
}
/** Return the outgoing {@link RequirementRelation}s */
public static EList<RequirementRelation> getOutgoingRelationsList(Requirement requirement) {
return unmodifiableEList(convertList(RequirementRelation.class,
getRequirementConnector(requirement).getOutgoingList()));
}
/** Return {@link FormalSpecification} list */
public static EList<FormalSpecification> getFormalSpecifications(Requirement requirement) {
return pickInstanceOf(FormalSpecification.class, requirement.getContainedElementsList());
......
......@@ -17,7 +17,7 @@ $Id$
+--------------------------------------------------------------------------*/
package org.fortiss.af3.mira.relation;
import org.fortiss.af3.mira.model.RequirementRelation;
import org.fortiss.af3.mira.model.relations.RequirementRelationType;
import org.fortiss.tooling.kernel.service.base.IEObjectAware;
/**
......@@ -26,9 +26,9 @@ import org.fortiss.tooling.kernel.service.base.IEObjectAware;
* @author hoelzlf
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 07AD83224CF779C2E3325C9AD74247CC
* @ConQAT.Rating YELLOW Hash: 775A14A1D4BE8D60BC732FC5B8475E92
*/
public interface IRelationHandler<T extends RequirementRelation> extends IEObjectAware<T> {
public interface IRelationTypeHandler<T extends RequirementRelationType> extends IEObjectAware<T> {
/** Returns the source display name. */
String getDisplayNameForSource();
......@@ -37,11 +37,14 @@ public interface IRelationHandler<T extends RequirementRelation> extends IEObjec
String getDisplayNameForTarget();
/** Returns the relation name. */
String getRelationName();
String getTypeName();
/** Create a clean instance */
T createInstance();
/** Return the supported class */
Class<T> getRelationClass();
Class<T> getRelationTypeClass();
/** Return the ranking numbering */
int getRanking();
}
......@@ -20,7 +20,7 @@ package org.fortiss.af3.mira.relation;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.mira.model.RequirementRelation;
import org.fortiss.af3.mira.model.relations.RequirementRelationType;
/**
* AF3 service managing access to registered requirements relations. The
......@@ -29,21 +29,21 @@ import org.fortiss.af3.mira.model.RequirementRelation;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: EC5C63E0011312AB119AABD2953F2C54
* @ConQAT.Rating YELLOW Hash: 3953FDDAEDD14A5BB3EA1BD5AFFB215D
*/
public interface IRelationService {
public interface IRelationTypeService {
/** Singleton instance of the service. */
public static final IRelationService INSTANCE = new RelationService();
public static final IRelationTypeService INSTANCE = new RelationTypeService();
/** Finds type system handler for the model element's project configuration. */
IRelationHandler<RequirementRelation> getHandler(EObject element);
IRelationTypeHandler<RequirementRelationType> getHandler(EObject element);
/**
* Return a list of all registered handlers. The list can be modified by the
* caller.
*/
List<IRelationHandler<RequirementRelation>> getHandlers();
List<IRelationTypeHandler<RequirementRelationType>> getHandlers();
/** Return the number of registered handlers. */
int getHandlerCount();
......
......@@ -24,7 +24,7 @@ import java.util.List;
import java.util.Set;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.mira.model.RequirementRelation;
import org.fortiss.af3.mira.model.relations.RequirementRelationType;
import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase;
/**
......@@ -33,10 +33,11 @@ import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase;
* @author mou
* @author $Author$