Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-5107

A rule always fires with executable model for a constraint which has extra parentheses

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.34.0.Final
    • 7.33.0.Final
    • executable model
    • None
    • 2020 Week 07-09 (from Feb 10)
    • 3
    • Hide

      See unit test PR

      Show
      See unit test PR
    • NEW
    • NEW

      When you have a constraint with extra parentheses,

      $p : Person((age > 30))
      

      executable-model generates a pattern without a constraint expr method so it always fires.

          public static org.drools.model.Rule rule_R() {
              final org.drools.model.Variable<org.drools.modelcompiler.domain.Person> var_$p = D.declarationOf(org.drools.modelcompiler.domain.Person.class, DomainClassesMetadataFBDA1ED637C8B60C741C0BDB502EB8F0.org_drools_modelcompiler_domain_Person_Metadata_INSTANCE, "$p");
              org.drools.model.Rule rule = D.rule("R").build(D.pattern(var_$p),
                                                             D.execute(() -> {
                                                                 {
                                                                 }
                                                             }));
              return rule;
          }
      

              rhn-support-tkobayas Toshiya Kobayashi
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: