Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set SuccessIndicator on successful conclusion #36

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,17 @@ BEGIN TRY

FailureEndOfProcedure:

SET @SuccessIndicator = 'N'

SET @LogMessage = N'' + @SpName + ' ended in failure.';
SET @MessageLog = [omd].[AddLogMessage]('ERROR', DEFAULT, DEFAULT, @LogMessage, @MessageLog)

GOTO EndOfProcedure

SuccessEndOfProcedure:

SET @SuccessIndicator = 'Y'

SET @LogMessage = N'' + @SpName + ' completed succesfully.';
SET @MessageLog = [omd].[AddLogMessage]('SUCCESS', DEFAULT, DEFAULT, @LogMessage, @MessageLog)

Expand Down
2 changes: 2 additions & 0 deletions Direct_Framework/Stored Procedures/omd.CreateLoadWindow.sql
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ WHERE modinst.EXECUTION_STATUS_CODE = ''Succeeded''';
-- End of procedure label
EndOfProcedure:

SET @SuccessIndicator = 'Y'

SET @EndTimestamp = SYSUTCDATETIME();
SET @EndTimestampString = FORMAT(@EndTimestamp, 'yyyy-MM-dd HH:mm:ss.fffffff');
SET @LogMessage = @EndTimestampString;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,17 @@ BEGIN TRY

FailureEndOfProcedure:

SET @SuccessIndicator = 'N'

SET @LogMessage = N'' + @SpName + ' ended in failure.';
SET @MessageLog = [omd].[AddLogMessage]('ERROR', DEFAULT, DEFAULT, @LogMessage, @MessageLog)

GOTO EndOfProcedure

SuccessEndOfProcedure:

SET @SuccessIndicator = 'Y'

SET @LogMessage = N'' + @SpName + ' completed succesfully.';
SET @MessageLog = [omd].[AddLogMessage]('SUCCESS', DEFAULT, DEFAULT, @LogMessage, @MessageLog)

Expand Down
1 change: 1 addition & 0 deletions Direct_Framework/Stored Procedures/omd.EndDating.sql
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ WHERE NOT EXISTS
-- End of procedure label
EndOfProcedure:

SET @SuccessIndicator = 'Y'
SET @EndTimestamp = SYSUTCDATETIME();
SET @EndTimestampString = FORMAT(@EndTimestamp, 'yyyy-MM-dd HH:mm:ss.fffffff');
SET @LogMessage = @EndTimestampString;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ BEGIN TRY
-- End of procedure label
EndOfProcedure:

SET @SuccessIndicator = 'Y'

SET @EndTimestamp = SYSUTCDATETIME();
SET @EndTimestampString = FORMAT(@EndTimestamp, 'yyyy-MM-dd HH:mm:ss.fffffff');
SET @LogMessage = @EndTimestampString;
Expand Down
2 changes: 2 additions & 0 deletions Direct_Framework/Stored Procedures/omd.InsertIntoEventLog.sql
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ BEGIN TRY
-- End of procedure label
EndOfProcedure:

SET @SuccessIndicator = 'Y'

SET @EndTimestamp = SYSUTCDATETIME();
SET @EndTimestampString = FORMAT(@EndTimestamp, 'yyyy-MM-dd HH:mm:ss.fffffff');
SET @LogMessage = @EndTimestampString;
Expand Down
2 changes: 2 additions & 0 deletions Direct_Framework/Stored Procedures/omd.ModuleEvaluation.sql
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ BEGIN TRY

ModuleFailure:
-- The procedure should not be able to end in this part, so this is just to be sure there is a failure reported when this happens.
SET @SuccessIndicator = 'N'
EXEC [omd].[UpdateModuleInstance]
@ModuleInstanceId = @ModuleInstanceId,
@Debug = @Debug,
Expand All @@ -483,6 +484,7 @@ BEGIN TRY
-- End of procedure label
EndOfProcedure:

SET @SuccessIndicator = 'Y'
SET @EndTimestamp = SYSUTCDATETIME();
SET @EndTimestampString = FORMAT(@EndTimestamp, 'yyyy-MM-dd HH:mm:ss.fffffff');
SET @LogMessage = @EndTimestampString;
Expand Down
2 changes: 2 additions & 0 deletions Direct_Framework/Stored Procedures/omd.RegisterBatch.sql
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ BEGIN TRY
-- End of procedure label
EndOfProcedure:

SET @SuccessIndicator = 'Y'

SET @EndTimestamp = SYSUTCDATETIME();
SET @EndTimestampString = FORMAT(@EndTimestamp, 'yyyy-MM-dd HH:mm:ss.fffffff');
SET @LogMessage = @EndTimestampString;
Expand Down
3 changes: 2 additions & 1 deletion Direct_Framework/Stored Procedures/omd.RunBatch.sql
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ BEGIN TRY
@Debug = @Debug,
@EventCode = 'Failure';

SET @Result = 'Failure';
SET @Result = 'Failure';
SET @SuccessIndicator = 'N';

THROW

Expand Down