dbo.QER_ZITShopMakeDecisionWC

SQL_STORED_PROCEDURE

Created 2025-06-27T18:01:06.177 · modified 2026-04-14T23:20:38.670 · source: live DB sys.objects/sys.sql_expression_dependencies.

Open formatted source/search result

Parameters

NameTypeOutput
@SlotNumberintno

Referenced objects

SchemaObjectColumn/minorClass
personwantsorgOBJECT_OR_COLUMN
PWOHelperPWOOBJECT_OR_COLUMN
QBM_PDBQCS_CurrentMoveSlotOBJECT_OR_COLUMN
QBM_PJobCreate_HOCallMethodOBJECT_OR_COLUMN
QBM_PJournalOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_YCursorBufferTYPE
QBM_YDBQCSCurrentToMoveTYPE
QBMDBQueueCurrentOBJECT_OR_COLUMN
QERWorkingStepOBJECT_OR_COLUMN
dboQBM_FCVStringToBitOBJECT_OR_COLUMN
dboQBM_FGIConfigparmValueOBJECT_OR_COLUMN
dboQBM_FGIDBQueueSlotResetTypeOBJECT_OR_COLUMN
dboQER_FGIGenProcIDForPWOOBJECT_OR_COLUMN

Source excerpt

First extracted SQL definition lines from the exported source. Use the full source page for complete context.

Open full formatted source

