@Test public void getModelSuccessCallBackMethod_DMN() { modelLocal.setSimulation(getSimulation()); modelLocal.getSettings().setType(DMN); modelLocal.getSettings().setDmnFilePath(null); scenarioSimulationEditorBusinessClientWrapper.getModelSuccessCallbackMethod(content); verify(scenarioSimulationEditorPresenterMock, times(1)).setPackageName(eq(TestProperties.FACT_PACKAGE)); verify(scenarioSimulationEditorPresenterMock, times(1)).getEventBus(); verify(versionRecordManagerMock, times(2)).getCurrentPath(); verify(importsWidgetPresenterMock, never()).setContent(any(), any(), anyBoolean()); verify(scenarioSimulationViewMock, times(1)).hideBusyIndicator(); verify(scenarioSimulationEditorPresenterMock, times(1)).getJsonModel(eq(modelLocal)); verify(scenarioSimulationEditorPresenterMock, times(1)).getModelSuccessCallbackMethod(isA(DataManagementStrategy.class), eq(modelLocal)); }
protected void getModelSuccessCallbackMethod(ScenarioSimulationModelContent content) { if (versionRecordManager.getCurrentPath() == null) { return; } scenarioSimulationEditorPresenter.setPackageName(content.getDataModel().getPackageName()); resetEditorPages(content.getOverview()); DataManagementStrategy dataManagementStrategy; if (ScenarioSimulationModel.Type.RULE.equals(content.getModel().getSettings().getType())) { dataManagementStrategy = new BusinessCentralDMODataManagementStrategy(oracleFactory); } else { dataManagementStrategy = new BusinessCentralDMNDataManagementStrategy(dmnTypeService, scenarioSimulationEditorPresenter.getEventBus()); } dataManagementStrategy.manageScenarioSimulationModelContent(versionRecordManager.getCurrentPath(), content); ScenarioSimulationModel model = content.getModel(); if (dataManagementStrategy instanceof BusinessCentralDMODataManagementStrategy) { importsWidget.setContent(((BusinessCentralDMODataManagementStrategy) dataManagementStrategy).getOracle(), model.getImports(), isReadOnly); addImportsTab(importsWidget); } baseView.hideBusyIndicator(); setOriginalHash(scenarioSimulationEditorPresenter.getJsonModel(model).hashCode()); scenarioSimulationEditorPresenter.getModelSuccessCallbackMethod(dataManagementStrategy, model); }
ScenarioSimulationEditorBusinessCentralWrapper extends KieEditor<ScenarioSimulationModel> implements ScenarioSimulationEditorWrapper { protected void getModelSuccessCallbackMethod(ScenarioSimulationModelContent content) { if (versionRecordManager.getCurrentPath() == null) { return; } scenarioSimulationEditorPresenter.setPackageName(content.getDataModel().getPackageName()); resetEditorPages(content.getOverview()); DataManagementStrategy dataManagementStrategy; if (ScenarioSimulationModel.Type.RULE.equals(content.getModel().getSettings().getType())) { dataManagementStrategy = new BusinessCentralDMODataManagementStrategy(oracleFactory); } else { dataManagementStrategy = new BusinessCentralDMNDataManagementStrategy(dmnTypeService, scenarioSimulationEditorPresenter.getEventBus()); } dataManagementStrategy.manageScenarioSimulationModelContent(versionRecordManager.getCurrentPath(), content); ScenarioSimulationModel model = content.getModel(); if (dataManagementStrategy instanceof BusinessCentralDMODataManagementStrategy) { importsWidget.setContent(((BusinessCentralDMODataManagementStrategy) dataManagementStrategy).getOracle(), model.getImports(), isReadOnly); addImportsTab(importsWidget); } baseView.hideBusyIndicator(); setOriginalHash(scenarioSimulationEditorPresenter.getJsonModel(model).hashCode()); scenarioSimulationEditorPresenter.getModelSuccessCallbackMethod(dataManagementStrategy, model); } }
ScenarioSimulationEditorBusinessCentralWrapper extends KieEditor<ScenarioSimulationModel> implements ScenarioSimulationEditorWrapper { protected void getModelSuccessCallbackMethod(ScenarioSimulationModelContent content) { if (versionRecordManager.getCurrentPath() == null) { return; } scenarioSimulationEditorPresenter.setPackageName(content.getDataModel().getPackageName()); resetEditorPages(content.getOverview()); DataManagementStrategy dataManagementStrategy; if (ScenarioSimulationModel.Type.RULE.equals(content.getModel().getSettings().getType())) { dataManagementStrategy = new BusinessCentralDMODataManagementStrategy(oracleFactory); } else { dataManagementStrategy = new BusinessCentralDMNDataManagementStrategy(dmnTypeService, scenarioSimulationEditorPresenter.getEventBus()); } dataManagementStrategy.manageScenarioSimulationModelContent(versionRecordManager.getCurrentPath(), content); ScenarioSimulationModel model = content.getModel(); if (dataManagementStrategy instanceof BusinessCentralDMODataManagementStrategy) { importsWidget.setContent(((BusinessCentralDMODataManagementStrategy) dataManagementStrategy).getOracle(), model.getImports(), isReadOnly); addImportsTab(importsWidget); } baseView.hideBusyIndicator(); setOriginalHash(scenarioSimulationEditorPresenter.getJsonModel(model).hashCode()); scenarioSimulationEditorPresenter.getModelSuccessCallbackMethod(dataManagementStrategy, model); } ScenarioSimulationEditorBusinessCentralWrapper(); @Inject  ScenarioSimulationEditorBusinessCentralWrapper(final Caller<ScenarioSimulationService> service,
                                                          final ScenarioSimulationEditorPresenter scenarioSimulationEditorPresenter,
                                                          final ImportsWidgetPresenter importsWidget,
                                                          final AsyncPackageDataModelOracleFactory oracleFactory,
                                                          final PlaceManager placeManager,
                                                          final Caller<DMNTypeService> dmnTypeService,
                                                          final Caller<ImportExportService> importExportService,
                                                          final Caller<RunnerReportService> runnerReportService,
                                                          final ScenarioSimulationBusinessCentralDocksHandler scenarioSimulationBusinessCentralDocksHandler); }
