akmjenkins/json-schema-rules-engine

Difference between Context and Facts

Opened this issue · 0 comments

From the README it do not fully understand the difference between "facts" and "context".

In the basic example "facts" seems to be the data on which the business rules are applied. The "context" can be used to parametrize rules.
Is this correct?

Why does it state below context that "It [context] can be used for interpolation or even as a source of facts".
In this chapter it seems that context is being evaluated agains the rules. But the context object

const context = {
  hotTemp: 20,
  city: 'Halifax',
  apiKey: 'XXXX',
  units: 'metric',
};

does not seem to match the rules:

    path: 'main.temp',
    is: {
      type: 'number',
      minimum: '{{hotTemp}}',
    },