project BLF > class BSODViolationRule1 > method DeleteBySODCategoryExclusion

Description

delete violations


Parameters


iiSODCategory1IDinputinteger
iiSODCategory2IDinputinteger
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
method BSODCategoryExclusion.AdditionalUpdates


program code (program1/bsodviolationrule1.p)

if oiReturnStatus = 0
then oiReturnStatus = -98.

vcFreeform = "for each SODViolation1"
           +   " where SODViolation1.SODCategory1_ID = " + string(iiSODCategory1ID)
           +     " and SODViolation1.SODCategory2_ID = " + string(iiSODCategory2ID).
<M-1 run DataLoad
   (input  '' (icRowids), 
    input  '' (icPkeys), 
    input  '' (icObjectIds), 
    input  vcFreeform (icFreeform), 
    input  yes (ilKeepPrevious), 
    output viFcReturnSuper (oiReturnStatus)) in BSODViolationRule1>
if viFcReturnSuper = -4
then assign vlLoad1         = yes
            viFcReturnSuper = 0.
if viFcReturnSuper <> 0
then oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0
then return.

vcFreeform = "for each SODViolation1"
           +   " where SODViolation1.SODCategory1_ID = " + string(iiSODCategory2ID)
           +     " and SODViolation1.SODCategory2_ID = " + string(iiSODCategory1ID).
<M-2 run DataLoad
   (input  '' (icRowids), 
    input  '' (icPkeys), 
    input  '' (icObjectIds), 
    input  vcFreeform (icFreeform), 
    input  yes (ilKeepPrevious), 
    output viFcReturnSuper (oiReturnStatus)) in BSODViolationRule1>
if viFcReturnSuper = -4
then assign vlLoad2         = yes
            viFcReturnSuper = 0.
if viFcReturnSuper <> 0
then oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0
then return.

if vlLoad1 and vlLoad2
then do:
    oiReturnStatus = -4.
    return.
end.

<M-19 run DeleteAndLog
   (input  0 (iiRoleID), 
    input  0 (iiResourceID), 
    input  iiSODCategory1ID (iiSODCategory1ID), 
    input  iiSODCategory2ID (iiSODCategory2ID), 
    output viFcReturnSuper (oiReturnStatus)) in BSODViolationRule1>
if viFcReturnSuper <> 0
then oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0
then return.

if oiReturnStatus = -98
then oiReturnStatus = 0.