aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcong-bang.do2019-04-26 05:29:38 -0400
committerPhilippe DUL2019-05-09 11:49:52 -0400
commit216410e0b4ff31adc8945ce2f39ab8d66fdce47b (patch)
tree078eb4c8838bd897c7a0eb2a0a756fa2101cc731
parentc0e8ffe79b236a6b3dc0218db4a13993a9536be9 (diff)
downloadcapella-sss-transition-216410e0b4ff31adc8945ce2f39ab8d66fdce47b.zip
capella-sss-transition-216410e0b4ff31adc8945ce2f39ab8d66fdce47b.tar.gz
capella-sss-transition-216410e0b4ff31adc8945ce2f39ab8d66fdce47b.tar.bz2
[2486] Adapt Transition subsystem to 2485
Bug: 2486 Change-Id: I745c371e5e22a8e2ab9713e0bf847c71f48d7dd8 Signed-off-by: Philippe DUL <philippe.dul@thalesgroup.com> Signed-off-by: cong-bang.do <docongbang1993@gmail.com>
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem.crossphases/src/org/polarsys/capella/transition/system2subsystem/crossphases/handlers/traceability/config/SourceConfiguration.java10
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem.crossphases/src/org/polarsys/capella/transition/system2subsystem/crossphases/handlers/traceability/config/TargetConfiguration.java10
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/MultiphasesContext.java14
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/activities/InitializeMultiphasesTransformationActivity.java16
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/diffmerge/MultiphasesMatchPolicy.java3
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/handlers/traceability/config/MultiphasesSourceConfiguration.java7
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/handlers/traceability/config/MultiphasesTargetConfiguration.java6
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/handlers/traceability/config/SIDTraceabilityHandler.java7
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/launcher/LostAndFoundPass.java2
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/rules/PhysicalComponentRules.java3
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/activities/InitializeDiffMergeActivity.java14
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/activities/InitializeTransitionActivity.java20
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/handlers/traceability/config/MergeSourceConfiguration.java17
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/handlers/traceability/config/MergeTargetConfiguration.java18
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/handlers/traceability/config/TransformationConfiguration.java28
-rw-r--r--plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/rules/fa/FunctionalChainInvolvementRule.java2
16 files changed, 124 insertions, 53 deletions
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem.crossphases/src/org/polarsys/capella/transition/system2subsystem/crossphases/handlers/traceability/config/SourceConfiguration.java b/plugins/org.polarsys.capella.transition.system2subsystem.crossphases/src/org/polarsys/capella/transition/system2subsystem/crossphases/handlers/traceability/config/SourceConfiguration.java
index 65b0f25..c37c8f7 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem.crossphases/src/org/polarsys/capella/transition/system2subsystem/crossphases/handlers/traceability/config/SourceConfiguration.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem.crossphases/src/org/polarsys/capella/transition/system2subsystem/crossphases/handlers/traceability/config/SourceConfiguration.java
@@ -20,6 +20,7 @@ import org.polarsys.capella.core.model.helpers.BlockArchitectureExt;
import org.polarsys.capella.core.model.helpers.SystemEngineeringExt;
import org.polarsys.capella.core.transition.common.constants.ITransitionConstants;
import org.polarsys.capella.core.transition.system.handlers.traceability.ReconciliationTraceabilityHandler;
+import org.polarsys.capella.core.transition.system.helpers.ContextHelper;
import org.polarsys.capella.transition.system2subsystem.handlers.traceability.config.MergeSourceConfiguration;
import org.polarsys.kitalpha.transposer.rules.handler.rules.api.IContext;
@@ -49,11 +50,10 @@ public class SourceConfiguration extends MergeSourceConfiguration {
* {@inheritDoc}
*/
@Override
- protected void initializeRootMappings(IContext context_p) {
- super.initializeRootMappings(context_p);
- EObject source = (EObject) context_p.get(ITransitionConstants.TRANSFORMATION_SOURCE_ROOT);
- EObject target = (EObject) context_p.get(ITransitionConstants.TRANSFORMATION_TARGET_ROOT);
- addMappings(source, target, context_p);
+ protected void initializeRootMappings(IContext context) {
+ super.initializeRootMappings(context);
+ addMappings(ContextHelper.getSourceProject(context), ContextHelper.getTransformedProject(context), context);
+ addMappings(ContextHelper.getSourceEngineering(context), ContextHelper.getTransformedEngineering(context), context);
}
}
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem.crossphases/src/org/polarsys/capella/transition/system2subsystem/crossphases/handlers/traceability/config/TargetConfiguration.java b/plugins/org.polarsys.capella.transition.system2subsystem.crossphases/src/org/polarsys/capella/transition/system2subsystem/crossphases/handlers/traceability/config/TargetConfiguration.java
index 9f8c52f..993d61b 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem.crossphases/src/org/polarsys/capella/transition/system2subsystem/crossphases/handlers/traceability/config/TargetConfiguration.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem.crossphases/src/org/polarsys/capella/transition/system2subsystem/crossphases/handlers/traceability/config/TargetConfiguration.java
@@ -25,6 +25,7 @@ import org.polarsys.capella.core.model.helpers.SystemEngineeringExt;
import org.polarsys.capella.core.transition.common.constants.ITransitionConstants;
import org.polarsys.capella.core.transition.common.handlers.traceability.ITraceabilityHandler;
import org.polarsys.capella.core.transition.system.handlers.traceability.ReconciliationTraceabilityHandler;
+import org.polarsys.capella.core.transition.system.helpers.ContextHelper;
import org.polarsys.capella.transition.system2subsystem.handlers.traceability.SIDTraceabilityHandler;
import org.polarsys.capella.transition.system2subsystem.handlers.traceability.config.MergeTargetConfiguration;
import org.polarsys.kitalpha.transposer.rules.handler.rules.api.IContext;
@@ -83,11 +84,10 @@ public class TargetConfiguration extends MergeTargetConfiguration {
* {@inheritDoc}
*/
@Override
- protected void initializeRootMappings(IContext context_p) {
- super.initializeRootMappings(context_p);
- EObject source = (EObject) context_p.get(ITransitionConstants.TRANSITION_SOURCE_ROOT);
- EObject target = (EObject) context_p.get(ITransitionConstants.TRANSITION_TARGET_ROOT);
- addMappings(source, target, context_p);
+ protected void initializeRootMappings(IContext context) {
+ super.initializeRootMappings(context);
+ addMappings(ContextHelper.getSourceProject(context), ContextHelper.getTargetProject(context), context);
+ addMappings(ContextHelper.getSourceEngineering(context), getTargetEngineering(context), context);
}
}
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/MultiphasesContext.java b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/MultiphasesContext.java
index 2fa5ce2..f97ff61 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/MultiphasesContext.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/MultiphasesContext.java
@@ -15,6 +15,8 @@ import java.util.Collection;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.polarsys.capella.core.data.capellacore.ModellingArchitecture;
+import org.polarsys.capella.core.data.capellamodeller.ModelRoot;
+import org.polarsys.capella.core.data.capellamodeller.Project;
import org.polarsys.capella.core.data.capellamodeller.SystemEngineering;
import org.polarsys.capella.core.data.cs.BlockArchitecture;
import org.polarsys.capella.core.data.ctx.CtxPackage;
@@ -24,8 +26,11 @@ import org.polarsys.capella.core.data.la.LogicalArchitecture;
import org.polarsys.capella.core.data.pa.PaPackage;
import org.polarsys.capella.core.data.pa.PhysicalArchitecture;
import org.polarsys.capella.core.data.pa.PhysicalComponent;
+import org.polarsys.capella.core.data.sharedmodel.SharedPkg;
+import org.polarsys.capella.core.model.helpers.SystemEngineeringExt;
import org.polarsys.capella.core.transition.common.constants.ITransitionConstants;
import org.polarsys.capella.core.transition.common.context.TransitionContext;
+import org.polarsys.capella.core.transition.system.helpers.ContextHelper;
import org.polarsys.capella.transition.system2subsystem.crossphases.handlers.attachment.CrossPhasesAttachmentHelper;
public class MultiphasesContext extends TransitionContext {
@@ -140,7 +145,12 @@ public Collection<? extends PhysicalComponent> getSelectedPhysicalComponents() {
* @return the SystemEngineering of the temporary model
*/
public SystemEngineering getTempSystemEngineering() {
- return (SystemEngineering) get(ITransitionConstants.TRANSFORMATION_TARGET_ROOT);
+ for (ModelRoot root: ContextHelper.getTransformedProject(this).getOwnedModelRoots()) {
+ if (root instanceof SystemEngineering && !(root instanceof SharedPkg)) {
+ return (SystemEngineering)root;
+ }
+ }
+ return null;
}
/**
@@ -168,7 +178,7 @@ public Collection<? extends PhysicalComponent> getSelectedPhysicalComponents() {
* @return the SystemEngineering of the source model
*/
public SystemEngineering getSourceSystemEngineering() {
- return (SystemEngineering) get(ITransitionConstants.TRANSFORMATION_SOURCE_ROOT);
+ return SystemEngineeringExt.getSystemEngineering((Project) get(ITransitionConstants.TRANSFORMATION_SOURCE_ROOT));
}
/**
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/activities/InitializeMultiphasesTransformationActivity.java b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/activities/InitializeMultiphasesTransformationActivity.java
index aa3ba14..df0a1b0 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/activities/InitializeMultiphasesTransformationActivity.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/activities/InitializeMultiphasesTransformationActivity.java
@@ -34,11 +34,13 @@ import org.polarsys.capella.core.model.handler.command.CapellaResourceHelper;
import org.polarsys.capella.core.model.helpers.CapellaElementExt;
import org.polarsys.capella.core.platform.sirius.ui.project.operations.ProjectSessionCreationHelper;
import org.polarsys.capella.core.sirius.ui.helper.SessionHelper;
+import org.polarsys.capella.core.transition.common.constants.ISchemaConstants;
import org.polarsys.capella.core.transition.common.constants.ITransitionConstants;
import org.polarsys.capella.core.transition.common.handlers.IHandler;
import org.polarsys.capella.core.transition.common.handlers.traceability.ITraceabilityHandler;
+import org.polarsys.capella.core.transition.common.handlers.traceability.config.ExtendedTraceabilityConfiguration;
import org.polarsys.capella.core.transition.system.activities.InitializeTransformationActivity;
-import org.polarsys.capella.core.transition.system.handlers.traceability.config.TransformationConfiguration;
+import org.polarsys.capella.core.transition.system.handlers.traceability.ReconciliationTraceabilityHandler;
import org.polarsys.capella.transition.system2subsystem.activities.FinalizeSubsystemTransitionActivity;
import org.polarsys.capella.transition.system2subsystem.multiphases.handlers.traceability.config.RecTraceabilityHandler;
import org.polarsys.capella.transition.system2subsystem.multiphases.handlers.traceability.config.SIDTraceabilityHandler;
@@ -50,9 +52,14 @@ public final class InitializeMultiphasesTransformationActivity extends Initializ
@Override
protected IHandler createDefaultTraceabilityTransformationHandler() {
- TransformationConfiguration configuration = new TransformationConfiguration() {
+ ExtendedTraceabilityConfiguration configuration = new ExtendedTraceabilityConfiguration() {
@Override
+ protected String getExtensionIdentifier(IContext context) {
+ return ISchemaConstants.TRANSFORMATION_TRACEABILITY_CONFIGURATION;
+ }
+
+ @Override
protected void initHandlers(IContext fContext_p) {
addHandler(fContext_p, new SIDTraceabilityHandler(getIdentifier(fContext_p)));
addHandler(fContext_p, new RecTraceabilityHandler());
@@ -80,7 +87,7 @@ public final class InitializeMultiphasesTransformationActivity extends Initializ
if (context_p.get(ITransitionConstants.DIFFMERGE_DISABLE) == Boolean.TRUE) {
// elements are created directly in the target model
Project project = (Project) CapellaElementExt.getRoot((CapellaElement) targetResource_p.getContents().get(0));
- result = project.getOwnedModelRoots().get(0);
+ result = project;
} else {
// Create a temporary project and reload its model through the target editing domain
@@ -91,10 +98,9 @@ public final class InitializeMultiphasesTransformationActivity extends Initializ
new ProjectSessionCreationHelper(true, true).createFullProject(temporaryProjectName, null, Collections.<IProject> emptyList(),
ViewpointSelection.getViewpoints(CapellaResourceHelper.CAPELLA_MODEL_FILE_EXTENSION), new NullProgressMonitor());
Project project = SessionHelper.getCapellaProject(session);
- SystemEngineering engineering = (SystemEngineering) project.getOwnedModelRoots().get(0);
session.close(new NullProgressMonitor());
result =
- ((EditingDomain) context_p.get(ITransitionConstants.TRANSITION_TARGET_EDITING_DOMAIN)).getResourceSet().getEObject(EcoreUtil.getURI(engineering),
+ ((EditingDomain) context_p.get(ITransitionConstants.TRANSITION_TARGET_EDITING_DOMAIN)).getResourceSet().getEObject(EcoreUtil.getURI(project),
true);
context_p.put(FinalizeSubsystemTransitionActivity.PARAM__DELETE_PROJECT, ResourcesPlugin.getWorkspace().getRoot().getProject(temporaryProjectName));
} catch (InvocationTargetException exception_p) {
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/diffmerge/MultiphasesMatchPolicy.java b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/diffmerge/MultiphasesMatchPolicy.java
index 60ed583..6f25f1e 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/diffmerge/MultiphasesMatchPolicy.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/diffmerge/MultiphasesMatchPolicy.java
@@ -142,7 +142,7 @@ public class MultiphasesMatchPolicy implements IMatchPolicy {
public MultiphasesMatchPolicy() {
Collection<ENamedElement> uniqueKeys =
- Arrays.asList(CapellamodellerPackage.Literals.PROJECT, LaPackage.Literals.LOGICAL_ARCHITECTURE, PaPackage.Literals.PHYSICAL_ARCHITECTURE,
+ Arrays.asList(CapellamodellerPackage.Literals.PROJECT, CapellamodellerPackage.Literals.SYSTEM_ENGINEERING, LaPackage.Literals.LOGICAL_ARCHITECTURE, PaPackage.Literals.PHYSICAL_ARCHITECTURE,
CtxPackage.Literals.SYSTEM_ANALYSIS, OaPackage.Literals.OPERATIONAL_ANALYSIS, EpbsPackage.Literals.EPBS_ARCHITECTURE,
OaPackage.Literals.OPERATIONAL_ANALYSIS__OWNED_CONCEPT_PKG, OaPackage.Literals.OPERATIONAL_ANALYSIS__OWNED_ENTITY_PKG,
OaPackage.Literals.OPERATIONAL_ANALYSIS__OWNED_OPERATIONAL_CONTEXT, OaPackage.Literals.OPERATIONAL_ANALYSIS__OWNED_ROLE_PKG,
@@ -162,6 +162,7 @@ public class MultiphasesMatchPolicy implements IMatchPolicy {
matchIDs.put(o, EcoreUtil.getURI(o).toString());
}
+
Collection<EClass> allBlockArchitectures =
Arrays.asList(OaPackage.Literals.OPERATIONAL_ANALYSIS, CtxPackage.Literals.SYSTEM_ANALYSIS, LaPackage.Literals.LOGICAL_ARCHITECTURE,
PaPackage.Literals.PHYSICAL_ARCHITECTURE, EpbsPackage.Literals.EPBS_ARCHITECTURE);
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/handlers/traceability/config/MultiphasesSourceConfiguration.java b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/handlers/traceability/config/MultiphasesSourceConfiguration.java
index 7974c8e..57f7d6a 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/handlers/traceability/config/MultiphasesSourceConfiguration.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/handlers/traceability/config/MultiphasesSourceConfiguration.java
@@ -20,7 +20,9 @@ import org.polarsys.capella.core.model.helpers.BlockArchitectureExt;
import org.polarsys.capella.core.model.helpers.SystemEngineeringExt;
import org.polarsys.capella.core.transition.common.constants.ITransitionConstants;
import org.polarsys.capella.core.transition.system.handlers.traceability.ReconciliationTraceabilityHandler;
+import org.polarsys.capella.core.transition.system.helpers.ContextHelper;
import org.polarsys.capella.transition.system2subsystem.handlers.traceability.config.MergeSourceConfiguration;
+import org.polarsys.capella.transition.system2subsystem.multiphases.MultiphasesContext;
import org.polarsys.kitalpha.transposer.rules.handler.rules.api.IContext;
@@ -52,9 +54,8 @@ public class MultiphasesSourceConfiguration extends MergeSourceConfiguration {
@Override
protected void initializeRootMappings(IContext context_p) {
super.initializeRootMappings(context_p);
- EObject source = (EObject) context_p.get(ITransitionConstants.TRANSFORMATION_SOURCE_ROOT);
- EObject target = (EObject) context_p.get(ITransitionConstants.TRANSFORMATION_TARGET_ROOT);
- addMappings(source, target, context_p);
+ addMappings(ContextHelper.getSourceProject(context_p), ContextHelper.getTransformedProject(context_p), context_p);
+ addMappings(ContextHelper.getSourceEngineering(context_p), ((MultiphasesContext)context_p).getTempSystemEngineering(), context_p);
}
}
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/handlers/traceability/config/MultiphasesTargetConfiguration.java b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/handlers/traceability/config/MultiphasesTargetConfiguration.java
index 4928897..292d296 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/handlers/traceability/config/MultiphasesTargetConfiguration.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/handlers/traceability/config/MultiphasesTargetConfiguration.java
@@ -25,6 +25,7 @@ import org.polarsys.capella.core.model.helpers.SystemEngineeringExt;
import org.polarsys.capella.core.transition.common.constants.ITransitionConstants;
import org.polarsys.capella.core.transition.common.handlers.traceability.ITraceabilityHandler;
import org.polarsys.capella.core.transition.system.handlers.traceability.ReconciliationTraceabilityHandler;
+import org.polarsys.capella.core.transition.system.helpers.ContextHelper;
import org.polarsys.capella.transition.system2subsystem.handlers.traceability.config.MergeTargetConfiguration;
import org.polarsys.kitalpha.transposer.rules.handler.rules.api.IContext;
@@ -84,9 +85,8 @@ public class MultiphasesTargetConfiguration extends MergeTargetConfiguration {
@Override
protected void initializeRootMappings(IContext context_p) {
super.initializeRootMappings(context_p);
- EObject source = (EObject) context_p.get(ITransitionConstants.TRANSITION_SOURCE_ROOT);
- EObject target = (EObject) context_p.get(ITransitionConstants.TRANSITION_TARGET_ROOT);
- addMappings(source, target, context_p);
+ addMappings(ContextHelper.getSourceProject(context_p), ContextHelper.getTargetProject(context_p), context_p);
+ addMappings(ContextHelper.getSourceEngineering(context_p), getTargetEngineering(context_p), context_p);
}
}
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/handlers/traceability/config/SIDTraceabilityHandler.java b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/handlers/traceability/config/SIDTraceabilityHandler.java
index c77801a..31b6e3b 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/handlers/traceability/config/SIDTraceabilityHandler.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/handlers/traceability/config/SIDTraceabilityHandler.java
@@ -12,6 +12,8 @@ package org.polarsys.capella.transition.system2subsystem.multiphases.handlers.tr
import org.eclipse.emf.ecore.EObject;
import org.polarsys.capella.core.transition.common.constants.ITransitionConstants;
+import org.polarsys.capella.core.transition.system.helpers.ContextHelper;
+import org.polarsys.capella.transition.system2subsystem.multiphases.MultiphasesContext;
import org.polarsys.kitalpha.transposer.rules.handler.rules.api.IContext;
public class SIDTraceabilityHandler extends org.polarsys.capella.transition.system2subsystem.handlers.traceability.SIDTraceabilityHandler {
@@ -26,9 +28,8 @@ public class SIDTraceabilityHandler extends org.polarsys.capella.transition.syst
@Override
protected void initializeRootMappings(IContext context_p) {
super.initializeRootMappings(context_p);
- EObject source = (EObject) context_p.get(ITransitionConstants.TRANSFORMATION_SOURCE_ROOT);
- EObject target = (EObject) context_p.get(ITransitionConstants.TRANSFORMATION_TARGET_ROOT);
- initializeMappings(source, target, context_p);
+ addMappings(ContextHelper.getSourceProject(context_p), ContextHelper.getTransformedProject(context_p), context_p);
+ addMappings(ContextHelper.getSourceEngineering(context_p), ((MultiphasesContext)context_p).getTempSystemEngineering(), context_p);
}
}
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/launcher/LostAndFoundPass.java b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/launcher/LostAndFoundPass.java
index 10b5959..e9a989f 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/launcher/LostAndFoundPass.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/launcher/LostAndFoundPass.java
@@ -34,7 +34,7 @@ import org.polarsys.kitalpha.emde.model.ElementExtension;
*/
public class LostAndFoundPass {
- private static final String PACKAGE_NAME = "Lost+Found"; //$NON-NLS-1$
+ public static final String PACKAGE_NAME = "Lost+Found"; //$NON-NLS-1$
/**
* @param lostAndFoundPackage_p
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/rules/PhysicalComponentRules.java b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/rules/PhysicalComponentRules.java
index d300f33..5e2a7e1 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/rules/PhysicalComponentRules.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem.multiphases/src/org/polarsys/capella/transition/system2subsystem/multiphases/rules/PhysicalComponentRules.java
@@ -59,7 +59,8 @@ public class PhysicalComponentRules {
return TransformationHandlerHelper.getInstance(context_p).getBestTracedElement(sourceContainer, context_p, sContext);
}
- SystemEngineering eng = (SystemEngineering) context_p.get(ITransitionConstants.TRANSFORMATION_TARGET_ROOT);
+ MultiphasesContext context = (MultiphasesContext) context_p;
+ SystemEngineering eng = context.getTempSystemEngineering();
LogicalArchitecture la = eng.getContainedLogicalArchitectures().get(0);
return BlockArchitectureExt.getFirstComponent(la);
}
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/activities/InitializeDiffMergeActivity.java b/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/activities/InitializeDiffMergeActivity.java
index 72f4d09..3d9bdbb 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/activities/InitializeDiffMergeActivity.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/activities/InitializeDiffMergeActivity.java
@@ -14,9 +14,13 @@ import org.eclipse.core.runtime.IStatus;
import org.polarsys.capella.core.data.cs.CsPackage;
import org.polarsys.capella.core.data.fa.FaPackage;
import org.polarsys.capella.core.data.interaction.InteractionPackage;
+import org.polarsys.capella.core.transition.common.handlers.IHandler;
import org.polarsys.capella.core.transition.common.handlers.merge.IMergeHandler;
+import org.polarsys.capella.core.transition.common.handlers.traceability.CompoundTraceabilityHandler;
import org.polarsys.capella.core.transition.system.topdown.handlers.merge.RealizationLinkCategoryFilter;
import org.polarsys.capella.transition.system2subsystem.handlers.filter.UpdateOfCategoryFilter;
+import org.polarsys.capella.transition.system2subsystem.handlers.traceability.config.MergeSourceConfiguration;
+import org.polarsys.capella.transition.system2subsystem.handlers.traceability.config.MergeTargetConfiguration;
import org.polarsys.kitalpha.cadence.core.api.parameter.ActivityParameters;
import org.polarsys.kitalpha.transposer.rules.handler.rules.api.IContext;
@@ -37,4 +41,14 @@ public class InitializeDiffMergeActivity extends org.polarsys.capella.core.trans
return super.initializeCategoriesHandlers(context, handler, activityParams);
}
+ @Override
+ protected IHandler createDefaultTraceabilitySourceHandler(IContext context) {
+ return new CompoundTraceabilityHandler(new MergeSourceConfiguration());
+ }
+
+ @Override
+ protected IHandler createDefaultTraceabilityTargetHandler(IContext context) {
+ return new CompoundTraceabilityHandler(new MergeTargetConfiguration());
+ }
+
}
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/activities/InitializeTransitionActivity.java b/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/activities/InitializeTransitionActivity.java
index 1c29157..dacecfa 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/activities/InitializeTransitionActivity.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/activities/InitializeTransitionActivity.java
@@ -31,6 +31,7 @@ import org.polarsys.capella.core.transition.common.handlers.scope.CompoundScopeF
import org.polarsys.capella.core.transition.common.handlers.scope.CompoundScopeRetriever;
import org.polarsys.capella.core.transition.common.handlers.scope.IScopeFilter;
import org.polarsys.capella.core.transition.common.handlers.scope.IScopeRetriever;
+import org.polarsys.capella.core.transition.common.handlers.traceability.CompoundTraceabilityHandler;
import org.polarsys.capella.core.transition.system.handlers.attachment.CapellaDefaultAttachmentHandler;
import org.polarsys.capella.transition.system2subsystem.constants.ISubSystemConstants;
import org.polarsys.capella.transition.system2subsystem.handlers.attachment.FunctionalChainAttachmentHelper;
@@ -42,6 +43,8 @@ import org.polarsys.capella.transition.system2subsystem.handlers.scope.PropertyV
import org.polarsys.capella.transition.system2subsystem.handlers.scope.RequirementsScopeFilter;
import org.polarsys.capella.transition.system2subsystem.handlers.scope.RequirementsScopeRetriever;
import org.polarsys.capella.transition.system2subsystem.handlers.session.SubSystemSessionHandler;
+import org.polarsys.capella.transition.system2subsystem.handlers.traceability.config.MergeSourceConfiguration;
+import org.polarsys.capella.transition.system2subsystem.handlers.traceability.config.TransformationConfiguration;
import org.polarsys.kitalpha.cadence.core.api.parameter.ActivityParameters;
import org.polarsys.kitalpha.transposer.rules.handler.rules.api.IContext;
@@ -70,15 +73,15 @@ public class InitializeTransitionActivity extends org.polarsys.capella.core.tran
}
@Override
- protected Collection<Object> adaptSelection(Collection<Object> selection) {
- Collection<Object> superCollection = super.adaptSelection(selection);
- Collection<Object> result = new ArrayList<Object>();
+ protected Collection<EObject> adaptSelection(Collection<Object> selection) {
+ Collection<EObject> superCollection = super.adaptSelection(selection);
+ Collection<EObject> result = new ArrayList<EObject>();
for (Object item : superCollection) {
if (item instanceof EObject) {
if (item instanceof Part) {
item = ((Part) item).getAbstractType();
}
- result.add(item);
+ result.add((EObject)item);
}
}
return result;
@@ -134,9 +137,7 @@ public class InitializeTransitionActivity extends org.polarsys.capella.core.tran
outputResource = targetDomain.getResourceSet().getResource(fileUri, true);
context.put(ITransitionConstants.TRANSITION_TARGET_RESOURCE, outputResource);
-
- Project project = (Project) outputResource.getContents().get(0);
- context.put(ITransitionConstants.TRANSITION_TARGET_ROOT, getEngineering(project, project.getName()));
+ context.put(ITransitionConstants.TRANSITION_TARGET_ROOT, outputResource.getContents().get(0));
return Status.OK_STATUS;
}
@@ -166,5 +167,10 @@ public class InitializeTransitionActivity extends org.polarsys.capella.core.tran
}
};
}
+
+ @Override
+ protected IHandler createDefaultTraceabilityTargetHandler() {
+ return new CompoundTraceabilityHandler(new TransformationConfiguration());
+ }
}
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/handlers/traceability/config/MergeSourceConfiguration.java b/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/handlers/traceability/config/MergeSourceConfiguration.java
index 9217931..17eb9f1 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/handlers/traceability/config/MergeSourceConfiguration.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/handlers/traceability/config/MergeSourceConfiguration.java
@@ -10,17 +10,23 @@
*******************************************************************************/
package org.polarsys.capella.transition.system2subsystem.handlers.traceability.config;
+import java.util.Collection;
+
import org.eclipse.emf.ecore.EObject;
+import org.polarsys.capella.core.data.capellacore.CapellaElement;
+import org.polarsys.capella.core.data.capellamodeller.Project;
import org.polarsys.capella.core.data.capellamodeller.SystemEngineering;
import org.polarsys.capella.core.data.cs.BlockArchitecture;
import org.polarsys.capella.core.data.cs.Component;
import org.polarsys.capella.core.model.helpers.BlockArchitectureExt;
+import org.polarsys.capella.core.model.helpers.SystemEngineeringExt;
import org.polarsys.capella.core.transition.common.constants.ISchemaConstants;
import org.polarsys.capella.core.transition.common.constants.ITransitionConstants;
import org.polarsys.capella.core.transition.common.handlers.traceability.ITraceabilityHandler;
import org.polarsys.capella.core.transition.common.handlers.traceability.config.ExtendedTraceabilityConfiguration;
import org.polarsys.capella.core.transition.system.handlers.traceability.RealizationLinkTraceabilityHandler;
import org.polarsys.capella.core.transition.system.handlers.traceability.ReconciliationTraceabilityHandler;
+import org.polarsys.capella.core.transition.system.helpers.ContextHelper;
import org.polarsys.capella.transition.system2subsystem.handlers.traceability.SIDTraceabilityHandler;
import org.polarsys.kitalpha.transposer.rules.handler.rules.api.IContext;
@@ -61,9 +67,8 @@ public class MergeSourceConfiguration extends ExtendedTraceabilityConfiguration
@Override
protected void initializeRootMappings(IContext context_p) {
super.initializeRootMappings(context_p);
- EObject source = (EObject) context_p.get(ITransitionConstants.TRANSFORMATION_SOURCE_ROOT);
- EObject target = (EObject) context_p.get(ITransitionConstants.TRANSFORMATION_TARGET_ROOT);
- addMappings(source, target, context_p);
+ addMappings(ContextHelper.getSourceProject(context_p), ContextHelper.getTransformedProject(context_p), context_p);
+ addMappings(ContextHelper.getSourceEngineering(context_p), ContextHelper.getTransformedEngineering(context_p), context_p);
}
}
@@ -82,9 +87,7 @@ public class MergeSourceConfiguration extends ExtendedTraceabilityConfiguration
@Override
protected void initializeRootMappings(IContext context_p) {
super.initializeRootMappings(context_p);
- EObject source = (EObject) context_p.get(ITransitionConstants.TRANSFORMATION_SOURCE_ROOT);
- EObject target = (EObject) context_p.get(ITransitionConstants.TRANSFORMATION_TARGET_ROOT);
- initializeMappings(source, target, context_p);
+ initializeMappings(ContextHelper.getSourceProject(context_p), ContextHelper.getTransformedProject(context_p), context_p);
}
}
@@ -96,7 +99,7 @@ public class MergeSourceConfiguration extends ExtendedTraceabilityConfiguration
protected String getExtensionIdentifier(IContext context_p) {
return ISchemaConstants.SOURCE_TRACEABILITY_CONFIGURATION;
}
-
+
@Override
protected void initHandlers(IContext fContext_p) {
addHandler(fContext_p, new SourceReconciliationTraceabilityHandler(getIdentifier(fContext_p)));
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/handlers/traceability/config/MergeTargetConfiguration.java b/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/handlers/traceability/config/MergeTargetConfiguration.java
index c8e1828..763bcf2 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/handlers/traceability/config/MergeTargetConfiguration.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/handlers/traceability/config/MergeTargetConfiguration.java
@@ -10,18 +10,26 @@
*******************************************************************************/
package org.polarsys.capella.transition.system2subsystem.handlers.traceability.config;
+import java.util.Collection;
+
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.polarsys.capella.core.data.capellacore.CapellaElement;
+import org.polarsys.capella.core.data.capellamodeller.Library;
+import org.polarsys.capella.core.data.capellamodeller.Project;
import org.polarsys.capella.core.data.capellamodeller.SystemEngineering;
import org.polarsys.capella.core.data.cs.BlockArchitecture;
import org.polarsys.capella.core.data.cs.Component;
import org.polarsys.capella.core.data.information.Partition;
import org.polarsys.capella.core.model.helpers.BlockArchitectureExt;
+import org.polarsys.capella.core.model.helpers.SystemEngineeringExt;
import org.polarsys.capella.core.transition.common.constants.ISchemaConstants;
import org.polarsys.capella.core.transition.common.constants.ITransitionConstants;
import org.polarsys.capella.core.transition.common.handlers.traceability.ITraceabilityHandler;
import org.polarsys.capella.core.transition.common.handlers.traceability.config.ExtendedTraceabilityConfiguration;
import org.polarsys.capella.core.transition.system.handlers.traceability.RealizationLinkTraceabilityHandler;
import org.polarsys.capella.core.transition.system.handlers.traceability.ReconciliationTraceabilityHandler;
+import org.polarsys.capella.core.transition.system.helpers.ContextHelper;
import org.polarsys.capella.transition.system2subsystem.handlers.traceability.SIDTraceabilityHandler;
import org.polarsys.kitalpha.transposer.rules.handler.rules.api.IContext;
@@ -66,9 +74,8 @@ public class MergeTargetConfiguration extends ExtendedTraceabilityConfiguration
@Override
protected void initializeRootMappings(IContext context_p) {
super.initializeRootMappings(context_p);
- EObject source = (EObject) context_p.get(ITransitionConstants.TRANSITION_SOURCE_ROOT);
- EObject target = (EObject) context_p.get(ITransitionConstants.TRANSITION_TARGET_ROOT);
- addMappings(source, target, context_p);
+ addMappings(ContextHelper.getSourceProject(context_p), ContextHelper.getTargetProject(context_p), context_p);
+ addMappings(ContextHelper.getSourceEngineering(context_p), getTargetEngineering(context_p), context_p);
}
}
@@ -94,6 +101,11 @@ public class MergeTargetConfiguration extends ExtendedTraceabilityConfiguration
}
+ public static EObject getTargetEngineering(IContext context) {
+ //In Transition Subsystem, target engineering is the one on the subsystem project.
+ return SystemEngineeringExt.getSystemEngineering(ContextHelper.getTargetProject(context));
+ }
+
/**
* {@inheritDoc}
*/
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/handlers/traceability/config/TransformationConfiguration.java b/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/handlers/traceability/config/TransformationConfiguration.java
index 3d3d182..e6aee0e 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/handlers/traceability/config/TransformationConfiguration.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/handlers/traceability/config/TransformationConfiguration.java
@@ -10,14 +10,23 @@
*******************************************************************************/
package org.polarsys.capella.transition.system2subsystem.handlers.traceability.config;
+import java.util.Collection;
+
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.polarsys.capella.core.data.capellacore.CapellaElement;
+import org.polarsys.capella.core.data.capellamodeller.Library;
+import org.polarsys.capella.core.data.capellamodeller.Project;
+import org.polarsys.capella.core.data.capellamodeller.SystemEngineering;
import org.polarsys.capella.core.data.cs.Component;
+import org.polarsys.capella.core.model.helpers.SystemEngineeringExt;
import org.polarsys.capella.core.transition.common.constants.ISchemaConstants;
import org.polarsys.capella.core.transition.common.constants.ITransitionConstants;
import org.polarsys.capella.core.transition.common.handlers.traceability.ITraceabilityHandler;
import org.polarsys.capella.core.transition.common.handlers.traceability.config.ExtendedTraceabilityConfiguration;
import org.polarsys.capella.core.transition.system.handlers.traceability.ReconciliationTraceabilityHandler;
+import org.polarsys.capella.core.transition.system.helpers.ContextHelper;
import org.polarsys.capella.transition.system2subsystem.handlers.traceability.SIDTraceabilityHandler;
import org.polarsys.kitalpha.transposer.rules.handler.rules.api.IContext;
@@ -46,9 +55,8 @@ public class TransformationConfiguration extends ExtendedTraceabilityConfigurati
@Override
protected void initializeRootMappings(IContext context_p) {
super.initializeRootMappings(context_p);
- EObject source = (EObject) context_p.get(ITransitionConstants.TRANSFORMATION_SOURCE_ROOT);
- EObject target = (EObject) context_p.get(ITransitionConstants.TRANSFORMATION_TARGET_ROOT);
- addMappings(source, target, context_p);
+ addMappings(ContextHelper.getSourceProject(context_p), ContextHelper.getTransformedProject(context_p), context_p);
+ addMappings(ContextHelper.getSourceEngineering(context_p), ContextHelper.getTransformedEngineering(context_p), context_p);
}
});
@@ -61,9 +69,7 @@ public class TransformationConfiguration extends ExtendedTraceabilityConfigurati
@Override
protected void initializeRootMappings(IContext context_p) {
super.initializeRootMappings(context_p);
- EObject source = (EObject) context_p.get(ITransitionConstants.TRANSFORMATION_SOURCE_ROOT);
- EObject target = (EObject) context_p.get(ITransitionConstants.TRANSFORMATION_TARGET_ROOT);
- initializeMappings(source, target, context_p);
+ initializeMappings(ContextHelper.getSourceProject(context_p), ContextHelper.getTransformedProject(context_p), context_p);
}
@Override
@@ -79,6 +85,16 @@ public class TransformationConfiguration extends ExtendedTraceabilityConfigurati
});
}
+
+ public SystemEngineering getSourceEngineering(IContext context) {
+ Collection<EObject> selection = (Collection<EObject>) context.get(ITransitionConstants.TRANSITION_SOURCES);
+ if (!selection.isEmpty()) {
+ EObject sourceSelection = (EObject) selection.toArray()[0];
+ return SystemEngineeringExt.getSystemEngineering((CapellaElement)sourceSelection);
+ }
+ return null;
+ }
+
/**
* {@inheritDoc}
diff --git a/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/rules/fa/FunctionalChainInvolvementRule.java b/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/rules/fa/FunctionalChainInvolvementRule.java
index 180324e..6d116b2 100644
--- a/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/rules/fa/FunctionalChainInvolvementRule.java
+++ b/plugins/org.polarsys.capella.transition.system2subsystem/src/org/polarsys/capella/transition/system2subsystem/rules/fa/FunctionalChainInvolvementRule.java
@@ -268,7 +268,7 @@ public class FunctionalChainInvolvementRule extends org.polarsys.capella.core.tr
}
if (res == null) {
- res = FaFactory.eINSTANCE.createFunctionalChainInvolvement();
+ res = FaFactory.eINSTANCE.createFunctionalChainInvolvementLink();
res.setSid(id);
}