DBA Data[Home] [Help]

PACKAGE: APPS.AMS_METRIC_PUB

Source


1 PACKAGE AMS_Metric_PUB AS
2 /* $Header: amspmtcs.pls 120.1 2005/06/27 05:39:12 appldev ship $ */
3 /*#
4  * This package provides methods to create marketing metrics.  Note:
5  * The metric record type is used as an input parameter to create a metric.
6  *
7  * PACKAGE AMS_METRIC_PVT
8  * TYPE metric_rec_type
9  * IS RECORD (
10  *        metric_id                          NUMBER,
11  *        last_update_date                  DATE,
12  *        last_updated_by                   NUMBER,
13  *        creation_date                     DATE,
14  *        created_by                        NUMBER,
15  *        last_update_login                 NUMBER,
16  *        object_version_number             NUMBER,
17  *        application_id                    NUMBER,
18  *        arc_metric_used_for_object        VARCHAR2(30),
19  *        metric_calculation_type           VARCHAR2(30),
20  *        metric_category                   NUMBER,
21  *        accrual_type                      VARCHAR2(30),
22  *        value_type                        VARCHAR2(30),
23  *        sensitive_data_flag               VARCHAR2(1),
24  *        enabled_flag                      VARCHAR2(1),
25  *        metric_sub_category               NUMBER,
26  *        function_name                     VARCHAR2(4000),
27  *        metric_parent_id                  NUMBER,
28  *        summary_metric_id                 NUMBER,
29  *        compute_using_function            VARCHAR2(4000),
30  *        default_uom_code                  VARCHAR2(3),
31  *        uom_type                          VARCHAR2(10),
32  *        formula                           VARCHAR2(4000),
33  *        metrics_name                      VARCHAR2(120),
34  *        description                       VARCHAR2(4000),
35  *        formula_display                   VARCHAR2(4000),
36  *        hierarchy_id                      NUMBER,
37  *        set_function_name                 VARCHAR2(4000),
38  *        display_type                      VARCHAR2(30)
39  *     );
40  * @rep:scope public
41  * @rep:product AMS
42  * @rep:displayname Oracle Marketing Metrics Definition Public API
43  * @rep:lifecycle active
44  * @rep:compatibility S
45  * @rep:category BUSINESS_ENTITY AMS_CAMPAIGN
46  */
47 
48 ---------------------------------------------------------------------
49 -- PROCEDURE
50 --    Create_Metric
51 --
52 -- PURPOSE
53 --    Create a new Metric.
54 --
55 -- PARAMETERS
56 --    p_metric_rec: the new record to be inserted
57 --    x_metric_id: return the metric_id of the new metrics
58 --
59 -- NOTES
60 --    1. object_version_number will be set to 1.
61 --    2. If Metric_id is passed in, the uniqueness will be checked.
62 --       Raise exception in case of duplicates.
63 --    3. If Metric_id is not passed in, generate a unique one from
64 --       the sequence.
65 --    4. If a flag column is passed in, check if it is 'Y' or 'N'.
66 --       Raise exception for invalid flag.
67 --    5. If a flag column is not passed in, default it to 'Y' or 'N'.
68 --    6. Please don't pass in any FND_API.g_mess_char/num/date.
69 ---------------------------------------------------------------------
70 /*#
71  * This procedure creates a marketing metric.  The details of the metric will
72  * be passed in the p_metric_rec record.  Check x_return_status output to
73  * see if the creation was successful.  If successful an unique identifier
74  * for the metric will be passed back to the x_metric_id output parameter.
75  * @param p_api_version    This must match the version number of the API.  An
76  *                         unxpected error is returned if the calling program
77  *                         version number is incompatible with the current API
78  *                         version number.
79  * @param p_init_msg_list  Flag to indicate if the message stack should be
80  *                         initialized.
81  * @param p_commit         Flag to indicate if the changes should be committed
82  *                         on success.
83  * @param p_validation_level Level of validation required.  None: No validation
84  *                         will be performed.  Full: Item and record level
85  *                         validation will be performed.
86  * @param x_return_status  Indicates the return status of the API.  The values
87  *                         are one of the following: FND_API.G_RET_SUCCESS:
88  *                         Indicates the API call was successful,
89  *                         FND_API.G_RET_ERROR: Indicates an error has occured,
90  *                         FND_API.G_RET_UNEXPECTED: Indications an unexpected
91  *                         error has occured.
92  * @param x_msg_count      Count of the number of error messages in the list.
93  * @param x_msg_data       Error message returned by the API.  If more than
94  *                         one message is returned, this parameter is null and
95  *                         messages can be extracted from the message stack.
96  * @param p_metric_rec     Record of type AMS_METRIC_PVT.METRIC_REC_TYPE that
97  *                         tacks the details of the Metric.
98  * @param x_metric_id      Unique identifier for the newly created Metric.
99  * @rep:scope public
100  * @rep:displayname Create Metrics Definition
101  * @rep:lifecycle active
102  */
103 PROCEDURE Create_Metric(
104    p_api_version       IN  NUMBER,
105    p_init_msg_list     IN  VARCHAR2  := FND_API.g_false,
106    p_commit            IN  VARCHAR2  := FND_API.g_false,
107    p_validation_level  IN  NUMBER    := FND_API.g_valid_level_full,
108 
109    x_return_status     OUT NOCOPY VARCHAR2,
110    x_msg_count         OUT NOCOPY NUMBER,
111    x_msg_data          OUT NOCOPY VARCHAR2,
112 
113    p_metric_rec        IN  AMS_Metric_PVT.metric_rec_type,
114    x_metric_id         OUT NOCOPY NUMBER
115 );
116 
117 
118 --------------------------------------------------------------------
119 -- PROCEDURE
120 --    Delete_Metric
121 --
122 -- PURPOSE
123 --    Delete a Metric.
124 --
125 -- PARAMETERS
126 --    p_metric_id: the Metric_id
127 --    p_object_version: the object_version_number
128 --
129 -- NOTES
130 --    1. Raise exception if the object_version_number doesn't match.
131 --------------------------------------------------------------------
132 PROCEDURE Delete_Metric(
133    p_api_version       IN  NUMBER,
134    p_init_msg_list     IN  VARCHAR2 := FND_API.g_false,
135    p_commit            IN  VARCHAR2 := FND_API.g_false,
136 
137    x_return_status     OUT NOCOPY VARCHAR2,
138    x_msg_count         OUT NOCOPY NUMBER,
139    x_msg_data          OUT NOCOPY VARCHAR2,
140 
141    p_metric_id         IN  NUMBER,
142    p_object_version    IN  NUMBER
143 );
144 
145 
146 -------------------------------------------------------------------
147 -- PROCEDURE
148 --    Lock_Metric
149 --
150 -- PURPOSE
151 --    Lock a Metric.
152 --
153 -- PARAMETERS
154 --    p_Metric_id: the Metric_id
155 --    p_object_version: the object_version_number
156 --
157 -- NOTES
158 --    1. Raise exception if the object_version_number doesn't match.
159 --------------------------------------------------------------------
160 PROCEDURE Lock_Metric(
161    p_api_version       IN  NUMBER,
162    p_init_msg_list     IN  VARCHAR2 := FND_API.g_false,
163 
164    x_return_status     OUT NOCOPY VARCHAR2,
165    x_msg_count         OUT NOCOPY NUMBER,
166    x_msg_data          OUT NOCOPY VARCHAR2,
167 
168    p_Metric_id         IN  NUMBER,
169    p_object_version    IN  NUMBER
170 );
171 
172 
173 ---------------------------------------------------------------------
174 -- PROCEDURE
175 --    update_Metric
176 --
177 -- PURPOSE
178 --    Update a Metric.
179 --
180 -- PARAMETERS
181 --    p_Metric_rec: the record with new items
182 --
183 -- NOTES
184 --    1. Raise exception if the object_version_number doesn't match.
185 --    2. If an attribute is passed in as FND_API.g_miss_char/num/date,
186 --       that column won't be updated.
187 ----------------------------------------------------------------------
188 PROCEDURE Update_Metric(
189    p_api_version       IN  NUMBER,
190    p_init_msg_list     IN  VARCHAR2  := FND_API.g_false,
191    p_commit            IN  VARCHAR2  := FND_API.g_false,
192    p_validation_level  IN  NUMBER    := FND_API.g_valid_level_full,
193 
194    x_return_status     OUT NOCOPY VARCHAR2,
195    x_msg_count         OUT NOCOPY NUMBER,
196    x_msg_data          OUT NOCOPY VARCHAR2,
197 
198    p_metric_rec        IN  AMS_Metric_PVT.metric_rec_type
199 );
200 
201 
202 ---------------------------------------------------------------------
203 -- PROCEDURE
204 --    Validate_Metric
205 --
206 -- PURPOSE
207 --    Validate a Metric record.
208 --
209 -- PARAMETERS
210 --    p_metric_rec: the Metric record to be validated
211 --
212 -- NOTES
213 --    1. p_metric_rec should be the complete metric record. There
214 --       should not be any FND_API.g_miss_char/num/date in it.
215 ----------------------------------------------------------------------
216 PROCEDURE Validate_Metric(
217    p_api_version       IN  NUMBER,
218    p_init_msg_list     IN  VARCHAR2  := FND_API.g_false,
219    p_validation_level  IN  NUMBER    := FND_API.g_valid_level_full,
220 
221    x_return_status     OUT NOCOPY VARCHAR2,
222    x_msg_count         OUT NOCOPY NUMBER,
223    x_msg_data          OUT NOCOPY VARCHAR2,
224 
225    p_metric_rec        IN  AMS_Metric_PVT.metric_rec_type
226 );
227 
228 
229 END AMS_Metric_PUB;