-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GAIAPLAT-1205] Do not fire a rule if the anchor row is invalid #882
Changes from 5 commits
3f2e6c7
0e820c8
4d806a1
16ebd81
ecf3b7a
a031b9c
ceee285
c12ca68
fc1fd85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,19 +12,46 @@ namespace rules | |
{ | ||
|
||
/** | ||
* This helper class interfaces with the catalog to verify rule subscriptions. | ||
* This class is invoked when the user calls the subscribe_rule API. | ||
* | ||
* Post Q2 this functionality may be moved to the catalog manager so that other code can | ||
* also use it. | ||
*/ | ||
* This helper class is used by the rules engine at both rule | ||
* subscription and invocation time. Currently, the class performs | ||
* the following checks. | ||
* | ||
* Catalog Checks: | ||
* Ensure tables and fields that are referenced in a rule are | ||
* actually present in the catalog at rule subscription time. | ||
* | ||
* Database Checks: | ||
* Ensure that an anchor row is valid before invoking a rule. | ||
* | ||
* Note that the checks can be disabled by unit tests that do not want | ||
* to have a dependency on the database. These tests can intialize | ||
* the rules engine with custom settings. See event_manager_settings.hpp | ||
* and rules_test_helpers.hpp for more information. | ||
*/ | ||
class rule_checker_t | ||
{ | ||
public: | ||
// By default, enable all checks. | ||
rule_checker_t() | ||
: rule_checker_t(true, true) | ||
{ | ||
} | ||
|
||
rule_checker_t(bool enable_catalog_checks, bool enable_db_checks) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you comment on what these checks are actually doing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the following to the class header:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great! |
||
: m_enable_catalog_checks(enable_catalog_checks) | ||
, m_enable_db_checks(enable_db_checks) | ||
{ | ||
} | ||
|
||
void check_catalog(common::gaia_type_t type, const common::field_position_list_t& field_list); | ||
bool is_valid_row(common::gaia_id_t row_id); | ||
|
||
private: | ||
void check_fields(common::gaia_id_t id, const common::field_position_list_t& field_list); | ||
|
||
private: | ||
bool m_enable_catalog_checks; | ||
bool m_enable_db_checks; | ||
}; | ||
|
||
} // namespace rules | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to determine what user-facing documentation that needs to be provided.
Does affect a rule as it processes and forward chaining?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two important messages:
One way for an anchor row to be invalidated is the following sequence events: