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

Structural typing in executable model DSL

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • None
    • None
    • 2022 Week 05-07 (from Jan 31)
    • NEW
    • NEW

      There is already an half baked (and bugged) implementation of a structurally typed executable model version, see https://github.com/kiegroup/drools/blob/main/drools-model/drools-model-compiler/src/test/java/org/drools/modelcompiler/FactTemplateTest.java#L144 The current implementation simply ignores the declared fields, meaning that indexing also works without them while property reactivity never works and has to be fixed.

      It is required to improve the existing implementation as it follows:

      • Have a simplified executable model DSL for prototypes separated from the main one (and eventually internally invoking it)
      • Prototypes are currently backed only by Java map. There must be a pluggable mechanism to allow different implementations for instance backed by a JsonObject.
      • Prototypes must only have a name while the list of fields can be optional
      • Indexing and property reactivity will work only on declared fields
      • A field declaration doesn't require a class but only a name and the specification (a lambda) on how to extract the value of that field from a prototype instance. The name will be used by property for property reactivity while the lambda will also be automatically used for indexing

              mfusco@redhat.com Mario Fusco
              mfusco@redhat.com Mario Fusco
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: