The following lines contain the word 'select', 'insert', 'update' or 'delete':
Preserve the deleted rule's ID in the preserved rule's source field, if space permits.
In the very unlikely event otherwise, silently omit the extra source value(s). (The
alternative would be to raise an exception that would require for its solution either
a code change or a change to the structure of the rules or transaction--none of which
would please the end user.)
*/
if(lengthb(sources(i - 1)) + lengthb(sources(i)) + 1 <= ame_util.longStringTypeLength) then
sources(i) := sources(i) || ame_util.fieldDelimiter || sources(i - 1);
/* Delete the duplicate group. */
approverCategories.delete(i - 1);
groupIds.delete(i - 1);
groupOrderNumbers.delete(i - 1);
ruleIds.delete(i - 1);
parameters.delete(i - 1);
parameterTwos.delete(i - 1);
sources.delete(i - 1);
votingRegimes.delete(i - 1);
COAInsertee ame_util.approverRecord2;
tempApprover.api_insertion := ame_util.oamGenerated;
/* Check for COA First Authority Insertion */
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 COA Insertee exists add as first approver and then continue normal processing */
if COAInsertee.name is null then
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;
tempApprover.source := COAInsertee.source;
tempApprover.api_insertion := ame_util.apiAuthorityInsertion;
tempApproverNames.delete;
tempApproverOrderNumbers.delete;
tempApproverDisplayNames.delete;
tempOrigSystemIds.delete;
tempOrigSystems.delete;
tempApprover.api_insertion := ame_util.oamGenerated;
/* Check if there is any COA Insertion after this approver. If a COA Insertee is
found keep checking till there are no more COA Insertee's */
loop
/* 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;
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;