The context in which a rule is called, as well as the context in which the rule terms are evaluated within a rule, will have a significant impact on the resulting processing of the rule and rule terms. The context of a rule definition describes where the rule is being used within the application at run time. The context is set by the definition referencing the rule within the application project and that calls the rule at run time. Included in the context of a rule’s usage are the definition referencing the rule, the data type expected to be returned by the caller of the rule, data definitions such as objects, transactions, properties, and others that are in scope when the rule is called and how other data definitions are related to those within the application’s overall data structure.
In addition to the caller of the rule, each function within the rule definition will also have an impact on the context, specifically on those rule terms passed to the function as parameters. A given function can dictate the context of the terms used as its parameters including what data definitions are in scope and what data type is expected of the term being evaluated as a function parameter.
To define the term more precisely, context is the way in which a rule and its terms are called and that affects the behavior, data types, and target path resolution when that rule is evaluated at run time. Context plays a role in the evaluation of each term within a rule, including function terms, data terms , and sub-rule terms.