Commit 13b0cf27 authored by Simon Barner's avatar Simon Barner
Browse files

- Restore use case metamodel

- Mark its classes as deprecated
- Add initial version of model migrator to remove use case sub-models (to be checked for completeness)
refs 3120
parent 25538c26
......@@ -18,6 +18,15 @@
<eTypeArguments eClassifier="#//glossary/Glossary"/>
</eGenericType>
</eOperations>
<eOperations name="getUseCaseList">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return AnalysisStaticImpl.getUseCaseList(this);"/>
<details key="documentation" value="@deprecated"/>
</eAnnotations>
<eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList">
<eTypeArguments eClassifier="#//usecase/UseCase"/>
</eGenericType>
</eOperations>
<eOperations name="getRequirementSourceList">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return AnalysisStaticImpl.getRequirementSourceList(this);"/>
......@@ -309,6 +318,191 @@
interface="true" eSuperTypes="#//relations/AspectRelationship"/>
<eClassifiers xsi:type="ecore:EClass" name="INonFunctionalRequirement" abstract="true"
interface="true" eSuperTypes="#//relations/AspectRelationship"/>
<eSubpackages name="usecase" nsURI="http://www.fortiss.org/af3/mira/usecase" nsPrefix="org-fortiss-af3-mira-usecase">
<eClassifiers xsi:type="ecore:EClass" name="UseCase" eSuperTypes="#//Requirement platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElementContainer #//usecase/UseCaseSpecification">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
<eOperations name="getScopeSpecification" eType="#//usecase/ScopeSpecification">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return UseCaseStaticImpl.getScopeSpecification(this);"/>
<details key="documentation" value="TODO: write documentation (in the model!)"/>
</eAnnotations>
</eOperations>
<eOperations name="getScenariosList">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return UseCaseStaticImpl.getScenariosList(this);"/>
<details key="documentation" value="TODO: write documentation (in the model!)"/>
</eAnnotations>
<eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList">
<eTypeArguments eClassifier="#//usecase/Scenario"/>
</eGenericType>
</eOperations>
<eOperations name="getTriggerSpecification" eType="#//usecase/TriggerSpecification">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return UseCaseStaticImpl.getTriggerSpecification(this);"/>
<details key="documentation" value="TODO: write documentation (in the model!)"/>
</eAnnotations>
</eOperations>
<eOperations name="getInputSpecification">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return UseCaseStaticImpl.getInputSpecification(this);"/>
<details key="documentation" value="TODO: write documentation (in the model!)"/>
</eAnnotations>
<eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList">
<eTypeArguments eClassifier="#//usecase/InputSpecification"/>
</eGenericType>
</eOperations>
<eOperations name="getOutputSpecification">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return UseCaseStaticImpl.getOutputSpecification(this);"/>
<details key="documentation" value="TODO: write documentation (in the model!)"/>
</eAnnotations>
<eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList">
<eTypeArguments eClassifier="#//usecase/OutputSpecification"/>
</eGenericType>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EReference" name="scope" lowerBound="1"
eType="#//usecase/Scope" containment="true">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="TODO: write documentation (in the model!)"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Scenario" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
<eOperations name="getUseCase" eType="#//usecase/UseCase">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return ScenarioStaticImpl.getUseCase(this);"/>
</eAnnotations>
</eOperations>
<eOperations name="getScenarioStepsList">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return ScenarioStaticImpl.getScenarioStepsList(this);"/>
</eAnnotations>
<eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList">
<eTypeArguments eClassifier="#//usecase/ScenarioStep"/>
</eGenericType>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="successScenario" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ScenarioStep" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
<eOperations name="getScenario" eType="#//usecase/Scenario">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return ScenarioStepStaticImpl.getScenario(this);"/>
</eAnnotations>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EReference" name="actor" eType="#//usecase/Actor"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="action" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="actionType" eType="#//usecase/ScenarioStepActionType"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="branch" eType="#//usecase/ScenarioStep"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Scope" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedElement">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Actor" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="usecase" eType="#//usecase/UseCase"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Trigger" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedElement">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="ScenarioStepActionType">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
<eLiterals name="NotClassified" literal=""/>
<eLiterals name="Input" value="1"/>
<eLiterals name="Output" value="2"/>
<eLiterals name="Internal" value="3"/>
<eLiterals name="External" value="4"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ICondition" abstract="true" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedElement">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ConditionBase" eSuperTypes="#//usecase/ICondition">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="PreconditionSpecification" eSuperTypes="#//RequirementSpecification">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="SuccessgaranteeSpecification" eSuperTypes="#//RequirementSpecification">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="MinimumgaranteeSpecification" eSuperTypes="#//RequirementSpecification">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ScopeSpecification" eSuperTypes="#//RequirementSpecification">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="TriggerSpecification" eSuperTypes="#//RequirementSpecification">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="OutputSpecification" eSuperTypes="#//RequirementSpecification">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="InputSpecification" eSuperTypes="#//RequirementSpecification">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Inputs" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedElement">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Outputs" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedElement">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="UseCaseSpecification" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IModelElementSpecification #//INonFunctionalRequirement">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@deprecated"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="actor" lowerBound="1"
upperBound="-1" eType="#//usecase/Actor" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="trigger" eType="#//usecase/Trigger"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="precondition" eType="#//usecase/ICondition"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="minimalGuarantee" eType="#//usecase/ICondition"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="successGuarantee" eType="#//usecase/ICondition"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="inputs" eType="#//usecase/Inputs"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="outputs" eType="#//usecase/Outputs"
containment="true"/>
</eClassifiers>
</eSubpackages>
<eSubpackages name="relations" nsURI="http://www.fortiss.org/af3/mira/relations"
nsPrefix="org-fortiss-af3-mira-relations">
<eClassifiers xsi:type="ecore:EClass" name="ConflictedRequirementRelationType"
......
......@@ -56,6 +56,7 @@
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//Analysis/externalRelation"/>
<genOperations ecoreOperation="mira.ecore#//Analysis/getRequirementsList"/>
<genOperations ecoreOperation="mira.ecore#//Analysis/getGlossariesList"/>
<genOperations ecoreOperation="mira.ecore#//Analysis/getUseCaseList"/>
<genOperations ecoreOperation="mira.ecore#//Analysis/getRequirementSourceList"/>
<genOperations ecoreOperation="mira.ecore#//Analysis/getRequirementsContainersList"/>
<genOperations ecoreOperation="mira.ecore#//Analysis/getAssociatedComponentArchitectures"/>
......@@ -156,6 +157,63 @@
<genClasses ecoreClass="mira.ecore#//Mode"/>
<genClasses image="false" ecoreClass="mira.ecore#//IFunctionalRequirement"/>
<genClasses image="false" ecoreClass="mira.ecore#//INonFunctionalRequirement"/>
<nestedGenPackages prefix="Usecase" basePackage="org.fortiss.af3.mira.model" disposableProviderFactory="true"
ecorePackage="mira.ecore#//usecase">
<genEnums typeSafeEnumCompatible="false" ecoreEnum="mira.ecore#//usecase/ScenarioStepActionType">
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//usecase/ScenarioStepActionType/NotClassified"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//usecase/ScenarioStepActionType/Input"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//usecase/ScenarioStepActionType/Output"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//usecase/ScenarioStepActionType/Internal"/>
<genEnumLiterals ecoreEnumLiteral="mira.ecore#//usecase/ScenarioStepActionType/External"/>
</genEnums>
<genClasses ecoreClass="mira.ecore#//usecase/UseCase">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//usecase/UseCase/scope"/>
<genOperations ecoreOperation="mira.ecore#//usecase/UseCase/getScopeSpecification"/>
<genOperations ecoreOperation="mira.ecore#//usecase/UseCase/getScenariosList"/>
<genOperations ecoreOperation="mira.ecore#//usecase/UseCase/getTriggerSpecification"/>
<genOperations ecoreOperation="mira.ecore#//usecase/UseCase/getInputSpecification"/>
<genOperations ecoreOperation="mira.ecore#//usecase/UseCase/getOutputSpecification"/>
</genClasses>
<genClasses ecoreClass="mira.ecore#//usecase/Scenario">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//usecase/Scenario/successScenario"/>
<genOperations ecoreOperation="mira.ecore#//usecase/Scenario/getUseCase"/>
<genOperations ecoreOperation="mira.ecore#//usecase/Scenario/getScenarioStepsList"/>
</genClasses>
<genClasses ecoreClass="mira.ecore#//usecase/ScenarioStep">
<genFeatures notify="false" createChild="false" propertySortChoices="true"
ecoreFeature="ecore:EReference mira.ecore#//usecase/ScenarioStep/actor"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//usecase/ScenarioStep/action"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute mira.ecore#//usecase/ScenarioStep/actionType"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true"
ecoreFeature="ecore:EReference mira.ecore#//usecase/ScenarioStep/branch"/>
<genOperations ecoreOperation="mira.ecore#//usecase/ScenarioStep/getScenario"/>
</genClasses>
<genClasses ecoreClass="mira.ecore#//usecase/Scope"/>
<genClasses ecoreClass="mira.ecore#//usecase/Actor">
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference mira.ecore#//usecase/Actor/usecase"/>
</genClasses>
<genClasses ecoreClass="mira.ecore#//usecase/Trigger"/>
<genClasses image="false" ecoreClass="mira.ecore#//usecase/ICondition"/>
<genClasses ecoreClass="mira.ecore#//usecase/ConditionBase"/>
<genClasses ecoreClass="mira.ecore#//usecase/PreconditionSpecification"/>
<genClasses ecoreClass="mira.ecore#//usecase/SuccessgaranteeSpecification"/>
<genClasses ecoreClass="mira.ecore#//usecase/MinimumgaranteeSpecification"/>
<genClasses ecoreClass="mira.ecore#//usecase/ScopeSpecification"/>
<genClasses ecoreClass="mira.ecore#//usecase/TriggerSpecification"/>
<genClasses ecoreClass="mira.ecore#//usecase/OutputSpecification"/>
<genClasses ecoreClass="mira.ecore#//usecase/InputSpecification"/>
<genClasses ecoreClass="mira.ecore#//usecase/Inputs"/>
<genClasses ecoreClass="mira.ecore#//usecase/Outputs"/>
<genClasses ecoreClass="mira.ecore#//usecase/UseCaseSpecification">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//usecase/UseCaseSpecification/actor"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//usecase/UseCaseSpecification/trigger"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//usecase/UseCaseSpecification/precondition"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//usecase/UseCaseSpecification/minimalGuarantee"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//usecase/UseCaseSpecification/successGuarantee"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//usecase/UseCaseSpecification/inputs"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference mira.ecore#//usecase/UseCaseSpecification/outputs"/>
</genClasses>
</nestedGenPackages>
<nestedGenPackages prefix="Relations" basePackage="org.fortiss.af3.mira.model"
disposableProviderFactory="true" ecorePackage="mira.ecore#//relations">
<genClasses ecoreClass="mira.ecore#//relations/ConflictedRequirementRelationType"/>
......
......@@ -12,76 +12,67 @@
genModel="model/mira.genmodel"/>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated mira -->
<package
uri="http://www.fortiss.org/af3/mira/usecase"
class="org.fortiss.af3.mira.model.usecase.impl.UsecasePackage"/>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated mira -->
<package
uri="http://www.fortiss.org/af3/mira/relations"
class="org.fortiss.af3.mira.model.relations.RelationsPackage"
genModel="model/mira.genmodel"/>
class="org.fortiss.af3.mira.model.relations.RelationsPackage"/>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated mira -->
<package
uri="http://www.fortiss.org/af3/mira/verification"
class="org.fortiss.af3.mira.model.verification.VerificationPackage"
genModel="model/mira.genmodel"/>
class="org.fortiss.af3.mira.model.verification.VerificationPackage"/>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated mira -->
<package
uri="http://www.fortiss.org/af3/mira/functional"
class="org.fortiss.af3.mira.model.functional.FunctionalPackage"
genModel="model/mira.genmodel"/>
class="org.fortiss.af3.mira.model.functional.FunctionalPackage"/>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated mira -->
<package
uri="http://www.fortiss.org/af3/mira/glossary"
class="org.fortiss.af3.mira.model.glossary.GlossaryPackage"
genModel="model/mira.genmodel"/>
class="org.fortiss.af3.mira.model.glossary.GlossaryPackage"/>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated mira -->
<package
uri="http://www.fortiss.org/af3/mira/requirementSource"
class="org.fortiss.af3.mira.model.requirementSource.RequirementSourcePackage"
genModel="model/mira.genmodel"/>
class="org.fortiss.af3.mira.model.requirementSource.RequirementSourcePackage"/>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated mira -->
<package
uri="http://www.fortiss.org/af3/mira/interfacebehaviour"
class="org.fortiss.af3.mira.model.interfacebehaviour.InterfacebehaviourPackage"
genModel="model/mira.genmodel"/>
class="org.fortiss.af3.mira.model.interfacebehaviour.InterfacebehaviourPackage"/>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated mira -->
<package
uri="http://www.fortiss.org/af3/mira/constraints"
class="org.fortiss.af3.mira.model.constraints.ConstraintsPackage"
genModel="model/mira.genmodel"/>
class="org.fortiss.af3.mira.model.constraints.ConstraintsPackage"/>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated mira -->
<package
uri="http://www.fortiss.org/af3/mira/timing"
class="org.fortiss.af3.mira.model.timing.TimingPackage"
genModel="model/mira.genmodel"/>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated mira -->
<package
uri="http://www.fortiss.org/af3/mira/security"
class="org.fortiss.af3.mira.model.security.SecurityPackage"
genModel="model/mira.genmodel"/>
class="org.fortiss.af3.mira.model.timing.TimingPackage"/>
</extension>
<extension
......@@ -252,4 +243,11 @@
<modelElementClass modelElementClass="org.fortiss.af3.mira.model.Requirement"/>
</annotation>
</extension>
<extension point="org.fortiss.tooling.kernel.migrationProvider">
<migrationProvider migrationProvider="org.fortiss.af3.mira.model.migration.RemoveUseCaseMigrationProvider">
<objectClass objectClass="org.fortiss.af3.mira.model.Analysis"/>
</migrationProvider>
</extension>
</plugin>
......@@ -49,6 +49,7 @@ import org.fortiss.af3.mira.model.RequirementsContainer;
import org.fortiss.af3.mira.model.glossary.Glossary;
import org.fortiss.af3.mira.model.relations.RequirementRelationStatus;
import org.fortiss.af3.mira.model.requirementSource.RequirementSource;
import org.fortiss.af3.mira.model.usecase.UseCase;
import org.fortiss.af3.project.model.ParameterDefinition;
import org.fortiss.af3.project.model.typesystem.FunctionCallBase;
import org.fortiss.af3.project.model.typesystem.IFunction;
......@@ -68,6 +69,11 @@ class AnalysisStaticImpl {
return getChildrenWithType(analysis, Requirement.class);
}
/** Return all contained {@link UseCase} list */
static EList<UseCase> getUseCaseList(Analysis analysis) {
return getChildrenWithType(analysis, UseCase.class);
}
/** Return {@link Glossary} list */
static EList<Glossary> getGlossariesList(Analysis analysis) {
return pickInstanceOf(Glossary.class, analysis.getContainedElements());
......
RemoveUseCaseMigrationProvider.java 87d5aaa68880e53a7164c8119fee74d9218dc3a2 YELLOW
/*-------------------------------------------------------------------------+
| Copyright 2018 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.mira.model.migration;
import static org.conqat.lib.commons.reflect.ReflectionUtils.isInstanceOfAny;
import static org.eclipse.emf.ecore.util.EcoreUtil.delete;
import static org.fortiss.tooling.common.util.LambdaUtils.asStream;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.xml.type.AnyType;
import org.fortiss.af3.mira.model.usecase.MinimumgaranteeSpecification;
import org.fortiss.af3.mira.model.usecase.UseCase;
import org.fortiss.tooling.kernel.extension.IMigrationProvider;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
/**
* Remove artificats related to deprecated use case model.
*
* @author barner
*/
@SuppressWarnings("deprecation")
public class RemoveUseCaseMigrationProvider implements IMigrationProvider {
/** Returns the {@link Stream} of deprecated model elements to be removed. */
private Stream<EObject> getDeprecatedModelElements(ITopLevelElement modelElement) {
Stream<EObject> root = asStream(modelElement.getRootModelElement().eAllContents());
return root.filter(e -> isInstanceOfAny(e, UseCase.class,
MinimumgaranteeSpecification.class));
}
/** {@inheritDoc} */
@Override
public boolean needMigration(ITopLevelElement modelElement,
Map<EObject, AnyType> unknownFeatures) {
return getDeprecatedModelElements(modelElement).findAny().isPresent();
}
/** {@inheritDoc} */
@Override
public void migrate(ITopLevelElement modelElement, Map<EObject, AnyType> unknownFeatures) {
for(EObject object : getDeprecatedModelElements(modelElement).collect(Collectors.toList())) {
if(object instanceof UseCase && object.eContainer() instanceof INamedCommentedElement) {
INamedCommentedElement parent = (INamedCommentedElement)object.eContainer();
if(parent.getComment() == null || parent.getComment().isEmpty()) {
parent.setComment("Use Case models are no longer supported and have been removed!");
}
}
delete(object);
}
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.mira.model.usecase.impl;
import org.eclipse.emf.common.util.ECollections;
import org.eclipse.emf.common.util.EList;
import org.fortiss.af3.mira.model.usecase.Scenario;
import org.fortiss.af3.mira.model.usecase.ScenarioStep;
import org.fortiss.af3.mira.model.usecase.UseCase;
import org.fortiss.tooling.kernel.utils.EcoreUtils;
/**
* Static implementations for {@link Scenario}.
*
* @author mou
*/
public class ScenarioStaticImpl {
/** Return the {@link UseCase} of the given {@link Scenario} */
public static UseCase getUseCase(Scenario scenario) {
return (UseCase)scenario.getContainer();
}
/** Return the {@link ScenarioStep}s of the given {@link Scenario} */
public static EList<ScenarioStep> getScenarioStepsList(Scenario scenario) {
return ECollections.unmodifiableEList(EcoreUtils.pickInstanceOf(ScenarioStep.class,
scenario.getContainedElements()));
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.mira.model.usecase.impl;
import org.fortiss.af3.mira.model.usecase.Scenario;
import org.fortiss.af3.mira.model.usecase.ScenarioStep;
/**
* Static implementation of {@link ScenarioStep}
*
* @author mou
*/
public class ScenarioStepStaticImpl {
/** Return the parent {@link Scenario} */
public static Scenario getScenario(ScenarioStep scenarioStep) {
return (Scenario)scenarioStep.getContainer();
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.mira.model.usecase.impl;
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.usecase.InputSpecification;