Skip to content

Commit

Permalink
Merge pull request #205 from Project-MONAI/AI-137-nds
Browse files Browse the repository at this point in the history
adding new fields to messages for external app executions
  • Loading branch information
neildsouth authored Jul 21, 2023
2 parents 8f81687 + d29582b commit 22cd551
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/Messaging/Common/ExportRequestType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* 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
{
None = 0,
ExternalProcessing
}
}
10 changes: 10 additions & 0 deletions src/Messaging/Events/ExportRequestEvent.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

using System.ComponentModel.DataAnnotations;
using Monai.Deploy.Messaging.Common;
using Newtonsoft.Json;

namespace Monai.Deploy.Messaging.Events
Expand Down Expand Up @@ -75,6 +76,15 @@ public class ExportRequestEvent : EventBase
/// </summary>
public List<string> ErrorMessages { get; private set; }

/// <summary>
/// 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
/// </summary>
[JsonProperty(PropertyName = "export_request")]
[Required]
public ExportRequestType ExportRequest { get; set; } = default!;

public ExportRequestEvent()
{
ErrorMessages = new List<string>();
Expand Down
8 changes: 8 additions & 0 deletions src/Messaging/Events/WorkflowRequestEvent.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ public class WorkflowRequestEvent : EventBase
[Required]
public DateTime Timestamp { get; set; }

/// <summary>
/// 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
/// </summary>
[JsonProperty(PropertyName = "workflow_instance_id")]
public string? WorkflowInstanceId { get; set; } = default;

/// <summary>
/// Gets or sets a list of files and metadata files in this request.
/// </summary>
Expand Down

0 comments on commit 22cd551

Please sign in to comment.