Search Results get_winning_rule
Overview
The APPS.CN_SCA_RULES_ONLINE_GEN_PVT package is a private (PVT classification) PL/SQL API within the Oracle E-Business Suite Incentive Compensation module. Its central business function is the generation and resolution of Sales Compensation Analyst (SCA) rules at runtime. Specifically, the package builds and evaluates the dynamic rule set that determines how transactions are credited, classified, or attributed to payees during the compensation calculation cycle.
The package was last modified under header revision 120.3 (dated 2011/08/11), consistent with the 12.1.1 and 12.2.2 code lines, and is declared AUTHID CURRENT_USER, meaning it executes with the privileges of the calling session rather than the package owner. The _PVT suffix indicates that it is an internal implementation package, not a public API exposed for customer or third-party extension. It is referenced by one other package, which typically invokes it as part of a larger processing flow.
Key Procedures and Functions
The package exposes three documented program units:
- GEN_SCA_RULES_ONLN_DYN — The primary driver procedure. It generates SCA rules in an online (runtime) context using dynamic SQL. It accepts the standard Oracle EBS API parameter set (
p_api_version,p_init_msg_list,p_commit,p_validation_level,p_org_id) and returns the standardx_return_status,x_msg_count, andx_msg_dataoutputs, plus anx_transaction_sourceoutput. This conforms to the Oracle Applications API error-handling convention. - GET_WINNING_RULE — The procedure matching the user's search term. It resolves which single rule "wins" among the candidate SCA rules that apply to a given transaction. The
spec_codeandbody_codeparameters are bothIN OUT NOCOPY, indicating the procedure refines those codes as it evaluates applicability; the transaction source governs which rule family is consulted. This is the core rule-precedence resolution logic. - CREATE_SCA_RULES_ONLINE_DYN — A boolean-returning function that constructs the dynamic rule set for a specified transaction source. The
TRUE/FALSEreturn signals success or failure of the online rule creation operation.
Tables Accessed
Through APPS synonyms, the package reads and writes the following documented tables:
- CN_SCA_RULE_ATTRIBUTES — Stores the attribute-level definition of each compensation rule; also supplies the
transaction_sourcedatatype used throughout the package. - CN_SCA_CREDIT_RULES and CN_SCA_CONDITIONS / CN_SCA_COND_DETAILS — Define the credit rules and their qualifying conditions, which
GET_WINNING_RULEevaluates to select the winning rule. - CN_OBJECTS, CN_REPOSITORIES, and CN_SOURCE — Provide metadata and source definitions used to assemble and resolve rule components dynamically.
- DBMS_APPLICATION_INFO, DBMS_SQL, PLITBLM, and USER_ERRORS — Support instrumentation, dynamic SQL execution, PL/SQL table maintenance, and error diagnostics respectively.
Usage Notes
Because this is a PVT package, it is not intended for direct invocation by customers or third-party integrations. It is ordinarily called by the parent compensation processing package (the single documented referencing package) during online credit-rule evaluation, typically triggered from Incentive Compensation forms or a compensation calculation concurrent program.
Any custom code that needs rule resolution should use the corresponding public API rather than calling GET_WINNING_RULE or the generator procedures directly, since the dynamic SQL and NOCOPY parameter semantics assume a controlled calling context. Its reliance on DBMS_SQL and PLITBLM also means runtime behavior depends on the state of the caller's session and the p_org_id supplied.
-
PACKAGE: APPS.CN_SCA_RULES_ONLINE_GEN_PVT
12.2.2
-
PACKAGE: APPS.CN_SCA_RULES_ONLINE_GEN_PVT
12.1.1
-
PACKAGE BODY: APPS.CN_SCA_RULES_ONLINE_GEN_PVT
12.1.1
-
PACKAGE BODY: APPS.CN_SCA_RULES_ONLINE_GEN_PVT
12.2.2
-
PACKAGE BODY: APPS.CN_SCA_CREDITS_ONLINE_PUB
12.1.1
-
PACKAGE BODY: APPS.CN_SCA_CREDITS_ONLINE_PUB
12.2.2
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on CN_UTILS
12.2.2
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on CN_MESSAGE_PKG
12.1.1
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on CN_UTILS
12.1.1
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on CN_MESSAGE_PKG
12.2.2
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on CN_SCA_RULE_ATTRIBUTES
12.2.2
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on CN_SCA_RULE_ATTRIBUTES
12.1.1
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on FND_MSG_PUB
12.1.1
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on FND_MSG_PUB
12.2.2
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on CN_UTILS
12.1.1
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on CN_UTILS
12.2.2
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on CN_SCA_RULE_ATTRIBUTES
12.1.1
-
APPS.CN_SCA_CREDITS_ONLINE_PUB dependencies on CN_SCA_WINNING_RULES_GTT
12.1.1
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on CN_SCA_RULE_ATTRIBUTES
12.2.2
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on FND_API
12.1.1
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on FND_API
12.2.2
-
APPS.CN_SCA_CREDITS_ONLINE_PUB dependencies on CN_SCA_WINNING_RULES_GTT
12.2.2
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on CN_OBJ_PROCEDURES_V
12.1.1
-
APPS.CN_SCA_RULES_ONLINE_GEN_PVT dependencies on CN_OBJ_PROCEDURES_V
12.2.2