Commit c2be6dee authored by Simon Barner's avatar Simon Barner
Browse files

Refactor TaskArchitecture synthesis to make it easily transferable to other target models

 - Base: af3.component[.ui]
   - IComponentArchitectureTransformation
   - ComponentArchitectureTransformationBase
   - ComponentArchitectureTransformationMenuBase
 - Specializations: af3.task[.ui]
   - ComponentToTaskArchitectureTransformation
   - TransformComponentToTaskArchitectureMenu
refs 3067
parent 82f5ad3b
......@@ -12,6 +12,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Vendor: fortiss GmbH
Export-Package: org.fortiss.af3.component.ui,
org.fortiss.af3.component.ui.behavior,
org.fortiss.af3.component.ui.commands,
org.fortiss.af3.component.ui.editor,
org.fortiss.af3.component.ui.editor.code,
org.fortiss.af3.component.ui.editor.datastate,
......
ComponentArchitectureTransformationMenuBase.java 1469a82f8c1cfdd4e501609a32351b9867eeee9d 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.component.ui.commands;
import static java.util.Collections.emptyList;
import static org.eclipse.jface.dialogs.MessageDialog.openConfirm;
import static org.fortiss.af3.project.utils.ProjectUtils.getFileProject;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstChildWithType;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.widgets.Display;
import org.fortiss.af3.allocation.model.AllocationTable;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.component.utils.IComponentArchitectureTransformation;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.tooling.base.model.element.IHierarchicElement;
import org.fortiss.tooling.base.ui.layout.auto.IAutoLayouter;
import org.fortiss.tooling.base.ui.layout.auto.KielerAutoLayouter;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.model.IProjectRootElement;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
import org.fortiss.tooling.kernel.service.IPersistencyService;
import org.fortiss.tooling.kernel.ui.extension.IContextMenuContributor;
import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider;
/**
* Base class for context menu entries to transform a {@link ComponentArchitecture} into derived
* architectures.
*
* @author barner
*/
public abstract class ComponentArchitectureTransformationMenuBase<A extends IProjectRootElement & IHierarchicElement, AE extends AllocationTable>
implements IContextMenuContributor {
/**
* Transformer used to synthesize derived architecture from given {@link ComponentArchitecture}.
*/
private IComponentArchitectureTransformation<A> compTrans;
/**
* Type of {@link AllocationTable} specialization used to define allocation betweeen given
* {@link ComponentArchitecture} and derived architecture.
*/
private Class<AE> entityAllocationTableType;
/** Constructor. */
protected ComponentArchitectureTransformationMenuBase(
IComponentArchitectureTransformation<A> compTrans, Class<AE> entityAllocationTableType) {
this.compTrans = compTrans;
this.entityAllocationTableType = entityAllocationTableType;
}
/** Returns the context menu label for this entry. */
private String getMenuLabel() {
return "Generate " + getGeneratedArchitectureTypeName();
}
/** Returns the icon that is visible in the context menu for this entry. */
protected abstract ImageDescriptor getActionIcon();
/** Returns the name of the type of generated architecture. */
protected abstract String getGeneratedArchitectureTypeName();
/** {@link Action} to execute automatic layout. */
protected class LaunchTransformComponentArchitectureAction extends Action {
/** {@link ComponentArchitecture} selected by user */
private final ComponentArchitecture ca;
/** Constructor. */
public LaunchTransformComponentArchitectureAction(ComponentArchitecture ca) {
super(getMenuLabel(), getActionIcon());
this.ca = ca;
}
/** {@inheritDoc} */
@Override
public void run() {
FileProject fileProject = getFileProject(ca);
ITopLevelElement topLevelElement =
IPersistencyService.getInstance().getTopLevelElementFor(fileProject);
topLevelElement.runAsCommand(() -> {
IElementCompositorService cs = IElementCompositorService.getInstance();
if(isDeleteExistingArchitectures(fileProject)) {
List<AllocationTable> caAllocations =
new ArrayList<AllocationTable>(getChildrenWithType(fileProject,
entityAllocationTableType));
for(AllocationTable caAlloc : caAllocations) {
cs.decompose(caAlloc.getTargetView());
cs.decompose(caAlloc);
}
}
IHierarchicElement arch = compTrans.transform(ca.getTopComponent());
IAutoLayouter al = new KielerAutoLayouter();
cs.compose(fileProject, arch, null);
al.performAutoLayout(arch);
});
}
/** Predicate whether to delete existing generated architectures. */
private boolean isDeleteExistingArchitectures(FileProject fileProject) {
boolean deleteExisting = false;
AllocationTable caAlloc = getFirstChildWithType(fileProject, entityAllocationTableType);
if(caAlloc != null && caAlloc.getSourceView() == ca && caAlloc.getTargetView() != null) {
deleteExisting =
openConfirm(
Display.getCurrent().getActiveShell(),
"Replace " + getGeneratedArchitectureTypeName() + "(s)",
"One or more " +
getGeneratedArchitectureTypeName() +
" already exist for selected Component Architecture. Hit:\n - OK to delete them.\n - Cancel to keep them and create another " +
getGeneratedArchitectureTypeName() + ".");
}
return deleteExisting;
}
}
/** {@inheritDoc} */
@Override
public List<IContributionItem> getContributedItems(EObject selection,
ContextMenuContextProvider contextProvider) {
if(!(selection instanceof ComponentArchitecture)) {
return emptyList();
}
ComponentArchitecture ca = (ComponentArchitecture)selection;
List<IContributionItem> contributionItems = new ArrayList<IContributionItem>();
contributionItems.add(new ActionContributionItem(
new LaunchTransformComponentArchitectureAction(ca)));
return contributionItems;
}
/** {@inheritDoc} */
@Override
public String getMenuSectionID() {
return null;
}
}
......@@ -9,15 +9,11 @@ Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.fortiss.af3.component.AF3ComponentActivator
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
org.fortiss.tooling.base;visibility:=reexport,
org.fortiss.af3.expression;bundle-version="2.12.0";visibility:=reexport,
Require-Bundle: org.fortiss.af3.allocation;visibility:=reexport,
org.fortiss.af3.expression;visibility:=reexport,
org.fortiss.af3.project;visibility:=reexport,
org.fortiss.tooling.kernel;visibility:=reexport,
org.fortiss.pragmatictransformation;bundle-version="2.12.0",
org.fortiss.af3.tools,
org.eclipse.jface
org.fortiss.pragmatictransformation,
org.fortiss.af3.tools
Export-Package: org.fortiss.af3.component;uses:="org.osgi.framework,org.eclipse.core.runtime",
org.fortiss.af3.component.annotation.valueprovider,
org.fortiss.af3.component.compose,
......
BehaviorModelElementFactory.java 7e4e9de4fcac3790eb0664963dd2b403db1659d0 GREEN
ComponentArchitectureTransformationBase.java a2a7e2ca461e0981ab6627c53feb84d2e766c51d YELLOW
ComponentArchitectureUtils.java 25de848ce5272d2d17408b653f0ce32a6de0038d GREEN
ComponentLibraryModelElementFactory.java 186b2e27e184cac8149ac28a28343ecd76ddf157 GREEN
ComponentLibraryUtils.java 69bb291f7c5c9fb037fcc6b938793df2b1281b26 GREEN
......@@ -8,4 +8,5 @@ ComponentProgramUtils.java ece02e69081cfdf558af7511927cd80294d2c018 GREEN
ComponentUtils.java 2cb3855a360ef58c2a49d7485d40841bc3070aa9 GREEN
FormalAnalysisTransformationUtils.java 72ea815b08d1a4ff8a0fa086902300bb3796de86 GREEN
GeneratorModelElementFactory.java e493ab2408fd1cd154960eca5cd09c1647321a7c GREEN
IComponentArchitectureTransformation.java 188583e21d0b28416c50bbae7a1b699ea570bec8 YELLOW
SimulationUtils.java 79e0c0c32a060696fd1b092b514e9881e0ab7966 GREEN
/*-------------------------------------------------------------------------+
| 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.component.utils;
import static org.fortiss.af3.allocation.utils.AllocationModelElementFactory.createAllocationTableCollection;
import static org.fortiss.af3.allocation.utils.AllocationUtils.addAllocationEntry;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.isAtomicComponent;
import static org.fortiss.af3.component.utils.ComponentUtils.getAllSubComponentsRecursively;
import static org.fortiss.af3.project.utils.ProjectUtils.getFileProject;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.getParentElement;
import static org.fortiss.tooling.kernel.utils.UniqueIDUtils.fixMissingIDs;
import java.util.List;
import java.util.stream.Collectors;
import org.eclipse.emf.common.util.EList;
import org.fortiss.af3.allocation.model.AllocationEntry;
import org.fortiss.af3.allocation.model.AllocationTable;
import org.fortiss.af3.allocation.model.AllocationTableCollection;
import org.fortiss.af3.component.model.Channel;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.component.model.InputPort;
import org.fortiss.af3.component.model.OutputPort;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.tooling.base.model.base.EntryConnectorBase;
import org.fortiss.tooling.base.model.base.ExitConnectorBase;
import org.fortiss.tooling.base.model.element.IConnection;
import org.fortiss.tooling.base.model.element.IHierarchicElement;
import org.fortiss.tooling.kernel.model.IProjectRootElement;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
/**
* Base class to transform {@link ComponentArchitecture}s into a derived architecture.
*
* @author barner
*/
public abstract class ComponentArchitectureTransformationBase<A extends IHierarchicElement & IProjectRootElement, T extends AllocationTable, E extends IHierarchicElement, I extends EntryConnectorBase, O extends ExitConnectorBase, C extends IConnection, AE extends AllocationEntry, AI extends AllocationEntry, AO extends AllocationEntry>
implements IComponentArchitectureTransformation<A> {
/** Unicode left arrow. */
protected static final String LEFT_ARROW = "\u2192";
/** {@link AllocationEntry} type for {@link Component} to target entity allocations. */
private Class<AE> entityAllocationType;
/** {@link AllocationEntry} type for {@link InputPort} to target entity input port allocations. */
private Class<AI> inputPortAllocationType;
/** {@link AllocationEntry} type for {@link OutputPort} to target entity output port allocations. */
private Class<AO> outputPortAllocationType;
/** Constructor. */
protected ComponentArchitectureTransformationBase(Class<AE> entityAllocationType,
Class<AI> inputPortAllocationType, Class<AO> outputPortAllocationType) {
this.entityAllocationType = entityAllocationType;
this.inputPortAllocationType = inputPortAllocationType;
this.outputPortAllocationType = outputPortAllocationType;
}
/** {@inheritDoc} */
@Override
public final A transform(Component topLevelComponent) {
A arch = createArchitecture(topLevelComponent);
// All atomic subcomponents
List<Component> components =
(getAllSubComponentsRecursively(topLevelComponent)).stream()
.filter(c -> isAtomicComponent(c)).collect(Collectors.toList());
ComponentArchitecture componentArchitecture =
getParentElement(topLevelComponent, ComponentArchitecture.class, false);
FileProject fileProject = getFileProject(topLevelComponent);
AllocationTableCollection atc = createAllocationTableCollection("Allocations");
T caAlloc = createAllocationTable(arch, componentArchitecture, atc);
caAlloc.setSourceView(componentArchitecture);
caAlloc.setTargetView(arch);
atc.getContainedElements().add(caAlloc);
IElementCompositorService.getInstance().compose(fileProject, atc, null);
// Create entities (including ports)
for(Component comp : components) {
E entity = createEntity(comp);
addAllocationEntry(caAlloc, entityAllocationType, comp, entity);
for(InputPort inputPort : comp.getInputPorts()) {
I entityInputPort = createInputPort(inputPort);
addAllocationEntry(caAlloc, inputPortAllocationType, inputPort, entityInputPort);
entity.getConnectors().add(entityInputPort);
}
for(OutputPort outputPort : comp.getOutputPorts()) {
O entityOutputPort = createOutputPort(outputPort);
addAllocationEntry(caAlloc, outputPortAllocationType, outputPort, entityOutputPort);
entity.getConnectors().add(entityOutputPort);
}
arch.getContainedElements().add(entity);
}
for(Component targetComp : components) {
for(InputPort inputPort : targetComp.getInputPorts()) {
if(inputPort.getIncomingChannels().isEmpty()) {
continue;
}
// An input port can only have one incoming channel
Channel channel = inputPort.getIncomingChannels().get(0);
Component sourceComp = channel.getSource().getComponent();
while(!isAtomicComponent(sourceComp)) {
EList<Channel> incomingChannels = channel.getSource().getIncomingChannels();
if(incomingChannels.isEmpty()) {
// Ignore: there is no connection in the architecture to be created.
sourceComp = null;
break;
}
// an input port can only have one incoming channel
channel = incomingChannels.get(0);
sourceComp = channel.getSource().getComponent();
}
if(sourceComp != null && components.contains(sourceComp)) {
O entityOutputPort = getOutputPort((OutputPort)channel.getSource(), caAlloc);
I entityInputPort = getInputPort(inputPort, caAlloc);
C connection = createConnection(entityOutputPort, entityInputPort);
arch.getConnections().add(connection);
}
}
}
fixMissingIDs(arch, topLevelComponent);
return arch;
}
/** Creates the derived architecture. */
protected abstract A createArchitecture(Component component);
/**
* Creates an {@link AllocationTable} specialization to map the given
* {@link ComponentArchitecture} to the generated derived architecture.
*/
protected abstract T createAllocationTable(A architecture,
ComponentArchitecture componentArchitecture, AllocationTableCollection atc);
/** Creates an entity for the given {@link Component}. */
protected abstract E createEntity(Component comp);
/** Creates an entity input port entity for the given {@link InputPort}. */
protected abstract I createInputPort(InputPort inputPort);
/** Creates an entity output port entity for the given {@link OutputPort}. */
protected abstract O createOutputPort(OutputPort outputPort);
/** Creates a connection from {@code entityOutputPort} to {@code entityInputPort}. */
protected abstract C createConnection(O entityOutputPort, I entityInputPort);
/** Retrieves the entity input port for the given {@link InputPort}. */
protected abstract I getInputPort(InputPort inputPort, T caMap);
/** Retrieves the entity output port for the given {@link OutputPort}. */
protected abstract O getOutputPort(OutputPort outputPort, T caMap);
}
/*-------------------------------------------------------------------------+
| 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.component.utils;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.tooling.base.model.element.IHierarchicElement;
import org.fortiss.tooling.kernel.model.IProjectRootElement;
/**
* Transformation to transform {@link ComponentArchitecture}s into a derived architecture.
*
* @author barner
*/
public interface IComponentArchitectureTransformation<A extends IHierarchicElement & IProjectRootElement> {
/** Transforms the atomic children of the given {@link Component} into a derived architecture. */
public abstract A transform(Component topLevelComponent);
}
......@@ -39,7 +39,7 @@ import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.project.utils.ProjectUtils;
import org.fortiss.af3.task.model.TaskArchitecture;
import org.fortiss.af3.task.util.TaskArchitectureUtils;
import org.fortiss.af3.task.util.ComponentToTaskArchitectureTransformation;
import org.fortiss.tooling.base.model.element.IConnection;
import org.fortiss.tooling.kernel.model.IIdLabeled;
import org.fortiss.tooling.kernel.utils.EcoreUtils;
......@@ -58,8 +58,9 @@ public class RoutingTest {
@Test
public void test() throws UnsupportedDataTypeException {
// Log.open("newTest");
FileProject project = ProjectUtils.loadProjectFromPlugin(
AF3ExplorationSMTActivator.PLUGIN_ID, "test-data/CONSTRAINTS3.af3_23", true);
FileProject project =
ProjectUtils.loadProjectFromPlugin(AF3ExplorationSMTActivator.PLUGIN_ID,
"test-data/CONSTRAINTS3.af3_23", true);
EList<ComponentArchitecture> cas =
EcoreUtils.getChildrenWithType(project, ComponentArchitecture.class);
......@@ -71,8 +72,8 @@ public class RoutingTest {
final PlatformArchitecture pa = pas.get(0);
EList<ExecutionUnit> ecus = EcoreUtils.getChildrenWithType(pa, ExecutionUnit.class);
components.remove(0);// remove root component
TaskArchitecture tasksArch =
TaskArchitectureUtils.transformIntoTaskArchitecture(ca.getTopComponent());
ComponentToTaskArchitectureTransformation caTrans = new ComponentToTaskArchitectureTransformation();
TaskArchitecture tasksArch = caTrans.transform(ca.getTopComponent());
// List<IConnection> channels = new ArrayList<>();
// for(Component c : components) {
// for(OutputPort o : c.getOutputPorts()) {
......@@ -83,8 +84,9 @@ public class RoutingTest {
List<SMTConstraint> constraints = new ArrayList<>();
// DeploymentRun2 run2 = new DeploymentRun2();
SMTConstraint createBasicDeploymentConstraint = BasicDeploymentConstraint
.createBasicDeploymentConstraint(tasksArch.getTasks(), ecus);
SMTConstraint createBasicDeploymentConstraint =
BasicDeploymentConstraint.createBasicDeploymentConstraint(tasksArch.getTasks(),
ecus);
// System.out.println(createBasicDeploymentConstraint + "\n");
// constraints.add(createBasicDeploymentConstraint);
......@@ -92,8 +94,9 @@ public class RoutingTest {
conn.addAll(tasksArch.getSignals());
final DSEPlatformArtifact createDsePlatformArtifact =
DSEProjectModelElementFactory.createDsePlatformArtifact(pa);
List<SMTConstraint> createBasicSignalConstraint = BasicDeploymentConstraint
.createBasicSignalConstraint(conn, createDsePlatformArtifact, null);
List<SMTConstraint> createBasicSignalConstraint =
BasicDeploymentConstraint.createBasicSignalConstraint(conn,
createDsePlatformArtifact, null);
createBasicSignalConstraint.stream().forEach(s -> System.out.println(s + "\n"));
System.out.println("--");
constraints.addAll(createBasicSignalConstraint);
......
......@@ -22,7 +22,6 @@ import static org.fortiss.af3.exploration.util.DSMLModelElementFactory.createExi
import static org.fortiss.af3.exploration.util.DSMLModelElementFactory.createForAll;
import static org.fortiss.af3.exploration.util.DSMLModelElementFactory.createModelElementLiteral;
import static org.fortiss.af3.exploration.util.DSMLModelElementFactory.createSet;
import static org.fortiss.af3.task.util.TaskArchitectureUtils.transformIntoTaskArchitecture;
import java.util.ArrayList;
import java.util.List;
......@@ -61,6 +60,7 @@ import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.task.model.Task;
import org.fortiss.af3.task.model.TaskArchitecture;
import org.fortiss.af3.task.util.ComponentToTaskArchitectureTransformation;
import org.fortiss.tooling.base.model.element.IAnnotatedSpecification;
import org.fortiss.tooling.base.model.element.IHierarchicElement;
import org.fortiss.tooling.base.model.element.IModelElement;
......@@ -87,12 +87,13 @@ public class GenerateTestBundles {
public List<TestBundle> generate(List<ComponentArchitecture> componentArchList,
List<PlatformArchitecture> platformArchList) {
List<TestBundle> toTest = new ArrayList<TestBundle>();
ComponentToTaskArchitectureTransformation caTrans = new ComponentToTaskArchitectureTransformation();
for(ComponentArchitecture ca : componentArchList) {
for(PlatformArchitecture pa : platformArchList) {
TestBundle bundle = new TestBundle();
bundle.ca = ca;
bundle.pa = DSEProjectModelElementFactory.createDsePlatformArtifact(pa);
bundle.ta = transformIntoTaskArchitecture(ca.getTopComponent());
bundle.ta = caTrans.transform(ca.getTopComponent());
bundle.pa.getVirtualLinks().addAll(RouteUtils.extractRoutes(bundle.pa));
bundle.dseSuperSets = createDseSuperSets(bundle.ta, bundle.pa);
toTest.add(bundle);
......
......@@ -31,7 +31,7 @@ import org.fortiss.af3.exploration.util.DSEProjectModelElementFactory;
import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.task.model.TaskArchitecture;
import org.fortiss.af3.task.util.TaskArchitectureUtils;
import org.fortiss.af3.task.util.ComponentToTaskArchitectureTransformation;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.service.IPersistencyService;
......@@ -82,8 +82,9 @@ public class DashboardWizard extends Wizard {
fileProject.getRootElements().add(dse);
dse.setTopLevelComponent(topComponent);
dse.setDsePlatformArchitecture(platformArchitecure);
taskArchitecture =
TaskArchitectureUtils.transformIntoTaskArchitecture(topComponent);
ComponentToTaskArchitectureTransformation caTrans =
new ComponentToTaskArchitectureTransformation();
taskArchitecture = caTrans.transform(topComponent);
fileProject.getRootElements().add(taskArchitecture);
dse.setTaskArchitecture(taskArchitecture);
TaskToPlatformDeployment deploymentRun =
......
......@@ -15,7 +15,6 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.exploration.migration;
import static org.fortiss.af3.task.util.TaskArchitectureUtils.transformIntoTaskArchitecture;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstChildWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstParentWithType;
......@@ -48,6 +47,7 @@ import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.task.model.Task;
import org.fortiss.af3.task.model.TaskAllocation;
import org.fortiss.af3.task.model.TaskArchitecture;
import org.fortiss.af3.task.util.ComponentToTaskArchitectureTransformation;
import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.tooling.kernel.extension.IMigrationProvider;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
......@@ -101,7 +101,8 @@ public class DSEMigrationProvider implements IMigrationProvider {
getFirstChildWithType(fileProject, TaskArchitecture.class);
newDSE.setTopLevelComponent(topComponent);
if(taskArchitecture == null) {
taskArchitecture = transformIntoTaskArchitecture(topComponent);
ComponentToTaskArchitectureTransformation caTrans = new ComponentToTaskArchitectureTransformation();
taskArchitecture = caTrans.transform(topComponent);