diff --git a/internal/workflow/preprocessing.go b/internal/workflow/preprocessing.go index 91bd752e..c84ea50a 100644 --- a/internal/workflow/preprocessing.go +++ b/internal/workflow/preprocessing.go @@ -230,8 +230,12 @@ func (w *PreprocessingWorkflow) Execute( return result, nil } + // Write PREMIS XML. + ev = result.newEvent(ctx, "Create premis.xml") if e = writePREMISFile(ctx, identifySIP.SIP); e != nil { - return nil, e + result.systemError(ctx, e, ev, "premis.xml creation has failed") + } else { + ev.Succeed(ctx, "Created a premis.xml and stored in metadata directory") } // Re-structure SIP. diff --git a/internal/workflow/preprocessing_test.go b/internal/workflow/preprocessing_test.go index b5f3435e..05d320be 100644 --- a/internal/workflow/preprocessing_test.go +++ b/internal/workflow/preprocessing_test.go @@ -414,6 +414,13 @@ func (s *PreprocessingTestSuite) TestPreprocessingWorkflowSuccess() { StartedAt: testTime, CompletedAt: testTime, }, + { + Name: "Create premis.xml", + Message: "Created a premis.xml and stored in metadata directory", + Outcome: enums.EventOutcomeSuccess, + StartedAt: testTime, + CompletedAt: testTime, + }, { Name: "Restructure SIP", Message: "SIP has been restructured",