The following lines contain the word 'select', 'insert', 'update' or 'delete':
select supervisor_id
into supervisorPersonId
from
per_all_assignments_f
where
person_id = personIdIn and
per_all_assignments_f.primary_flag = 'Y' and
per_all_assignments_f.assignment_type in ('E','C') and
per_all_assignments_f.assignment_status_type_id not in
(select assignment_status_type_id
from per_assignment_status_types
where per_system_status = 'TERM_ASSIGN') and
trunc(sysdate) between
per_all_assignments_f.effective_start_date and
per_all_assignments_f.effective_end_date;
/* Update hasFinalAuthorityYN as needed. */
if(not tempRuleSatisfied and
hasFinalAuthorityYN = ame_util.booleanTrue) then
hasFinalAuthorityYN := ame_util.booleanFalse;
/* Update source. */
ame_util.appendRuleIdToSource(ruleIdIn => ruleIds(i),
sourceInOut => source);
/* Update category as needed. */
if(category = ame_util.fyiApproverCategory and
approverCategories(i) = ame_util.approvalApproverCategory) then
category := ame_util.approvalApproverCategory;
COAInsertee ame_util.approverRecord2;
/* Check for COA Insertions */
ame_engine.getHandlerCOAFirstApprover(itemClassIn => tempApprover.item_class,
itemIdIn => tempApprover.item_id,
actionTypeIdIn => tempApprover.action_type_id,
groupOrChainIdIn => tempApprover.group_or_chain_id,
nameOut => COAInsertee.name,
origSystemOut => COAInsertee.orig_system,
origSystemIdOut => COAInsertee.orig_system_id,
displayNameOut => COAInsertee.display_name,
sourceOut => COAInsertee.source);
Start building the chain from the COA Insertee if defined otherwise from the non-default
starting point or the requestor's supervisor.
*/
if COAInsertee.name is null then
/* Fetch some of the required attributes. */
startingPointId :=
to_number(ame_engine.getHeaderAttValue2(attributeNameIn => ame_util.supStartingPointAttribute));
tempApprover.api_insertion := ame_util.oamGenerated;
tempApprover.api_insertion := ame_util.oamGenerated;
tempApprover.name := COAInsertee.name;
tempApprover.orig_system := COAInsertee.orig_system;
tempApprover.orig_system_id := COAInsertee.orig_system_id;
tempApprover.display_name := COAInsertee.display_name;
firstApproverSource := COAInsertee.source;
tempApprover.api_insertion := ame_util.apiAuthorityInsertion;
/* reassign the value of source in case approver was a firstAuthority insertee */
if firstApproverSource is not null then
tempApprover.source := firstApproverSource;
/* check to see if there is a COA insertion after this approver. If a COA insertion is
found, keep checking till no more COA insertions.
*/
currentApproverPersonId := tempApprover.orig_system_id;
/* Initialize COAInsertee approver record 2 */
COAInsertee := ame_util.emptyApproverRecord2;
/* Check if there are any chain of authority insertions */
ame_engine.getHandlerCOAInsertion(nameIn => tempApprover.name,
itemClassIn => tempApprover.item_class,
itemIdIn => tempApprover.item_id,
actionTypeIdIn => tempApprover.action_type_id,
groupOrChainIdIn => tempApprover.group_or_chain_id,
occurrenceIn => tempApprover.occurrence,
approvalStatusIn => tempApprover.approval_status,
nameOut => COAInsertee.name,
origSystemOut => COAInsertee.orig_system,
origSystemIdOut => COAInsertee.orig_system_id,
displayNameOut => COAInsertee.display_name,
sourceOut => COAInsertee.source);
if COAInsertee.name is null then
exit;
if COAInsertee.source <> ame_util.specialForwardInsertion then
coaInsAuthForward := true;
currentApproverPersonId := COAInsertee.orig_system_id;
tempApprover.name := COAInsertee.name;
tempApprover.orig_system := COAInsertee.orig_system;
tempApprover.orig_system_id := COAInsertee.orig_system_id;
tempApprover.display_name := COAInsertee.display_name;
tempApprover.source := COAInsertee.source;
tempApprover.api_insertion := ame_util.apiAuthorityInsertion;
/*if the next approver because of first auth insertion the populate the date and reason*/
if firstAuthInsExists then
ame_engine.setDeviationReasonDate(ame_approver_deviation_pkg.firstauthHandlerInsReason,null);
tempApprover.api_insertion := ame_util.oamGenerated;