Search in sources :

Example 11 with RuleConfig

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);
}
Also used : Capability(org.kie.server.controller.api.model.spec.Capability) HashMap(java.util.HashMap) ContainerSpec(org.kie.server.controller.api.model.spec.ContainerSpec) ArrayList(java.util.ArrayList) ContainerConfig(org.kie.server.controller.api.model.spec.ContainerConfig) ServerConfig(org.kie.server.controller.api.model.spec.ServerConfig) ServerTemplate(org.kie.server.controller.api.model.spec.ServerTemplate) RuleConfig(org.kie.server.controller.api.model.spec.RuleConfig)

Example 12 with RuleConfig

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));
}
Also used : RuleConfigUpdated(org.kie.server.controller.api.model.events.RuleConfigUpdated) State(org.kie.workbench.common.screens.server.management.client.util.State) RuleConfig(org.kie.server.controller.api.model.spec.RuleConfig) ContainerSpecKey(org.kie.server.controller.api.model.spec.ContainerSpecKey) Test(org.junit.Test)

Aggregations

RuleConfig (org.kie.server.controller.api.model.spec.RuleConfig)12 ServerTemplate (org.kie.server.controller.api.model.spec.ServerTemplate)9 Test (org.junit.Test)8 ProcessConfig (org.kie.server.controller.api.model.spec.ProcessConfig)8 Capability (org.kie.server.controller.api.model.spec.Capability)7 ContainerConfig (org.kie.server.controller.api.model.spec.ContainerConfig)7 ContainerSpec (org.kie.server.controller.api.model.spec.ContainerSpec)7 HashMap (java.util.HashMap)6 ServerTemplateKey (org.kie.server.controller.api.model.spec.ServerTemplateKey)4 ReleaseId (org.kie.server.api.model.ReleaseId)3 ServerInstanceKey (org.kie.server.controller.api.model.runtime.ServerInstanceKey)3 Container (org.kie.server.controller.api.model.runtime.Container)2 ServerTemplateSelected (org.kie.workbench.common.screens.server.management.client.events.ServerTemplateSelected)2 Matchers.anyString (org.mockito.Matchers.anyString)2 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)2 ArrayList (java.util.ArrayList)1 ErrorCallback (org.jboss.errai.common.client.api.ErrorCallback)1 RemoteCallback (org.jboss.errai.common.client.api.RemoteCallback)1 Before (org.junit.Before)1 RuleConfigUpdated (org.kie.server.controller.api.model.events.RuleConfigUpdated)1