1   create   procedure QER_ZITShopMakeDecisionWC (@SlotNumber int) as begin declare @UID_Personwantsorg varchar(38) declare @GenProcID varchar(38
2) declare @CfgUseGenProcID bit = dbo.QBM_FCVStringToBit(dbo.QBM_FGIConfigparmValue('Common\ProcessState\UseGenProcIDFromPWO')) declare @Decision nvarchar
3(16) declare @Reason nvarchar(255) declare @uid_person varchar(38) declare @cond nvarchar(max) declare @whereclause nvarchar(max) declare @SQLcmd nvarchar
4(max) declare @muster nvarchar(max) declare @CountItems int declare @AutomaticReasonTrue nvarchar(128) declare @AutomaticReasonFalse nvarchar(128) declare
5 @BasisObjectKey varchar(138) declare @DecisionLevel int declare @DebugLevel char(1) = 'W' declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount
6 int declare @ElementIndex int  declare @SlotNumberSource int declare @SlotNumberTarget int declare @DBQueueToMove QBM_YDBQCSCurrentToMove declare @RowsMoved
7 int SET XACT_ABORT OFF BEGIN TRY  select @muster = '
8declare @erg int
9select @erg = 
10-- die Kundenklausel
11@whereclause (''@uid_personwantsorg'')
12
13--print @erg
14
15if @erg > 0
16 begin
17	select 1
18	 union all 
19	select 2
20	 union all 
21	select 3
22	 
23 end
24else --bleiben noch 0 und < 0
25 begin
26	 if @erg < 0
27	  begin
28		select 1
29	  end
30	 else -- ist es gleich 0
31	  begin
32		select 1
33		 union all
34		select 2
35	  end
36 end
37		
38'
39 insert into @ElementBuffer ( UID1  , UID2  , ContentFull  , LongIdent1  , LongIdent2  , ObjectKey1  , Int1  ) select pwo.uid_personwantsorg , dbo.QER_FGIGenProcIDForPWO
40(pwo.GenProcID, p.GenProcID, @CfgUseGenProcID) as GenProcID , isnull(ds.WhereClause, N'') , isnull(ds.AutomaticReasonTrue, ''), isnull(ds.AutomaticReasonFalse
41, ''), pwo.XObjectKey , pwo.DecisionLevel from QBMDBQueueCurrent p with (readpast) join personwantsorg pwo on p.uid_parameter = pwo.uid_personwantsorg 
42and p.SlotNumber = @SlotNumber join PWOHelperPWO ph on pwo.uid_personwantsorg = ph.uid_personwantsorg and pwo.decisionlevel = ph.levelnumber join QERWorkingStep
43 ds on ph.UID_QERWorkingStep = ds.UID_QERWorkingStep  where ph.UID_PWODecisionRule = 'QER-PWODecisionRule-WC'   and pwo.OrderState in ('OrderProduct', 
44'OrderProlongate', 'OrderUnsubscribe') select @ElementCount = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top
45 1 @uid_personwantsorg = bu.UID1  , @GenProcID = bu.UID2  , @whereclause = bu.ContentFull  , @AutomaticReasonTrue = bu.LongIdent1  , @AutomaticReasonFalse
46 = bu.LongIdent2  , @BasisObjectKey = bu.ObjectKey1  , @DecisionLevel = bu.Int1  from @ElementBuffer bu where bu.ElementIndex = @ElementIndex select @SQLcmd
47 = @muster select @SQLcmd = replace(@SQLcmd , N'@whereclause', @whereclause) select @SQLcmd = replace(@SQLcmd, N'@uid_personwantsorg', @uid_personwantsorg
48)  BEGIN TRY exec sp_executesql @SQLcmd select @CountItems = @@rowcount END TRY BEGIN CATCH select @CountItems = -1 END CATCH if @CountItems = 3  begin
49  select @decision = 'True'  if @AutomaticReasonTrue > ' ' begin select @Reason = @AutomaticReasonTrue end else begin select @reason = '#LDS#Automatic system approval with method WC: Condition was met.|'
50 end end if @CountItems = 1  begin select @decision = 'False'  if @AutomaticReasonFalse > ' ' begin select @Reason = @AutomaticReasonFalse end else begin
51 select @reason = '#LDS#Automatic system approval with method WC: Condition was not met.|' end end if @CountItems = 2  begin  delete @DBQueueToMove  insert
52 into @DBQueueToMove(UID_DialogDBQueue) select cul.UID_DialogDBQueue from QBMDBQueueCurrent cul  where cul.SlotNumber = @SlotNumber and cul.UID_Parameter
53 = @UID_Personwantsorg if @@ROWCOUNT > 0 begin select @SlotNumberSource = @SlotNumber  select @SlotnumberTarget = dbo.QBM_FGIDBQueueSlotResetType('Wait'
54) exec @RowsMoved = QBM_PDBQCS_CurrentMoveSlot @DBQueueToMove, @SlotNumberSource, @SlotnumberTarget exec QBM_PJournal '#LDS#Deferring operations resulting form the IT Shop procedure "waiting for condition".|'
55, @@procid, 'I', @DebugLevel end end  if @CountItems < 0  begin select @decision = 'False' select @reason = '#LDS#Automatic system approval: Condition caused runtime error using method WC.|'
56 end if @CountItems = 3 or @CountItems = 1 or @CountItems < 0 begin select @cond = N'uid_personwantsorg = ''' + rtrim(@uid_personwantsorg) + N''' and DecisionLevel = '
57 + STR(@DecisionLevel)  exec QBM_PJobCreate_HOCallMethod @objecttype = 'personwantsorg' , @whereclause = @cond , @save = 1 , @MethodName = 'MakeDecision'
58 , @GenProcID = @GenprocID , @ObjectKeysAffected = DEFAULT , @param1 = 'sa' , @param2 = @decision , @param3 = @reason , @Retries = 3 , @isToFreezeOnError
59 = 1  , @BasisObjectKey = @BasisObjectKey , @checkForExisting = 1  , @WhereClauseAdditional = ' OrderState in(''OrderProduct'', ''OrderProlongate'', ''OrderUnsubscribe'')'
60  end select @ElementIndex += 1 end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default, @SQLcmd RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel:
61 return end 
62

Module relation graph

Loading module relation graph…

Source-derived context

Generated from exported SQL module definitions plus read-only sandbox sys.objects/sys.parameters/sys.sql_expression_dependencies metadata. This is factual source evidence, not a semantic guess.

provenance: SQL definition export provenance: sandbox DB metadata modified: 2026-04-14T23:20:38.670

creates object-layer jobs via QBM_PJobCreate* calls object-layer method via HOCallMethod has TRY/CATCH error handling

Summary: calls QBM_PDBQCS_CurrentMoveSlot, QBM_PJournal, QBM_PJobCreate_HOCallMethod, QBM_PSessionErrorAdd; writes INSERT into; reads/joins QBMDBQueueCurrent, personwantsorg, PWOHelperPWO, QERWorkingStep; uses config Common\ProcessState\UseGenProcIDFromPWO

Declared parameters

ParameterTypeDirection
@SlotNumberintinput

DML targets

INSERT into

Config/session

Config: Common\ProcessState\UseGenProcIDFromPWO

Session: None extracted.

DBQueue/tasks

None extracted.

Temp tables / referenced variables

Temp: #LDS #Automatic #Deferring

Variables: @SlotNumber @UID_Personwantsorg @GenProcID @CfgUseGenProcID @Decision @Reason @uid_person @cond @whereclause @SQLcmd @muster @CountItems @AutomaticReasonTrue @AutomaticReasonFalse @BasisObjectKey @DecisionLevel @DebugLevel @ElementBuffer @ElementCount @ElementIndex @SlotNumberSource @SlotNumberTarget @DBQueueToMove @RowsMoved @erg @uid_personwantsorg @ROWCOUNT @rowcount @decision @reason @SlotnumberTarget @procid @objecttype @save @MethodName @GenprocID @ObjectKeysAffected @param1 @param2 @param3

Referenced by / reverse dependencies

Generated from live DB metadata, FK rows, and exported SQL dependency/source extraction. This is factual linkage evidence, not inferred behavior.

No reverse dependencies extracted.