ScenarioSimulationEditorBusinessCentralWrapper extends KieEditor<ScenarioSimulationModel> implements ScenarioSimulationEditorWrapper { protected void getModelSuccessCallbackMethod(ScenarioSimulationModelContent content) { if (versionRecordManager.getCurrentPath() == null) { return; } scenarioSimulationEditorPresenter.setPackageName(content.getDataModel().getPackageName()); resetEditorPages(content.getOverview()); DataManagementStrategy dataManagementStrategy; if (ScenarioSimulationModel.Type.RULE.equals(content.getModel().getSettings().getType())) { dataManagementStrategy = new BusinessCentralDMODataManagementStrategy(oracleFactory); } else { dataManagementStrategy = new BusinessCentralDMNDataManagementStrategy(dmnTypeService, scenarioSimulationEditorPresenter.getEventBus()); } dataManagementStrategy.manageScenarioSimulationModelContent(versionRecordManager.getCurrentPath(), content); ScenarioSimulationModel model = content.getModel(); if (dataManagementStrategy instanceof BusinessCentralDMODataManagementStrategy) { importsWidget.setContent(((BusinessCentralDMODataManagementStrategy) dataManagementStrategy).getOracle(), model.getImports(), isReadOnly); addImportsTab(importsWidget); } baseView.hideBusyIndicator(); setOriginalHash(scenarioSimulationEditorPresenter.getJsonModel(model).hashCode()); scenarioSimulationEditorPresenter.getModelSuccessCallbackMethod(dataManagementStrategy, model); } ScenarioSimulationEditorBusinessCentralWrapper(); @Inject  ScenarioSimulationEditorBusinessCentralWrapper(final Caller<ScenarioSimulationService> service,
                                                          final ScenarioSimulationEditorPresenter scenarioSimulationEditorPresenter,
                                                          final ImportsWidgetPresenter importsWidget,
                                                          final AsyncPackageDataModelOracleFactory oracleFactory,
                                                          final PlaceManager placeManager,
                                                          final Caller<DMNTypeService> dmnTypeService,
                                                          final Caller<ImportExportService> importExportService,
                                                          final Caller<RunnerReportService> runnerReportService,
                                                          final ScenarioSimulationBusinessCentralDocksHandler scenarioSimulationBusinessCentralDocksHandler); @OnStartup void onStartup(final ObservablePath path,
                          final PlaceRequest place); @OnClose @Override void onClose(); @OnMayClose boolean mayClose(); @Override @WorkbenchPartTitle String getTitleText(); @Override @WorkbenchPartTitleDecoration IsWidget getTitle(); @Override @WorkbenchPartView IsWidget getWidget(); @Override @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); @Override void showDocks(); @Override void wrappedRegisterDock(String id, IsWidget widget); @Override void onImport(String fileContents, RemoteCallback<AbstractScesimModel> importCallBack, ErrorCallback<Object> importErrorCallback, AbstractScesimModel<? extends AbstractScesimData> scesimModel); @Override void onExportToCsv(RemoteCallback<String> exportCallBack, ScenarioSimulationHasBusyIndicatorDefaultErrorCallback scenarioSimulationHasBusyIndicatorDefaultErrorCallback, AbstractScesimModel<? extends AbstractScesimData> scesimModel); @Override void onDownloadReportToCsv(RemoteCallback<String> exportCallBack,
                                      ScenarioSimulationHasBusyIndicatorDefaultErrorCallback scenarioSimulationHasBusyIndicatorDefaultErrorCallback,
                                      SimulationRunMetadata simulationRunMetadata,
                                      ScenarioSimulationModel.Type modelType); @Override void hideDocks(); @Override void onRunScenario(RemoteCallback<SimulationRunResult> refreshModelCallback, ScenarioSimulationHasBusyIndicatorDefaultErrorCallback scenarioSimulationHasBusyIndicatorDefaultErrorCallback, ScesimModelDescriptor simulationDescriptor, Settings settings, List<ScenarioWithIndex> toRun, Background background); @Override Integer getOriginalHash(); @Override void addDownloadMenuItem(FileMenuBuilder fileMenuBuilder); @Override void validate(Simulation simulation, Settings settings, RemoteCallback<?> callback); @Override void onRefreshedModelContent(SimulationRunResult testResult); @Override void onEditTabSelected(); @Override void onOverviewSelected(); @Override void addBackgroundPage(final ScenarioGridWidget scenarioGridWidget); @Override void selectSimulationTab(); @Override void selectBackgroundTab(); @Override AbstractScenarioSimulationDocksHandler getScenarioSimulationDocksHandler(); @Override ScenarioSimulationEditorPresenter getScenarioSimulationEditorPresenter(); @Override void populateDocks(String identifier); }
ScenarioSimulationEditorBusinessCentralWrapper extends KieEditor<ScenarioSimulationModel> implements ScenarioSimulationEditorWrapper { protected void getModelSuccessCallbackMethod(ScenarioSimulationModelContent content) { if (versionRecordManager.getCurrentPath() == null) { return; } scenarioSimulationEditorPresenter.setPackageName(content.getDataModel().getPackageName()); resetEditorPages(content.getOverview()); DataManagementStrategy dataManagementStrategy; if (ScenarioSimulationModel.Type.RULE.equals(content.getModel().getSettings().getType())) { dataManagementStrategy = new BusinessCentralDMODataManagementStrategy(oracleFactory); } else { dataManagementStrategy = new BusinessCentralDMNDataManagementStrategy(dmnTypeService, scenarioSimulationEditorPresenter.getEventBus()); } dataManagementStrategy.manageScenarioSimulationModelContent(versionRecordManager.getCurrentPath(), content); ScenarioSimulationModel model = content.getModel(); if (dataManagementStrategy instanceof BusinessCentralDMODataManagementStrategy) { importsWidget.setContent(((BusinessCentralDMODataManagementStrategy) dataManagementStrategy).getOracle(), model.getImports(), isReadOnly); addImportsTab(importsWidget); } baseView.hideBusyIndicator(); setOriginalHash(scenarioSimulationEditorPresenter.getJsonModel(model).hashCode()); scenarioSimulationEditorPresenter.getModelSuccessCallbackMethod(dataManagementStrategy, model); } ScenarioSimulationEditorBusinessCentralWrapper(); @Inject  ScenarioSimulationEditorBusinessCentralWrapper(final Caller<ScenarioSimulationService> service,
                                                          final ScenarioSimulationEditorPresenter scenarioSimulationEditorPresenter,
                                                          final ImportsWidgetPresenter importsWidget,
                                                          final AsyncPackageDataModelOracleFactory oracleFactory,
                                                          final PlaceManager placeManager,
                                                          final Caller<DMNTypeService> dmnTypeService,
                                                          final Caller<ImportExportService> importExportService,
                                                          final Caller<RunnerReportService> runnerReportService,
                                                          final ScenarioSimulationBusinessCentralDocksHandler scenarioSimulationBusinessCentralDocksHandler); @OnStartup void onStartup(final ObservablePath path,
                          final PlaceRequest place); @OnClose @Override void onClose(); @OnMayClose boolean mayClose(); @Override @WorkbenchPartTitle String getTitleText(); @Override @WorkbenchPartTitleDecoration IsWidget getTitle(); @Override @WorkbenchPartView IsWidget getWidget(); @Override @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); @Override void showDocks(); @Override void wrappedRegisterDock(String id, IsWidget widget); @Override void onImport(String fileContents, RemoteCallback<AbstractScesimModel> importCallBack, ErrorCallback<Object> importErrorCallback, AbstractScesimModel<? extends AbstractScesimData> scesimModel); @Override void onExportToCsv(RemoteCallback<String> exportCallBack, ScenarioSimulationHasBusyIndicatorDefaultErrorCallback scenarioSimulationHasBusyIndicatorDefaultErrorCallback, AbstractScesimModel<? extends AbstractScesimData> scesimModel); @Override void onDownloadReportToCsv(RemoteCallback<String> exportCallBack,
                                      ScenarioSimulationHasBusyIndicatorDefaultErrorCallback scenarioSimulationHasBusyIndicatorDefaultErrorCallback,
                                      SimulationRunMetadata simulationRunMetadata,
                                      ScenarioSimulationModel.Type modelType); @Override void hideDocks(); @Override void onRunScenario(RemoteCallback<SimulationRunResult> refreshModelCallback, ScenarioSimulationHasBusyIndicatorDefaultErrorCallback scenarioSimulationHasBusyIndicatorDefaultErrorCallback, ScesimModelDescriptor simulationDescriptor, Settings settings, List<ScenarioWithIndex> toRun, Background background); @Override Integer getOriginalHash(); @Override void addDownloadMenuItem(FileMenuBuilder fileMenuBuilder); @Override void validate(Simulation simulation, Settings settings, RemoteCallback<?> callback); @Override void onRefreshedModelContent(SimulationRunResult testResult); @Override void onEditTabSelected(); @Override void onOverviewSelected(); @Override void addBackgroundPage(final ScenarioGridWidget scenarioGridWidget); @Override void selectSimulationTab(); @Override void selectBackgroundTab(); @Override AbstractScenarioSimulationDocksHandler getScenarioSimulationDocksHandler(); @Override ScenarioSimulationEditorPresenter getScenarioSimulationEditorPresenter(); @Override void populateDocks(String identifier);  }