Skip to content

Commit

Permalink
Merge pull request #36 from data-solution-automation-engine/34-create…
Browse files Browse the repository at this point in the history
…-sps-do-not-set-success-indicator

set SuccessIndicator on successful conclusion
  • Loading branch information
RoelantVos authored Jan 7, 2025
2 parents bf28c64 + a4b4afa commit 3d716c1
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 1 deletion.
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

0 comments on commit 3d716c1

Please sign in to comment.