use of org.drools.scenariosimulation.api.model.ScenarioSimulationModel in project drools-wb by kiegroup.
the class ScenarioSimulationContextTest method getScenarioSimulationModel.
@Test
public void getScenarioSimulationModel() {
ScenarioSimulationModel model = scenarioSimulationContextLocal.getScenarioSimulationModel();
assertSame(scenarioSimulationModelMock, model);
}
use of org.drools.scenariosimulation.api.model.ScenarioSimulationModel in project drools-wb by kiegroup.
the class ScenarioSimulationEditorBusinessCentralWrapper method save.
@Override
protected void save(final String commitMessage) {
synchronizeColumnsDimension(scenarioSimulationEditorPresenter.getContext().getScenarioGridPanelByGridWidget(GridWidget.SIMULATION), scenarioSimulationEditorPresenter.getContext().getScenarioGridPanelByGridWidget(GridWidget.BACKGROUND));
final ScenarioSimulationModel model = scenarioSimulationEditorPresenter.getModel();
RemoteCallback<Path> saveSuccessCallback = getSaveSuccessCallback(scenarioSimulationEditorPresenter.getJsonModel(model).hashCode());
service.call(saveSuccessCallback, new HasBusyIndicatorDefaultErrorCallback(scenarioSimulationEditorPresenter.getView())).save(versionRecordManager.getCurrentPath(), model, metadata, commitMessage);
}
use of org.drools.scenariosimulation.api.model.ScenarioSimulationModel in project drools-wb by kiegroup.
the class NewScenarioSimulationHandler method create.
@Override
public void create(final Package pkg, final String baseFileName, final NewResourcePresenter presenter) {
if (!sourceTypeSelector.validate()) {
return;
}
final ScenarioSimulationModel.Type selectedType = sourceTypeSelector.getSelectedType();
String value;
switch(selectedType) {
case DMN:
value = uploadWidget.getSelectedPath();
break;
case RULE:
default:
value = null;
}
busyIndicatorView.showBusyIndicator(CommonConstants.INSTANCE.Saving());
CustomBusyPopup.showMessage(CommonConstants.INSTANCE.Saving());
scenarioSimulationService.call(getSuccessCallback(presenter), new ScenarioSimulationHasBusyIndicatorDefaultErrorCallback(busyIndicatorView)).create(pkg.getPackageTestResourcesPath(), buildFileName(baseFileName, resourceType), new ScenarioSimulationModel(), "", selectedType, value);
}
use of org.drools.scenariosimulation.api.model.ScenarioSimulationModel in project drools-wb by kiegroup.
the class ScenarioSimulationServiceImplTest method save.
@Test
public void save() {
final Path returnPath = service.save(this.path, new ScenarioSimulationModel(), new Metadata(), "Commit comment");
assertNotNull(returnPath);
verify(ioServiceMock).write(any(org.uberfire.java.nio.file.Path.class), anyString(), anyMap(), any());
}
use of org.drools.scenariosimulation.api.model.ScenarioSimulationModel in project drools-wb by kiegroup.
the class ScenarioSimulationServiceImplTest method createDMNScenario.
@Test
public void createDMNScenario() {
doReturn(false).when(ioServiceMock).exists(any());
ScenarioSimulationModel model = new ScenarioSimulationModel();
assertNull(model.getSimulation());
assertNull(model.getBackground());
assertNull(model.getSettings());
final Path returnPath = service.create(this.path, "test.scesim", model, "Commit comment", Type.DMN, "test");
assertNotNull(returnPath);
assertNotNull(model.getSimulation());
assertNotNull(model.getBackground());
assertNotNull(model.getSettings());
verify(ioServiceMock, times(2)).write(any(org.uberfire.java.nio.file.Path.class), anyString(), any());
}
Aggregations