Skip to content
Kyle Knoepfel edited this page Dec 22, 2021 · 5 revisions

Logic engine configuration

  1. Remove support for multiple logic engines; only one is needed.

  2. Remove need for module, name, and parameters names in the configuration. The following configuration should be sufficient:

    logic_engine: {
      facts: {
        f1: "val > 14"
      },
      rules: {
        r1: {
          expression: "val",
          actions: ["publisher"]  
        }
      }
    }
  3. Long-term: There is an awkward entanglement between the publishers configurations and that of the logic_engine--specifically, the publishers to be executed need to be specified (to some degree) in both types of configurations. As a longer-term solution, I recommend the following change:

    Current Suggested
    {
      sources: {...},
      transforms: {...},
      logicengines: {
        le: {
          module: 'decisionengine.framework.logicengine.LogicEngine',
          name: 'LogicEngine',
          parameters: {
            facts: {
              f1: "val > 14"
            },
            rules: {
              r1: {
                expression: "val",
                actions: ["p1"]
                false_actions: ["p2"]
              }
            }
          }
        }
      },
      publishers: {
        p1: {...}
        p2: {...}
      }
    }
    local val_big_enough = "val > 14";
    {
      sources: {...},
      transforms: {...},
      publishers: {
        p1: {
          run_if: val_big_enough
        },
        p2: {
          run_unless: val_big_enough
        }
      }
    }