From d805500871e97d01f1313812aa3f0a54ccfb829a Mon Sep 17 00:00:00 2001 From: Neil South Date: Fri, 21 Jul 2023 10:45:23 +0100 Subject: [PATCH 1/2] adding new fields to messages for external app executions Signed-off-by: Neil South --- src/Messaging/Common/ExportRequestType.cs | 9 +++++++++ src/Messaging/Events/ExportRequestEvent.cs | 10 ++++++++++ src/Messaging/Events/WorkflowRequestEvent.cs | 8 ++++++++ 3 files changed, 27 insertions(+) create mode 100755 src/Messaging/Common/ExportRequestType.cs mode change 100644 => 100755 src/Messaging/Events/ExportRequestEvent.cs mode change 100644 => 100755 src/Messaging/Events/WorkflowRequestEvent.cs diff --git a/src/Messaging/Common/ExportRequestType.cs b/src/Messaging/Common/ExportRequestType.cs new file mode 100755 index 0000000..aae8514 --- /dev/null +++ b/src/Messaging/Common/ExportRequestType.cs @@ -0,0 +1,9 @@ + +namespace Monai.Deploy.Messaging.Common +{ + public enum ExportRequestType + { + None = 0, + ExternalProcessing + } +} diff --git a/src/Messaging/Events/ExportRequestEvent.cs b/src/Messaging/Events/ExportRequestEvent.cs old mode 100644 new mode 100755 index 71388f3..4c2d620 --- a/src/Messaging/Events/ExportRequestEvent.cs +++ b/src/Messaging/Events/ExportRequestEvent.cs @@ -15,6 +15,7 @@ */ using System.ComponentModel.DataAnnotations; +using Monai.Deploy.Messaging.Common; using Newtonsoft.Json; namespace Monai.Deploy.Messaging.Events @@ -75,6 +76,15 @@ public class ExportRequestEvent : EventBase /// public List ErrorMessages { get; private set; } + /// + /// Gets or set the ExportRequest type. + /// For standard exports this will be ExportRequestType.None + /// but for exports to external apps this will be ExportRequestType.ExternalProcessing + /// + [JsonProperty(PropertyName = "export_request")] + [Required] + public ExportRequestType ExportRequest { get; set; } = default!; + public ExportRequestEvent() { ErrorMessages = new List(); diff --git a/src/Messaging/Events/WorkflowRequestEvent.cs b/src/Messaging/Events/WorkflowRequestEvent.cs old mode 100644 new mode 100755 index b437233..6a58f61 --- a/src/Messaging/Events/WorkflowRequestEvent.cs +++ b/src/Messaging/Events/WorkflowRequestEvent.cs @@ -81,6 +81,14 @@ public class WorkflowRequestEvent : EventBase [Required] public DateTime Timestamp { get; set; } + /// + /// Sets the workflow instance ID for the Workflow Manager. + /// This is only applicable to resume events (after external app executions) + /// In standard workflows this will not be set + /// + [JsonProperty(PropertyName = "workflow_instance_id")] + public string? WorkflowInstanceId { get; set; } = default; + /// /// Gets or sets a list of files and metadata files in this request. /// From d29582ba9cdb7dcb0cb0be37c59d51f7eb37eb50 Mon Sep 17 00:00:00 2001 From: Neil South Date: Fri, 21 Jul 2023 11:17:28 +0100 Subject: [PATCH 2/2] added forgot licence header Signed-off-by: Neil South --- src/Messaging/Common/ExportRequestType.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Messaging/Common/ExportRequestType.cs b/src/Messaging/Common/ExportRequestType.cs index aae8514..7309685 100755 --- a/src/Messaging/Common/ExportRequestType.cs +++ b/src/Messaging/Common/ExportRequestType.cs @@ -1,4 +1,18 @@ - +/* + * Copyright 2023 MONAI Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ namespace Monai.Deploy.Messaging.Common { public enum ExportRequestType