dbo.ATT_ZAttestationMakeDecisionWC

SQL_STORED_PROCEDURE

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

Open formatted source/search result

Parameters

NameTypeOutput
@SlotNumberintno

Referenced objects

SchemaObjectColumn/minorClass
AttestationCaseOBJECT_OR_COLUMN
AttestationHelperOBJECT_OR_COLUMN
QBM_PDBQCS_CurrentMoveSlotOBJECT_OR_COLUMN
QBM_PJobCreate_HOCallMethodOBJECT_OR_COLUMN
QBM_PJournalOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_YCursorBufferTYPE
QBM_YDBQCSCurrentToMoveTYPE
QBM_YSessionErrorTYPE
QBMDBQueueCurrentOBJECT_OR_COLUMN
QERWorkingStepOBJECT_OR_COLUMN
dboQBM_FGIDBQueueSlotResetTypeOBJECT_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 ATT_ZAttestationMakeDecisionWC (@SlotNumber int) as begin  declare @UID_AttestationCase varchar(38) declare @GenProcID varchar
2(38) declare @Decision nvarchar(16) declare @Reason nvarchar(255) declare @uid_person varchar(38) declare @cond nvarchar(max) declare @whereclause nvarchar
3(max) declare @SQLcmd nvarchar(max) declare @muster nvarchar(max) declare @CountItems int declare @AutomaticReasonTrue nvarchar(128) declare @AutomaticReasonFalse
4 nvarchar(128) declare @BasisObjectKey varchar(138) declare @DecisionLevel int declare @DebugLevel char(1) = 'W' declare @ElementBuffer QBM_YCursorBuffer
5 declare @ElementCount int declare @ElementIndex int declare @SQLCmdWithRetry nvarchar(max) declare @ErrorBuffer QBM_YSessionError declare @SlotNumberSource
6 int declare @SlotNumberTarget int declare @DBQueueToMove QBM_YDBQCSCurrentToMove declare @RowsMoved int SET XACT_ABORT OFF BEGIN TRY  select @muster =
7 '
8declare @erg int
9select @erg = 
10-- die Kundenklausel
11@whereclause (''@UID_AttestationCase'')
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 ac.UID_AttestationCase , p.GenprocID
40, isnull(ds.WhereClause, N'') , isnull(ds.AutomaticReasonTrue, ''), isnull(ds.AutomaticReasonFalse, ''), ac.XObjectKey , ac.DecisionLevel from QBMDBQueueCurrent
41 p with (readpast) join AttestationCase ac on p.uid_parameter = ac.UID_AttestationCase join AttestationHelper ah on ac.UID_AttestationCase = ah.UID_AttestationCase
42 and ac.decisionlevel = ah.levelnumber join QERWorkingStep ds on ah.UID_QERWorkingStep = ds.UID_QERWorkingStep  where ah.UID_PWODecisionRule = 'ATT-PWODecisionRule-WC'
43 and isnull(ac.isclosed,0) = 0 and p.SlotNumber = @SlotNumber select @ElementCount = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex <= @ElementCount
44 begin select top 1 @UID_AttestationCase = bu.UID1  , @GenProcID = bu.UID2  , @whereclause = bu.ContentFull  , @AutomaticReasonTrue = bu.LongIdent1  , 
45@AutomaticReasonFalse = bu.LongIdent2  , @BasisObjectKey = bu.ObjectKey1  , @DecisionLevel = bu.Int1  from @ElementBuffer bu where bu.ElementIndex = @ElementIndex
46 select @SQLcmd = @muster select @SQLcmd = replace(@SQLcmd , N'@whereclause', @whereclause) select @SQLcmd = replace(@SQLcmd, N'@UID_AttestationCase', 
47@UID_AttestationCase)  BEGIN TRY exec sp_executesql @SQLcmd select @CountItems = @@rowcount END TRY BEGIN CATCH select @CountItems = -1 END CATCH if @CountItems
48 = 3  begin  select @decision = 'True'  if @AutomaticReasonTrue > ' ' begin select @Reason = @AutomaticReasonTrue end else begin select @reason = '#LDS#Automatic system approval with method WC: Condition was met.|'
49 end end if @CountItems = 1  begin select @decision = 'False'  if @AutomaticReasonFalse > ' ' begin select @Reason = @AutomaticReasonFalse end else begin
50 select @reason = '#LDS#Automatic system approval with method WC: Condition was not met.|' end end if @CountItems = 2  begin  delete @DBQueueToMove  insert
51 into @DBQueueToMove(UID_DialogDBQueue) select cul.UID_DialogDBQueue from QBMDBQueueCurrent cul  where cul.SlotNumber = @SlotNumber and cul.UID_Parameter
52 = @UID_AttestationCase if @@ROWCOUNT > 0 begin select @SlotNumberSource = @SlotNumber  select @SlotnumberTarget = dbo.QBM_FGIDBQueueSlotResetType('Wait'
53) exec @RowsMoved = QBM_PDBQCS_CurrentMoveSlot @DBQueueToMove, @SlotNumberSource, @SlotnumberTarget exec QBM_PJournal '#LDS#Deferring operations resulting form the IT Shop procedure "waiting for condition".|'
54, @@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.|'
55 end if @CountItems = 3 or @CountItems = 1 or @CountItems < 0 begin select @cond = N'UID_AttestationCase = ''' + rtrim(@UID_AttestationCase) + N''' and DecisionLevel = '
56 + STR(@DecisionLevel)  exec QBM_PJobCreate_HOCallMethod @objecttype = 'AttestationCase' , @whereclause = @cond , @save = 1 , @MethodName = 'MakeDecision'
57 , @GenProcID = @GenprocID , @ObjectKeysAffected = DEFAULT , @param1 = 'sa' , @param2 = @decision , @param3 = @reason , @Retries = 3 , @isToFreezeOnError
58 = 1  , @BasisObjectKey = @BasisObjectKey , @checkForExisting = 1 , @WhereClauseAdditional = ' IsClosed = 0 '  end select @ElementIndex += 1 end  END TRY
59 BEGIN CATCH exec QBM_PSessionErrorAdd default, @SQLCmdWithRetry raiserror ('', 18, 1) with nowait END CATCH endLabel: return end 
60

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:42.747

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, AttestationCase, AttestationHelper, QERWorkingStep

Declared parameters

ParameterTypeDirection
@SlotNumberintinput

DML targets

INSERT into

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

None extracted.

Temp tables / referenced variables

Temp: #LDS #Automatic #Deferring

Variables: @SlotNumber @UID_AttestationCase @GenProcID @Decision @Reason @uid_person @cond @whereclause @SQLcmd @muster @CountItems @AutomaticReasonTrue @AutomaticReasonFalse @BasisObjectKey @DecisionLevel @DebugLevel @ElementBuffer @ElementCount @ElementIndex @SQLCmdWithRetry @ErrorBuffer @SlotNumberSource @SlotNumberTarget @DBQueueToMove @RowsMoved @erg @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.