use of org.kie.server.controller.api.model.spec.RuleConfig in project kie-wb-common by kiegroup.
the class NewServerTemplateWizard method buildServerTemplate.
private ServerTemplate buildServerTemplate() {
final Collection<String> capabilities = new ArrayList<String>();
final Map<Capability, ServerConfig> capabilityConfig = new HashMap<Capability, ServerConfig>();
final Map<Capability, ContainerConfig> capabilityContainerConfig = new HashMap<Capability, ContainerConfig>();
final Collection<ContainerSpec> containersSpec = new ArrayList<ContainerSpec>();
if (newTemplatePresenter.isProcessCapabilityChecked()) {
capabilities.add(Capability.PROCESS.toString());
if (!newContainerFormPresenter.isEmpty()) {
capabilityContainerConfig.put(Capability.PROCESS, processConfigPagePresenter.buildProcessConfig());
}
}
capabilityContainerConfig.put(Capability.RULE, new RuleConfig(null, KieScannerStatus.STOPPED));
if (newTemplatePresenter.isRuleCapabilityChecked()) {
capabilities.add(Capability.RULE.toString());
}
if (newTemplatePresenter.isPlanningCapabilityChecked()) {
capabilities.add(Capability.PLANNING.toString());
}
if (!newContainerFormPresenter.isEmpty()) {
containersSpec.add(newContainerFormPresenter.buildContainerSpec(newTemplatePresenter.getTemplateName(), capabilityContainerConfig));
}
return new ServerTemplate(newTemplatePresenter.getTemplateName(), newTemplatePresenter.getTemplateName(), capabilities, capabilityConfig, containersSpec);
}
use of org.kie.server.controller.api.model.spec.RuleConfig in project kie-wb-common by kiegroup.
the class ContainerRulesConfigPresenterTest method testOnConfigUpdateNoUpdate.
@Test
public void testOnConfigUpdateNoUpdate() {
final RuleConfigUpdated ruleConfigUpdated = new RuleConfigUpdated();
ruleConfigUpdated.setContainerSpecKey(new ContainerSpecKey());
ruleConfigUpdated.setRuleConfig(new RuleConfig());
presenter.setup(containerSpec, ruleConfig);
presenter.onConfigUpdate(ruleConfigUpdated);
verify(view).setContent(anyString(), anyString(), any(State.class), any(State.class), any(State.class), any(State.class));
}
Aggregations