Skip to content

Commit 244c6f3

Browse files
committed
Include WorkflowInstanceId and TaskId in the md.workflow.request event
Signed-off-by: Victor Chang <[email protected]>
1 parent adc1098 commit 244c6f3

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/InformaticsGateway/Services/Connectors/PayloadNotificationActionHandler.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ private async Task NotifyPayloadReady(Payload payload)
114114
Timestamp = payload.DateTimeCreated,
115115
CalledAeTitle = payload.CalledAeTitle,
116116
CallingAeTitle = payload.CallingAeTitle,
117+
WorkflowInstanceId = payload.WorkflowInstanceId,
118+
TaskId = payload.TaskId,
117119
};
118120

119121
workflowRequest.AddFiles(payload.GetUploadedFiles().AsEnumerable());

tests/Integration.Test/StepDefinitions/RemoteAppExecutionPlugInsStepDefinitions.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public class RemoteAppExecutionPlugInsStepDefinitions
5454
private readonly RabbitMQMessagePublisherService _messagePublisher;
5555
private readonly InformaticsGatewayConfiguration _informaticsGatewayConfiguration;
5656
private Dictionary<string, DicomFile> _originalDicomFiles;
57+
private ExportRequestEvent _exportRequestEvent;
5758
private readonly Assertions _assertions;
5859

5960
public RemoteAppExecutionPlugInsStepDefinitions(
@@ -113,7 +114,7 @@ public async Task AStudyThatIsExportedToTheTestHost()
113114
await _dataSinkMinio.SendAsync(_dataProvider);
114115

115116
// Emit a export request event
116-
var exportRequestEvent = new ExportRequestEvent
117+
_exportRequestEvent = new ExportRequestEvent
117118
{
118119
CorrelationId = Guid.NewGuid().ToString(),
119120
Destinations = new[] { _dicomDestination },
@@ -123,12 +124,12 @@ public async Task AStudyThatIsExportedToTheTestHost()
123124
WorkflowInstanceId = Guid.NewGuid().ToString(),
124125
};
125126

126-
exportRequestEvent.PluginAssemblies.Add(typeof(ExternalAppOutgoing).AssemblyQualifiedName);
127+
_exportRequestEvent.PluginAssemblies.Add(typeof(ExternalAppOutgoing).AssemblyQualifiedName);
127128

128129
var message = new JsonMessage<ExportRequestEvent>(
129-
exportRequestEvent,
130+
_exportRequestEvent,
130131
MessageBrokerConfiguration.InformaticsGatewayApplicationId,
131-
exportRequestEvent.CorrelationId,
132+
_exportRequestEvent.CorrelationId,
132133
string.Empty);
133134

134135
_receivedExportCompletedMessages.ClearMessages();
@@ -222,6 +223,11 @@ await storeScu.SendAsync(
222223
[Then(@"ensure the original study and the received study are the same")]
223224
public async Task EnsureTheOriginalStudyAndTheReceivedStudyAreTheSameAsync()
224225
{
226+
var workflowRequestEvent = _receivedWorkflowRequestMessages.Messages[0].ConvertTo<WorkflowRequestEvent>();
227+
_exportRequestEvent.CorrelationId.Should().Be(_receivedWorkflowRequestMessages.Messages[0].CorrelationId);
228+
_exportRequestEvent.CorrelationId.Should().Be(workflowRequestEvent.CorrelationId);
229+
_exportRequestEvent.WorkflowInstanceId.Should().Be(workflowRequestEvent.WorkflowInstanceId);
230+
_exportRequestEvent.ExportTaskId.Should().Be(workflowRequestEvent.TaskId);
225231
await _assertions.ShouldRestoreAllDicomMetaata(_receivedWorkflowRequestMessages.Messages, _originalDicomFiles, DefaultDicomTags.ToArray()).ConfigureAwait(false);
226232
}
227233
}

0 commit comments

Comments
 (0)