DBA Data[Home] [Help]

PACKAGE: APPS.BEN_BCM_SHD

Source


1 Package ben_bcm_shd as
2 /* $Header: bebcmrhi.pkh 120.0.12010000.1 2008/07/29 10:53:52 appldev ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (cwb_matrix_id                   number(15)
10   ,name                            varchar2(240)
11   ,date_saved                      date
12   ,plan_id                         number(15)
13   ,matrix_typ_cd                   varchar2(30)
14   ,person_id                       number(15)
15   ,row_crit_cd                     varchar2(30)
16   ,col_crit_cd                     varchar2(30)
17   ,alct_by_cd                      varchar2(30)
18   ,business_group_id               number(15)
19   ,object_version_number           number(9)
20   );
21 --
22 -- ----------------------------------------------------------------------------
23 -- |           Global Definitions - Internal Development Use Only             |
24 -- ----------------------------------------------------------------------------
25 --
26 g_old_rec  g_rec_type;                            -- Global record definition
27 -- Global table name
28 g_tab_nam  constant varchar2(30) := 'BEN_CWB_MATRIX';
29 --
30 -- ----------------------------------------------------------------------------
31 -- |---------------------------< constraint_error >---------------------------|
32 -- ----------------------------------------------------------------------------
33 -- {Start Of Comments}
34 --
35 -- Description:
36 --   This procedure is called when a constraint has been violated (i.e.
37 --   The exception hr_api.check_integrity_violated,
38 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
39 --   hr_api.unique_integrity_violated has been raised).
40 --   The exceptions can only be raised as follows:
41 --   1) A check constraint can only be violated during an INSERT or UPDATE
42 --      dml operation.
43 --   2) A parent integrity constraint can only be violated during an
44 --      INSERT or UPDATE dml operation.
45 --   3) A child integrity constraint can only be violated during an
46 --      DELETE dml operation.
47 --   4) A unique integrity constraint can only be violated during INSERT or
48 --      UPDATE dml operation.
49 --
50 -- Prerequisites:
51 --   1) Either hr_api.check_integrity_violated,
52 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
53 --      hr_api.unique_integrity_violated has been raised with the subsequent
54 --      stripping of the constraint name from the generated error message
55 --      text.
56 --   2) Standalone validation test which corresponds with a constraint error.
57 --
58 -- In Parameter:
59 --   p_constraint_name is in upper format and is just the constraint name
60 --   (e.g. not prefixed by brackets, schema owner etc).
61 --
62 -- Post Success:
63 --   Development dependant.
64 --
65 -- Post Failure:
66 --   Developement dependant.
67 --
68 -- Developer Implementation Notes:
69 --   For each constraint being checked the hr system package failure message
70 --   has been generated as a template only. These system error messages should
71 --   be modified as required (i.e. change the system failure message to a user
72 --   friendly defined error message).
73 --
74 -- Access Status:
75 --   Internal Development Use Only.
76 --
77 -- {End Of Comments}
78 -- ----------------------------------------------------------------------------
79 Procedure constraint_error
80   (p_constraint_name in all_constraints.constraint_name%TYPE);
81 --
82 -- ----------------------------------------------------------------------------
83 -- |-----------------------------< api_updating >-----------------------------|
84 -- ----------------------------------------------------------------------------
85 --  {Start Of Comments}
86 --
87 -- Description:
88 --   This function is used to populate the g_old_rec record with the
89 --   current row from the database for the specified primary key
90 --   provided that the primary key exists and is valid and does not
91 --   already match the current g_old_rec. The function will always return
92 --   a TRUE value if the g_old_rec is populated with the current row.
93 --   A FALSE value will be returned if all of the primary key arguments
94 --   are null.
95 --
96 -- Prerequisites:
97 --   None.
98 --
99 -- In Parameters:
100 --
101 -- Post Success:
102 --   A value of TRUE will be returned indiciating that the g_old_rec
103 --   is current.
104 --   A value of FALSE will be returned if all of the primary key arguments
105 --   have a null value (this indicates that the row has not be inserted into
106 --   the Schema), and therefore could never have a corresponding row.
107 --
108 -- Post Failure:
109 --   A failure can only occur under two circumstances:
110 --   1) The primary key is invalid (i.e. a row does not exist for the
111 --      specified primary key values).
112 --   2) If an object_version_number exists but is NOT the same as the current
113 --      g_old_rec value.
114 --
115 -- Developer Implementation Notes:
116 --   None.
117 --
118 -- Access Status:
119 --   Internal Development Use Only.
120 --
121 -- {End Of Comments}
122 -- ----------------------------------------------------------------------------
123 Function api_updating
124   (p_cwb_matrix_id                        in     number
125   ,p_object_version_number                in     number
126   )      Return Boolean;
127 --
128 -- ----------------------------------------------------------------------------
129 -- |---------------------------------< lck >----------------------------------|
130 -- ----------------------------------------------------------------------------
131 -- {Start of comments}
132 --
133 -- Description:
134 --   The Lck process has two main functions to perform. Firstly, the row to be
135 --   updated or deleted must be locked. The locking of the row will only be
136 --   successful if the row is not currently locked by another user.
137 --   Secondly, during the locking of the row, the row is selected into
138 --   the g_old_rec data structure which enables the current row values from
139 --   the server to be available to the api.
140 --
141 -- Prerequisites:
142 --   When attempting to call the lock the object version number (if defined)
143 --   is mandatory.
144 --
145 -- In Parameters:
146 --   The arguments to the Lck process are the primary key(s) which uniquely
147 --   identify the row and the object version number of row.
148 --
149 -- Post Success:
150 --   On successful completion of the Lck process the row to be updated or
151 --   deleted will be locked and selected into the global data structure
152 --   g_old_rec.
153 --
154 -- Post Failure:
155 --   The Lck process can fail for three reasons:
156 --   1) When attempting to lock the row the row could already be locked by
157 --      another user. This will raise the HR_Api.Object_Locked exception.
158 --   2) The row which is required to be locked doesn't exist in the HR Schema.
159 --      This error is trapped and reported using the message name
160 --      'HR_7220_INVALID_PRIMARY_KEY'.
161 --   3) The row although existing in the HR Schema has a different object
162 --      version number than the object version number specified.
163 --      This error is trapped and reported using the message name
164 --      'HR_7155_OBJECT_INVALID'.
165 --
166 -- Developer Implementation Notes:
167 --   For each primary key and the object version number arguments add a
168 --   call to hr_api.mandatory_arg_error procedure to ensure that these
169 --   argument values are not null.
170 --
171 -- Access Status:
172 --   Internal Development Use Only.
173 --
174 -- {End of comments}
175 -- ----------------------------------------------------------------------------
176 Procedure lck
177   (p_cwb_matrix_id                        in     number
178   ,p_object_version_number                in     number
179   );
180 --
181 -- ----------------------------------------------------------------------------
182 -- |-----------------------------< convert_args >-----------------------------|
183 -- ----------------------------------------------------------------------------
184 -- {Start Of Comments}
185 --
186 -- Description:
187 --   This function is used to turn attribute parameters into the record
188 --   structure parameter g_rec_type.
189 --
190 -- Prerequisites:
191 --   This is a private function and can only be called from the ins or upd
192 --   attribute processes.
193 --
194 -- In Parameters:
195 --
196 -- Post Success:
197 --   A returning record structure will be returned.
198 --
199 -- Post Failure:
200 --   No direct error handling is required within this function.  Any possible
201 --   errors within this function will be a PL/SQL value error due to
202 --   conversion of datatypes or data lengths.
203 --
204 -- Developer Implementation Notes:
205 --   None.
206 --
207 -- Access Status:
208 --   Internal Row Handler Use Only.
209 --
210 -- {End Of Comments}
211 -- ----------------------------------------------------------------------------
212 Function convert_args
213   (p_cwb_matrix_id                  in number
214   ,p_name                           in varchar2
215   ,p_date_saved                     in date
216   ,p_plan_id                        in number
217   ,p_matrix_typ_cd                  in varchar2
218   ,p_person_id                      in number
219   ,p_row_crit_cd                    in varchar2
220   ,p_col_crit_cd                    in varchar2
221   ,p_alct_by_cd                     in varchar2
222   ,p_business_group_id              in number
223   ,p_object_version_number          in number
224   )
225   Return g_rec_type;
226 --
227 end ben_bcm_shd;