dbo.QER_ZITShopMakeDecisionSB
Stored ProcedureSQL_STORED_PROCEDURESandbox DB
Interpretation
- Database routine. Review parameters, called procedures, DBQueue inserts, and QBM_PJobCreate helper calls before assuming side effects.
- Object-layer bridge detected through QBM_PJobCreate helper usage.
Relations
- HOCallMethod -> personwantsorg.MakeDecision at line 11
- References QBM_PJobCreate*
- References QBM_PJobCreate_HOCallMethod*
Typed Edges
- calls object method personwantsorg.MakeDecision HOCallMethod -> personwantsorg.MakeDecision at line 11
- references source dbo.QBM_FCVStringToBit source text reference
- references source dbo.QBM_FGIConfigparmValue source text reference
- references source dbo.QER_FGIGenProcIDForPWO source text reference
- references source dbo.QBM_PJobCreate source text reference
- references source dbo.QBM_PJobCreate_HOCallMethod source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
References
- dbo.QBM_FCVStringToBit
- dbo.QBM_FGIConfigparmValue
- dbo.QER_FGIGenProcIDForPWO
- dbo.QBM_PJobCreate
- dbo.QBM_PJobCreate_HOCallMethod
- dbo.QBM_PSessionErrorAdd
Referenced By
- No direct source references extracted.
Complete Source
1CREATE PROCEDURE QER_ZITShopMakeDecisionSB(2 @SlotNumber int3)4AS5BEGIN6 DECLARE @UID_Personwantsorg varchar(38)7 DECLARE @GenProcID varchar(38)8 DECLARE @CfgUseGenProcID BIT = dbo.QBM_FCVStringToBit(dbo.QBM_FGIConfigparmValue('Common\ProcessState\UseGenProcIDFromPWO'))9 DECLARE @Reason nvarchar(255)10 DECLARE @cond nvarchar(max)11 DECLARE @DecisionLevel int12 DECLARE @BasisObjectKey varchar(138)13 DECLARE @ElementBuffer QBM_YCursorBuffer14 DECLARE @ElementCount int15 DECLARE @ElementIndex int16 BEGIN TRY17 INSERT INTO @ElementBuffer(UID1,18 UID2,19 ObjectKey1,20 Int1)21 SELECT22 pwo.uid_personwantsorg,23 dbo.QER_FGIGenProcIDForPWO(pwo.GenProcID,24 p.GenProcID,25 @CfgUseGenProcID) AS GenProcID,26 pwo.XObjectKey,27 pwo.DecisionLevel28 FROM QBMDBQueueCurrent p29 WITH(readpast)30 JOIN personwantsorg pwo31 ON p.uid_parameter = pwo.uid_personwantsorg AND p.SlotNumber = @SlotNumber32 JOIN PWOHelperPWO ph33 ON pwo.uid_personwantsorg = ph.uid_personwantsorg AND pwo.decisionlevel = ph.levelnumber34 WHERE35 ph.UID_PWODecisionRule = 'QER-PWODecisionRule-SB' AND pwo.OrderState IN('OrderProduct',36 'OrderProlongate',37 'OrderUnsubscribe')38 SELECT @ElementCount = @@ROWCOUNT39 SELECT @ElementIndex = 140 WHILE @ElementIndex <= @ElementCount41 BEGIN42 SELECT43 TOP 1 @uid_personwantsorg = bu.UID1,44 @GenProcID = bu.UID2,45 @BasisObjectKey = bu.ObjectKey1,46 @DecisionLevel = bu.Int147 FROM @ElementBuffer bu48 WHERE49 bu.ElementIndex = @ElementIndex50 SELECT @reason = '#LDS#Automatic system approval with method SB: Condition was met.|'51 SELECT52 @cond = N 'uid_personwantsorg = ''' + rtrim(@uid_personwantsorg) + N ''' and DecisionLevel = ' + STR(@DecisionLevel)53 EXEC QBM_PJobCreate_HOCallMethod @objecttype = 'personwantsorg',54 @whereclause = @cond,55 @save = 1,56 @MethodName = 'MakeDecision',57 @ObjectKeysAffected = DEFAULT,58 @GenProcID = @GenprocID,59 @param1 = 'sa',60 @param2 = 'True',61 @param3 = @reason,62 @Retries = 3,63 @isToFreezeOnError = 1,64 @BasisObjectKey = @BasisObjectKey,65 @checkForExisting = 1,66 @WhereClauseAdditional = ' OrderState in(''OrderProduct'', ''OrderProlongate'', ''OrderUnsubscribe'')'67 SELECT @ElementIndex += 168 END69 END TRY70 BEGIN CATCH71 EXEC QBM_PSessionErrorAdd DEFAULT72 RAISERROR('',73 18,74 1)75 WITH NOWAIT76 END CATCH77 endLabel:78 RETURN79END
Open raw exported source
1 create procedure QER_ZITShopMakeDecisionSB (@SlotNumber int) as begin declare @UID_Personwantsorg varchar(38) declare @GenProcID varchar(382) declare @CfgUseGenProcID bit = dbo.QBM_FCVStringToBit(dbo.QBM_FGIConfigparmValue('Common\ProcessState\UseGenProcIDFromPWO')) declare @Reason nvarchar3(255) declare @cond nvarchar(max) declare @DecisionLevel int declare @BasisObjectKey varchar(138) declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount4 int declare @ElementIndex int BEGIN TRY insert into @ElementBuffer (UID1 , UID2 , ObjectKey1 , Int1 ) select pwo.uid_personwantsorg , dbo.QER_FGIGenProcIDForPWO5(pwo.GenProcID, p.GenProcID, @CfgUseGenProcID) as GenProcID , pwo.XObjectKey , pwo.DecisionLevel from QBMDBQueueCurrent p with (readpast) join personwantsorg6 pwo on p.uid_parameter = pwo.uid_personwantsorg and p.SlotNumber = @SlotNumber join PWOHelperPWO ph on pwo.uid_personwantsorg = ph.uid_personwantsorg 7and pwo.decisionlevel = ph.levelnumber where ph.UID_PWODecisionRule = 'QER-PWODecisionRule-SB' and pwo.OrderState in ('OrderProduct', 'OrderProlongate'8, 'OrderUnsubscribe') select @ElementCount = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 1 @uid_personwantsorg9 = bu.UID1 , @GenProcID = bu.UID2 , @BasisObjectKey = bu.ObjectKey1 , @DecisionLevel = bu.Int1 from @ElementBuffer bu where bu.ElementIndex = @ElementIndex10 select @reason = '#LDS#Automatic system approval with method SB: Condition was met.|' select @cond = N'uid_personwantsorg = ''' + rtrim(@uid_personwantsorg11) + N''' and DecisionLevel = ' + STR(@DecisionLevel) exec QBM_PJobCreate_HOCallMethod @objecttype = 'personwantsorg' , @whereclause = @cond , @save = 121 , @MethodName = 'MakeDecision' , @ObjectKeysAffected = DEFAULT , @GenProcID = @GenprocID , @param1 = 'sa' , @param2 = 'True' , @param3 = @reason , @Retries13 = 3 , @isToFreezeOnError = 1 , @BasisObjectKey = @BasisObjectKey , @checkForExisting = 1 , @WhereClauseAdditional = ' OrderState in(''OrderProduct'', ''OrderProlongate'', ''OrderUnsubscribe'')'14 select @ElementIndex += 1 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel: return end15 16