use of org.guvnor.structure.server.config.ConfigItem in project drools-wb by kiegroup.
the class ConfigWorkDefinitionsLoader method loadWorkDefinitions.
public Map<String, WorkDefinition> loadWorkDefinitions() {
// Find all configured WIDs
final Map<String, WorkDefinition> workDefinitions = new HashMap<String, WorkDefinition>();
final List<ConfigGroup> configGroups = configurationService.getConfiguration(ConfigType.EDITOR);
if (configGroups == null || configGroups.isEmpty()) {
return workDefinitions;
}
// Load configured WIDs
final List<String> definitions = new ArrayList<String>();
for (ConfigGroup configGroup : configGroups) {
if (WorkItemsEditorService.WORK_ITEM_DEFINITION.equals(configGroup.getName())) {
for (ConfigItem configItem : configGroup.getItems()) {
definitions.add(configGroup.getConfigItemValue(configItem.getName()));
}
}
}
// Parse MVEL expressions into model
workDefinitions.putAll(WorkDefinitionsParser.parse(definitions));
return workDefinitions;
}
use of org.guvnor.structure.server.config.ConfigItem in project drools-wb by kiegroup.
the class WorkItemsEditorServiceImpl method loadWorkItemDefinitionElements.
Map<String, String> loadWorkItemDefinitionElements() {
final Map<String, String> workItemDefinitionElements = new HashMap<String, String>();
final List<ConfigGroup> editorConfigGroups = configurationService.getConfiguration(ConfigType.EDITOR);
for (ConfigGroup editorConfigGroup : editorConfigGroups) {
if (WORK_ITEMS_EDITOR_SETTINGS.equals(editorConfigGroup.getName())) {
for (ConfigItem item : editorConfigGroup.getItems()) {
final String itemName = item.getName();
final String itemValue = editorConfigGroup.getConfigItemValue(itemName);
workItemDefinitionElements.put(itemName, itemValue);
}
}
}
return workItemDefinitionElements;
}
use of org.guvnor.structure.server.config.ConfigItem in project drools-wb by kiegroup.
the class AppSetup method getTestScenarioElementDefinitions.
private ConfigGroup getTestScenarioElementDefinitions() {
final ConfigGroup group = configurationFactory.newConfigGroup(ConfigType.EDITOR, ScenarioTestEditorService.TEST_SCENARIO_EDITOR_SETTINGS, "");
ConfigItem<Integer> configItem = new ConfigItem<Integer>();
configItem.setName(ScenarioTestEditorService.TEST_SCENARIO_EDITOR_MAX_RULE_FIRINGS);
configItem.setValue(10000);
group.addConfigItem(configItem);
return group;
}
use of org.guvnor.structure.server.config.ConfigItem 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();
}
}
Aggregations