The following lines contain the word 'select', 'insert', 'update' or 'delete':
/* 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 'firstAuthority' 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);
if COAInsertee.name is null then
/* Fetch some of the required attributes. */
startingPointId :=
to_number(ame_engine.getHeaderAttValue2(attributeNameIn => ame_util.jobLevelStartingPointAttribute));
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;
authority to self-approve. If so, insert the approver as the only approver, with a status of approved,
and return.
This can not be done earlier as we need the parsed job levels
*/
if(COAInsertee.name is null and
startingPointId is null )
then
if (ame_engine.getHeaderAttValue2(attributeNameIn => ame_util.allowAutoApprovalAttribute)
= ame_util.booleanAttributeTrue)
then
getCatSourceAndAuthority(personIdIn => requestorId,
jobLevelIn => tempJobLevel,
supervisorIdIn => tempSupervisorId,
categoryOut => tempApprover.approver_category,
sourceOut => tempApprover.source,
hasFinalAuthorityYNOut => tempHasFinalAuthorityYN,
supervisorJobLevelOut => tempSupervisorJobLevel,
nextSupervisorIdOut => tempNextSupervisorId);
tempApprover.api_insertion := ame_util.oamGenerated;
The approver is the last approver in the chain. He should get inserted into the
approver List */
tempMemberOrderNumber := tempMemberOrderNumber + 1;
/* reassign the value of source in case approver was a firstAuthority insertee */
if firstApproverSource is not null then
tempApprover.source := firstApproverSource;
The approver is the last approver in the chain. He should get inserted into the
approver List */
tempMemberOrderNumber := tempMemberOrderNumber + 1;
/* reassign the value of source in case approver was a firstAuthority insertee */
if firstApproverSource is not null then
prevApprover.source := firstApproverSource;
insert the approver in the chain */
if prevApprover.approver_category is not null and
tempApprover.approver_category <> prevApprover.approver_category then
tempMemberOrderNumber := tempMemberOrderNumber + 1;
/* reassign the value of source in case approver was a firstAuthority insertee */
if firstApproverSource is not null then
prevApprover.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. The check for final authority will need to be
done again.
*/
loop
/* Initialize COAInsertee approverRecord2 */
COAInsertee := ame_util.emptyApproverRecord2;
/* Check if there are any COAInsertions */
ame_engine.getHandlerCOAInsertion(nameIn => prevApprover.name,
itemClassIn => prevApprover.item_class,
itemIdIn => prevApprover.item_id,
actionTypeIdIn => prevApprover.action_type_id,
groupOrChainIdIn => prevApprover.group_or_chain_id,
occurrenceIn => prevApprover.occurrence,
approvalStatusIn => prevApprover.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;
prevApprover.name := COAInsertee.name;
prevApprover.orig_system := COAInsertee.orig_system;
prevApprover.orig_system_id := COAInsertee.orig_system_id;
prevApprover.display_name := COAInsertee.display_name;
prevApprover.source := COAInsertee.source;
prevApprover.api_insertion := ame_util.apiAuthorityInsertion;
tempApprover.api_insertion := ame_util.oamGenerated;
/* check to see if there is a COA insertion after the final approver. If a COA insertion is
found, keep checking till no more COA insertions. The check for final authority need not be
done again.
*/
loop
/* Initialize COAInsertee approverRecord2 */
COAInsertee := ame_util.emptyApproverRecord2;
/* Check if there are any COAInsertions */
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;
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;