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

Reload instance to get the latest data elements, including PDF. #106

Merged
merged 1 commit into from
Dec 8, 2022
Merged
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
7 changes: 6 additions & 1 deletion src/Altinn.App.Core/Implementation/DefaultTaskEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Altinn.App.Core.Internal.AppModel;
using Altinn.App.Core.Internal.Expressions;
using Altinn.App.Core.Internal.Pdf;
using Altinn.App.Core.Models;
using Altinn.Platform.Storage.Interface.Models;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
Expand Down Expand Up @@ -163,7 +164,11 @@ public async Task OnEndProcessTask(string endEvent, Instance instance)
}
if (_appSettings?.EnableEFormidling == true && _appMetadata.EFormidling?.SendAfterTaskId == endEvent && _eFormidlingService != null)
{
await _eFormidlingService.SendEFormidlingShipment(instance);
// The code above updates data elements on the instance. To ensure
// we have the latest instance with all the data elements including pdf,
// we reload the instance before we pass it on to eFormidling.
var updatedInstance = await _instanceClient.GetInstance(instance);
await _eFormidlingService.SendEFormidlingShipment(updatedInstance);
}

if (_appMetadata.AutoDeleteOnProcessEnd)
Expand Down