diff --git a/plugins/org.polarsys.capella.filtering.transition/plugin.xml b/plugins/org.polarsys.capella.filtering.transition/plugin.xml index 3e7980ed..55cb88cf 100644 --- a/plugins/org.polarsys.capella.filtering.transition/plugin.xml +++ b/plugins/org.polarsys.capella.filtering.transition/plugin.xml @@ -147,6 +147,19 @@ + + + + + diff --git a/plugins/org.polarsys.capella.filtering.transition/src/org/polarsys/capella/filtering/transition/rules/FilteringCriterionRulePkg.java b/plugins/org.polarsys.capella.filtering.transition/src/org/polarsys/capella/filtering/transition/rules/FilteringCriterionRulePkg.java new file mode 100644 index 00000000..bed8084b --- /dev/null +++ b/plugins/org.polarsys.capella.filtering.transition/src/org/polarsys/capella/filtering/transition/rules/FilteringCriterionRulePkg.java @@ -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; + } + + +} diff --git a/tests/org.polarsys.capella.filtering.tests.ju/model/Transition/Transition.capella b/tests/org.polarsys.capella.filtering.tests.ju/model/Transition/Transition.capella index 48f7d7d2..4ae953aa 100644 --- a/tests/org.polarsys.capella.filtering.tests.ju/model/Transition/Transition.capella +++ b/tests/org.polarsys.capella.filtering.tests.ju/model/Transition/Transition.capella @@ -1,6 +1,6 @@ - + + + + @@ -72,6 +77,11 @@ + + + diff --git a/tests/org.polarsys.capella.filtering.tests.ju/src/org/polarsys/capella/filtering/tests/ju/tests/misc/transition/FunctionalTransitionTestCase.java b/tests/org.polarsys.capella.filtering.tests.ju/src/org/polarsys/capella/filtering/tests/ju/tests/misc/transition/FunctionalTransitionTestCase.java index d8e9c420..863c3f94 100644 --- a/tests/org.polarsys.capella.filtering.tests.ju/src/org/polarsys/capella/filtering/tests/ju/tests/misc/transition/FunctionalTransitionTestCase.java +++ b/tests/org.polarsys.capella.filtering.tests.ju/src/org/polarsys/capella/filtering/tests/ju/tests/misc/transition/FunctionalTransitionTestCase.java @@ -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$ @@ -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);