Search Results get_next_hit
Overview
SYS.DBMS_RULE is the Oracle Server rule engine package, declared with AUTHID CURRENT_USER so that rule evaluation respects the privileges of the invoking schema. It provides the runtime foundation for the Oracle Rules Manager infrastructure that underlies several E-Business Suite decision-making features, most notably the Advanced Pricing and Oracle Configurator rule evaluation paths and the generic rule-set engine used by Oracle Workflow and CRM components. In the EBS 12.1.1 and 12.2.2 architecture, DBMS_RULE is an Oracle Server-supplied package owned by SYS and exposed to the APPLSYS/APPS schema through standard synonym and grant conventions. Its central purpose is to evaluate a named rule set against a supplied context — event, table, column, variable, and attribute values — and to return the set of rules that evaluated to TRUE or MAYBE. The package does not itself store business rules; it interprets rule definitions and expressions that are persisted in the Oracle Rules Manager repository, executing them against row and column values passed by the caller. This separation allows EBS applications to define pricing, eligibility, or configuration rules declaratively while relying on DBMS_RULE to perform consistent, optimized evaluation.
Key Procedures and Functions
- EVALUATE — The primary entry point. Overloaded to support two calling conventions: one returning true_rules and maybe_rules hit lists directly, and one returning binary_integer iterators for streaming large result sets. It accepts a rule set name, an evaluation context, and optional event, table, column, variable, and attribute value lists. Flags control early termination on the first hit, restriction to simple rules, and use of the result cache.
- EVALUATE_EXPRESSION — Evaluates a single rule expression string against supplied table aliases, variable types, and the same family of value lists, returning a boolean result. This is the workhorse for ad hoc or single-condition evaluations and is often used when an application only needs to test one predicate rather than an entire rule set.
- IS_FAST — Determines whether a given expression can be evaluated using the fast evaluation path, returning a boolean. Callers use this to decide whether to route an expression through the optimized engine or fall back to a general mechanism.
- GET_NEXT_HIT — Given an iterator returned by EVALUATE, returns the next matching rule hit (sys.re$rule_hit). Used to walk large result sets incrementally.
- CLOSE_ITERATOR — Releases the resources associated with an iterator created by EVALUATE, and should always be called after iteration completes to avoid resource leaks in long-running sessions.
Tables Accessed
The package operates on rule definitions and expressions stored in the Oracle Rules Manager repository, which resides in the SYS schema (RE$ tables such as RE$RULE, RE$RULE_SET, and related metadata). It reads rule and rule-set metadata to resolve a rule_set_name, then evaluates expressions against caller-supplied values. No EBS application tables are directly referenced through APPS synonyms; all data passed for evaluation is supplied by the caller via the re$nv_list, re$table_value_list, re$column_value_list, re$variable_value_list, and re$attribute_value_list typed parameters. The package is documented as referenced by zero other packages in the ETRM snapshot, reflecting that it is a runtime service rather than a shared utility within the EBS schema graph.
Usage Notes
DBMS_RULE is typically invoked from PL/SQL application logic rather than directly through a form, since forms call the higher-level pricing, configuration, or CRM APIs that themselves wrap rule evaluation. The column_values parameter (sys.re$column_value_list) is the mechanism by which callers supply the "column_value_list" data that the rule engine compares against rule predicates — for example, pricing attributes or qualifier columns. When implementing custom rule evaluation, callers should pass only the value lists relevant to the rule set, use EVALUATE_EXPRESSION for single-condition checks, and always pair iterator-based EVALUATE calls with CLOSE_ITERATOR. The result_cache flag should be left TRUE for repeated evaluation of the same rule set with stable inputs. Because the package is AUTHID CURRENT_USER, the invoking schema must hold the necessary privileges on the underlying RE$ objects; in EBS this is normally satisfied through standard SYS grants. Customizations should avoid modifying the package definition and instead call it through supported public interfaces to preserve upgrade safety across 12.1.1 and 12.2.2.
-
PACKAGE: SYS.DBMS_RULE
12.2.2
-
PACKAGE: SYS.DBMS_RULE
12.1.1
-
SYS.DBMS_RULE dependencies on RE$VARIABLE_TYPE_LIST
12.1.1
-
SYS.DBMS_RULE dependencies on RE$TABLE_ALIAS_LIST
12.2.2
-
SYS.DBMS_RULE dependencies on RE$VARIABLE_TYPE_LIST
12.2.2
-
SYS.DBMS_RULE dependencies on RE$TABLE_ALIAS_LIST
12.1.1
-
SYS.DBMS_RULE dependencies on RE$RULE_HIT
12.1.1
-
SYS.DBMS_RULE dependencies on RE$RULE_HIT
12.2.2