protected void declareRule(final KiePMMLDroolsRule rule) {
        logger.trace("declareRule {}", rule);
        final RuleDescrBuilder ruleBuilder = builder.newRule().name(rule.getName());
        if (rule.getAgendaGroup() != null) {
            declareAgendaGroup(ruleBuilder, rule.getAgendaGroup());
        }
        if (rule.getActivationGroup() != null) {
            declareActivationGroup(ruleBuilder, rule.getActivationGroup());
        }
        KiePMMLDescrLhsFactory.factory(ruleBuilder.lhs()).declareLhs(rule);
        KiePMMLDescrRhsFactory.factory(ruleBuilder).declareRhs(rule);
    }
@Test
    void declareRule() {
        String name = "NAME";
        String statusToSet = "STATUS_TO_SET";
        String patternType = "TEMPERATURE";
        String agendaGroup = "agendaGroup";
        String activationGroup = "activationGroup";
        List<KiePMMLFieldOperatorValue> orConstraints = Arrays.asList(new KiePMMLFieldOperatorValue(patternType, BOOLEAN_OPERATOR.OR, Collections.singletonList(new KiePMMLOperatorValue(OPERATOR.LESS_THAN, 35)), null),
                new KiePMMLFieldOperatorValue(patternType, BOOLEAN_OPERATOR.AND, Collections.singletonList(new KiePMMLOperatorValue(OPERATOR.GREATER_THAN, 85)), null));
        KiePMMLDroolsRule rule = KiePMMLDroolsRule.builder(name, statusToSet, Collections.emptyList())
                .withAgendaGroup(agendaGroup)
                .withActivationGroup(activationGroup)
                .withOrConstraints(orConstraints)
                .build();
        KiePMMLDescrRulesFactory.factory(builder).declareRule(rule);
        assertThat(builder.getDescr().getRules()).isNotNull();
        assertThat(builder.getDescr().getRules()).hasSize(1);
        final RuleDescr retrieved = builder.getDescr().getRules().get(0);
        assertThat(retrieved.getName()).isEqualTo(name);
        assertThat(retrieved.getAttributes()).hasSize(2);
        assertThat(retrieved.getAttributes()).containsKey("agenda-group");
        assertThat(retrieved.getAttributes().get("agenda-group").getValue()).isEqualTo(agendaGroup);
        assertThat(retrieved.getAttributes()).containsKey("activation-group");
        assertThat(retrieved.getAttributes().get("activation-group").getValue()).isEqualTo(activationGroup);
    }