Commit 553bff9e authored by Alexander Diewald's avatar Alexander Diewald
Browse files

DSE-CLI: Create a SolutionSelectionStep for saving exp. results

Issue-Ref: 4034
Issue-Url: https://af3-developer.fortiss.org/issues/4034

Signed-off-by: Alexander Diewald's avatarAlexander Diewald <diewald@fortiss.org>
parent 94c32956
ExecuteDSECommandLineHandler.java 3e7c93fb7476f63499e85c2fc3e364c25b1cc23a GREEN
ExecuteDSECommandLineHandler.java b46c38d3d2e5bb4026d71b4daeef359183f7c1d9 YELLOW
TestCaseGenerationCommandLineHandler.java ccd942515f5490ff9ed6ece891f3ade206333a08 GREEN
ValidateDSESolutionCommandLineInterface.java fe22edc178a4255dca54d083d3869c9142b7d304 GREEN
......@@ -18,6 +18,7 @@ package org.fortiss.af3.exploration.cli;
import static java.util.Collections.emptyList;
import static org.fortiss.af3.exploration.AF3ExplorationActivator.getDefault;
import static org.fortiss.af3.exploration.util.DSEProjectModelElementFactory.createExplorationStep;
import static org.fortiss.af3.exploration.util.DSEProjectModelElementFactory.createSolutionSelectionStep;
import static org.fortiss.af3.exploration.util.ExplorationCLIUtils.findMatchingDSEProject;
import static org.fortiss.af3.exploration.util.ExplorationCLIUtils.getExplorationTypeByArgument;
import static org.fortiss.af3.exploration.util.ExplorationModelElementFactory.createExplorationSpecification;
......@@ -43,7 +44,9 @@ import org.fortiss.af3.exploration.model.project.DSE;
import org.fortiss.af3.exploration.model.project.ExplorationStep;
import org.fortiss.af3.exploration.model.project.ProcessStep;
import org.fortiss.af3.exploration.model.project.RuleSet;
import org.fortiss.af3.exploration.model.project.SolutionSelectionStep;
import org.fortiss.af3.exploration.model.solutions.ExplorationSolution;
import org.fortiss.af3.exploration.model.solutions.SingleExplorationSolution;
import org.fortiss.af3.exploration.service.IDSEBackend;
import org.fortiss.af3.exploration.service.IDSEBackendService;
import org.fortiss.af3.project.model.FileProject;
......@@ -167,6 +170,14 @@ public final class ExecuteDSECommandLineHandler implements ICommandLineSwitchHan
IPersistencyService.getInstance().getTopLevelElementFor(dse);
prepareIDs(expStep, dse, getLargestID(dse));
modelCtx.runAsCommand(() -> dse.addProcessStep(expStep));
SolutionSelectionStep solSelStep = createSolutionSelectionStep("CLI Solution");
Optional<SingleExplorationSolution> singleSol = getFirst(result.getSolutions());
if(singleSol.isPresent()) {
solSelStep.setSelectedSolution(singleSol.get());
}
modelCtx.runAsCommand(() -> dse.addProcessStep(solSelStep));
try {
modelCtx.doSave(new NullProgressMonitor());
} catch(CoreException | IOException e) {
......@@ -180,7 +191,7 @@ public final class ExecuteDSECommandLineHandler implements ICommandLineSwitchHan
/** Creates an {@link ExplorationStep} to store the result. */
private ExplorationStep createCLIExplorationStep(ExplorationSolution result) {
ExplorationStep expStep = createExplorationStep("CLI solution", emptyList());
ExplorationStep expStep = createExplorationStep("CLI Exploration", emptyList());
expStep.setSolution(result);
ProcessStep pStep = dse.getCurrentStep();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment