Search in sources :

Example 1 with BusinessCentralDMODataManagementStrategy

use of org.drools.workbench.screens.scenariosimulation.businesscentral.client.editor.strategies.BusinessCentralDMODataManagementStrategy in project drools-wb by kiegroup.

the class ScenarioSimulationEditorBusinessCentralWrapper method getModelSuccessCallbackMethod.

protected void getModelSuccessCallbackMethod(ScenarioSimulationModelContent content) {
    // Path is set to null when the Editor is closed (which can happen before async calls complete).
    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();
    scenarioSimulationEditorPresenter.getModelSuccessCallbackMethod(dataManagementStrategy, model);
    setOriginalHash(scenarioSimulationEditorPresenter.getJsonModel(model).hashCode());
}
Also used : AbstractDMODataManagementStrategy(org.drools.workbench.screens.scenariosimulation.client.editor.strategies.AbstractDMODataManagementStrategy) BusinessCentralDMODataManagementStrategy(org.drools.workbench.screens.scenariosimulation.businesscentral.client.editor.strategies.BusinessCentralDMODataManagementStrategy) DataManagementStrategy(org.drools.workbench.screens.scenariosimulation.client.editor.strategies.DataManagementStrategy) BusinessCentralDMNDataManagementStrategy(org.drools.workbench.screens.scenariosimulation.businesscentral.client.editor.strategies.BusinessCentralDMNDataManagementStrategy) BusinessCentralDMNDataManagementStrategy(org.drools.workbench.screens.scenariosimulation.businesscentral.client.editor.strategies.BusinessCentralDMNDataManagementStrategy) BusinessCentralDMODataManagementStrategy(org.drools.workbench.screens.scenariosimulation.businesscentral.client.editor.strategies.BusinessCentralDMODataManagementStrategy) ScenarioSimulationModel(org.drools.scenariosimulation.api.model.ScenarioSimulationModel)

Aggregations

ScenarioSimulationModel (org.drools.scenariosimulation.api.model.ScenarioSimulationModel)1 BusinessCentralDMNDataManagementStrategy (org.drools.workbench.screens.scenariosimulation.businesscentral.client.editor.strategies.BusinessCentralDMNDataManagementStrategy)1 BusinessCentralDMODataManagementStrategy (org.drools.workbench.screens.scenariosimulation.businesscentral.client.editor.strategies.BusinessCentralDMODataManagementStrategy)1 AbstractDMODataManagementStrategy (org.drools.workbench.screens.scenariosimulation.client.editor.strategies.AbstractDMODataManagementStrategy)1 DataManagementStrategy (org.drools.workbench.screens.scenariosimulation.client.editor.strategies.DataManagementStrategy)1