Skip to content

Commit

Permalink
#91 Fixed transition for FilteringCriterionRulePkg
Browse files Browse the repository at this point in the history
  • Loading branch information
MalinaStefaniaStoicanescu authored and pdulth committed Aug 31, 2023
1 parent 04dbccd commit 0386434
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 1 deletion.
13 changes: 13 additions & 0 deletions plugins/org.polarsys.capella.filtering.transition/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,19 @@
</defaultMappingPossibility>
</mappingElement>

<mappingElement
domainMetaClass="org.polarsys.capella.filtering.FilteringCriterionPkg"
reuseExtendedElementDefaultPossibility="true"
reuseExtendedElementPossibilities="true">
<defaultMappingPossibility
context="org.polarsys.capella.core.transition.common.context.TransitionContext"
enabled="true"
completeRule="org.polarsys.capella.filtering.transition.rules.FilteringCriterionRulePkg"
incompleteRule="org.polarsys.capella.filtering.transition.rules.FilteringCriterionRulePkg"
name="FilteringCriterionPkg">
</defaultMappingPossibility>
</mappingElement>

</mappingPackage>
</mapping>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*******************************************************************************
* Copyright (c) 2023 THALES GLOBAL SERVICES.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Thales - initial API and implementation
*******************************************************************************/
package org.polarsys.capella.filtering.transition.rules;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.polarsys.capella.common.data.modellingcore.ModellingcorePackage;
import org.polarsys.capella.core.transition.common.rules.AbstractUpdateRule;
import org.polarsys.capella.filtering.FilteringPackage;
import org.polarsys.kitalpha.transposer.rules.handler.rules.api.IContext;

public class FilteringCriterionRulePkg extends AbstractUpdateRule {

public FilteringCriterionRulePkg() {
registerUpdatedAttribute(ModellingcorePackage.Literals.ABSTRACT_NAMED_ELEMENT__NAME);
}

@Override
protected EClass getSourceType() {
return FilteringPackage.Literals.FILTERING_CRITERION_PKG;
}

@Override
public EClass getTargetType(EObject element, IContext context) {
return FilteringPackage.Literals.FILTERING_CRITERION_PKG;
}


}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--Capella_Version_6.1.0-->
<!--Capella_Version_null-->
<org.polarsys.capella.core.data.capellamodeller:Project xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:filtering="http://www.polarsys.org/capella/filtering/6.0.0"
xmlns:libraries="http://www.polarsys.org/capella/common/libraries/6.0.0" xmlns:org.polarsys.capella.core.data.capellacommon="http://www.polarsys.org/capella/core/common/6.0.0"
Expand Down Expand Up @@ -42,6 +42,11 @@
name="FilteringModel 1">
<ownedFilteringCriteria xsi:type="filtering:FilteringCriterion" id="93e1e58d-2b4c-4607-95a1-d759dbcdeaa7"
name="FilteringCriterion 1"/>
<ownedFilteringCriterionPkgs xsi:type="filtering:FilteringCriterionPkg" id="e5a5179a-e584-4675-a19c-3f733c43a239"
name="FilteringCriterionPkg 1">
<ownedFilteringCriteria xsi:type="filtering:FilteringCriterion" id="ffef6d25-a657-43a0-af64-160f746a8f46"
name="FilteringCriterion 2"/>
</ownedFilteringCriterionPkgs>
</ownedExtensions>
<ownedArchitectures xsi:type="org.polarsys.capella.core.data.oa:OperationalAnalysis"
id="4ee6cb27-65ec-4bb6-aede-ab8bedf06ffc" name="Operational Analysis">
Expand Down Expand Up @@ -72,6 +77,11 @@
<ownedExtensions xsi:type="filtering:AssociatedFilteringCriterionSet"
id="e29b9987-09cb-4acb-8070-0a1abaaa7e3a" filteringCriteria="#93e1e58d-2b4c-4607-95a1-d759dbcdeaa7"/>
</ownedFunctions>
<ownedFunctions xsi:type="org.polarsys.capella.core.data.ctx:SystemFunction"
id="53f2f7d5-6d54-4106-875e-7d2a3e3fa124" name="SystemFunction 2">
<ownedExtensions xsi:type="filtering:AssociatedFilteringCriterionSet"
id="dc3dfb25-11e2-40ca-af2e-2bbf630c5788" filteringCriteria="#ffef6d25-a657-43a0-af64-160f746a8f46"/>
</ownedFunctions>
<ownedFunctionRealizations xsi:type="org.polarsys.capella.core.data.fa:FunctionRealization"
id="a852c1a0-ecc4-454e-9d9c-c93a5d8a5073" targetElement="#c8836a7a-f89f-4ec1-8bfb-488f3d47082d"
sourceElement="#df434184-a180-4480-9209-753884ec1890"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
public class FunctionalTransitionTestCase extends TopDownTransitionTestCase {
public static final String SYSTEMFUNCTION_1 = "bc18b8d1-7b7c-4a92-8ee3-85ae431c1593"; //$NON-NLS-1$
public static final String SF1_ASSOCIATED_FILTERING_CRITERION_SET = "e29b9987-09cb-4acb-8070-0a1abaaa7e3a"; //$NON-NLS-1$
public static final String SYSTEMFUNCTION_2 = "53f2f7d5-6d54-4106-875e-7d2a3e3fa124"; //$NON-NLS-1$
public static final String SF2_ASSOCIATED_FILTERING_CRITERION_SET = "dc3dfb25-11e2-40ca-af2e-2bbf630c5788";
public static final String LOGICALCOMPONENT_1 = "ccefe212-df01-4926-9d04-dcf1acdcc4bc"; //$NON-NLS-1$
public static final String LC1_ASSOCIATED_FILTERING_CRITERION_SET = "0a4ba05c-bd82-4bb2-98c6-f1736fd20299"; //$NON-NLS-1$

Expand All @@ -40,6 +42,9 @@ public void performTest() throws Exception {
EObject sf1 = getObject(SYSTEMFUNCTION_1);
performFunctionalTransition(Arrays.asList(sf1));
mustBeTransitioned(SF1_ASSOCIATED_FILTERING_CRITERION_SET);
EObject sf2 = getObject(SYSTEMFUNCTION_2);
performFunctionalTransition(Arrays.asList(sf2));
mustBeTransitioned(SF2_ASSOCIATED_FILTERING_CRITERION_SET);
EObject lc1 = getObject(LOGICALCOMPONENT_1);
performLCtoPCTransition(Arrays.asList(lc1));
mustBeTransitioned(LC1_ASSOCIATED_FILTERING_CRITERION_SET);
Expand Down

0 comments on commit 0386434

Please sign in to comment.