Categories of facts - GetcuReone/FactFactory GitHub Wiki

Categories of facts

Just facts

The most common facts you use. Needed to store basic information.

  • Must be inherited from IFact
  • FactBase - default implementation.

Special facts

Facts that carry some additional information that is not directly related to the main one. For example, the time of the request for facts. The most common use of them is to extend the functionality of the library. And their peculiarity is that they cannot be calculated by the rule. They need to be placed in a container without using the rules.

BuildCondition facts

Quite an interesting category of facts.

  • This category of facts cannot be added to the container yourself
  • After calculating all the facts you requested, you also will not find these facts in the container
  • These facts exist only during the execution of your request

This category of facts determines the possibility of executing one or another instruction when constructing a decision tree in accordance with a condition. For example, the following facts now come with the factory:

  • BuildContained - A command with such a fact can be run only if the fact, the type of which is specified as generic, is contained in the container when the decision tree was built.
  • BuildNotContained - A command with such a fact can be run only if the fact, the type of which is specified as generic, is not contained in the container when the decision tree was built.
  • BuildCanDerived - A command with such a fact can be run only if the fact, the type of which is specified as universal, can be calculated and output with the current set of facts when the decision tree was built.
  • BuildCannotDerived - A command with such a fact can be run only if the fact, the type of which is specified as universal, cannot be calculated and output with the current set of facts when the decision tree was built.

Also: