Search in sources :

Example 1 with ApplicationStarted

use of org.uberfire.commons.services.cdi.ApplicationStarted in project drools-wb by kiegroup.

the class AppSetup method assertPlayground.

@PostConstruct
public void assertPlayground() {
    try {
        configurationService.startBatch();
        // Setup mandatory properties for Drools-Workbench
        final ConfigItem<String> supportRuntimeDeployConfigItem = new ConfigItem<>();
        supportRuntimeDeployConfigItem.setName("support.runtime.deploy");
        supportRuntimeDeployConfigItem.setValue("false");
        setupConfigurationGroup(ConfigType.GLOBAL, GLOBAL_SETTINGS, getGlobalConfiguration(), supportRuntimeDeployConfigItem);
        // Setup properties required by the Work Items Editor
        setupConfigurationGroup(ConfigType.EDITOR, WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS, workbenchConfigurationHelper.getWorkItemElementDefinitions());
        // Setup test scenario properties
        // TODO : get TEST SCENARIO ELEMENT DEFINITIONS
        setupConfigurationGroup(ConfigType.EDITOR, ScenarioTestEditorService.TEST_SCENARIO_EDITOR_SETTINGS, getTestScenarioElementDefinitions());
        // notify components that bootstrap is completed to start post setups
        applicationStartedEvent.fire(new ApplicationStarted());
    } catch (final Exception e) {
        logger.error("Error during update config", e);
        throw new RuntimeException(e);
    } finally {
        configurationService.endBatch();
    }
}
Also used : ApplicationStarted(org.uberfire.commons.services.cdi.ApplicationStarted) ConfigItem(org.guvnor.structure.server.config.ConfigItem) PostConstruct(javax.annotation.PostConstruct)

Aggregations

PostConstruct (javax.annotation.PostConstruct)1 ConfigItem (org.guvnor.structure.server.config.ConfigItem)1 ApplicationStarted (org.uberfire.commons.services.cdi.ApplicationStarted)1