Skip to content

Commit 76d725e

Browse files
authored
Merge pull request #237 from Project-MONAI/AI-230
adding fields from workflow request
2 parents cde8157 + e11de4c commit 76d725e

File tree

3 files changed

+72
-13
lines changed

3 files changed

+72
-13
lines changed

src/Messaging/Common/Artifact.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ namespace Monai.Deploy.Messaging.Common
1818
{
1919
public class Artifact
2020
{
21+
/// <summary>
22+
/// Type of the artifact
23+
/// </summary>
2124
public ArtifactType Type { get; set; } = ArtifactType.Unset;
25+
26+
/// <summary>
27+
/// relative path from the bucket to the artifact
28+
/// </summary>
2229
public string Path { get; set; } = string.Empty;
2330
}
2431
}

src/Messaging/Events/ArtifactsReceivedEvent.cs

Lines changed: 62 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,83 @@ namespace Monai.Deploy.Messaging.Events
2424
public class ArtifactsReceivedEvent : EventBase
2525
{
2626
/// <summary>
27-
/// Gets or sets the workflow instanceID generated by the Workflow Manager.
27+
/// Gets or sets the ID of the payload which is also used as the root path of the payload.
2828
/// </summary>
29-
[JsonProperty(PropertyName = "workflow_instance_id")]
30-
[JsonPropertyName("workflow_instance_id")]
29+
[JsonProperty(PropertyName = "payload_id")]
30+
[JsonPropertyName("payload_id")]
3131
[Required]
32-
public string WorkflowInstanceId { get; set; } = default!;
32+
public Guid PayloadId { get; set; }
3333

3434
/// <summary>
35-
/// Gets or sets the export task ID generated by the Workflow Manager.
35+
/// Gets or sets the associated workflows to be launched.
3636
/// </summary>
37-
[JsonProperty(PropertyName = "task_id")]
38-
[JsonPropertyName("task_id")]
37+
[JsonProperty(PropertyName = "workflows")]
38+
[JsonPropertyName("workflows")]
39+
public IEnumerable<string> Workflows { get; set; } = new List<string>();
40+
41+
/// <summary>
42+
/// Gets or sets number of files in the payload.
43+
/// </summary>
44+
[JsonProperty(PropertyName = "file_count")]
45+
[JsonPropertyName("file_count")]
3946
[Required]
40-
public string TaskId { get; set; } = default!;
47+
public int FileCount { get; set; }
4148

4249
/// <summary>
43-
/// Gets or set the correlation ID.
4450
/// For DIMSE, the correlation ID is the UUID associated with the first DICOM association received.
45-
/// For ACR, use the Transaction ID in the original request.
51+
/// For an ACR inference request, the correlation ID is the Transaction ID in the original request.
4652
/// </summary>
4753
[JsonProperty(PropertyName = "correlation_id")]
4854
[JsonPropertyName("correlation_id")]
4955
[Required]
5056
public string CorrelationId { get; set; } = default!;
5157

58+
/// <summary>
59+
/// Gets or set the name of the bucket where the files in are stored.
60+
/// </summary>
61+
[JsonProperty(PropertyName = "bucket")]
62+
[JsonPropertyName("bucket")]
63+
[Required]
64+
public string Bucket { get; set; } = default!;
65+
66+
/// <summary>
67+
/// Gets or sets the service that received the original request.
68+
/// </summary>
69+
[JsonProperty(PropertyName = "trigger")]
70+
[JsonPropertyName("trigger")]
71+
public DataOrigin DataTrigger { get; set; } = default!;
72+
73+
/// <summary>
74+
/// Gets or sets the data origins that were involved in triggering this workflow request.
75+
/// </summary>
76+
[JsonProperty(PropertyName = "data_origins")]
77+
[JsonPropertyName("data_origins")]
78+
public List<DataOrigin> DataOrigins { get; private set; } = new List<DataOrigin>();
79+
80+
/// <summary>
81+
/// Gets or sets the time the data was received.
82+
/// </summary>
83+
[JsonProperty(PropertyName = "timestamp")]
84+
[JsonPropertyName("timestamp")]
85+
[Required]
86+
public DateTime Timestamp { get; set; }
87+
88+
/// <summary>
89+
/// Gets or sets the workflow instanceID generated by the Workflow Manager.
90+
/// </summary>
91+
[JsonProperty(PropertyName = "workflow_instance_id")]
92+
[JsonPropertyName("workflow_instance_id")]
93+
[Required]
94+
public string? WorkflowInstanceId { get; set; } = default!;
95+
96+
/// <summary>
97+
/// Gets or sets the export task ID generated by the Workflow Manager.
98+
/// </summary>
99+
[JsonProperty(PropertyName = "task_id")]
100+
[JsonPropertyName("task_id")]
101+
[Required]
102+
public string? TaskId { get; set; } = default!;
103+
52104
/// <summary>
53105
/// Gets or set the list of artifacts.
54106
/// </summary>

src/Messaging/Events/WorkflowRequestEvent.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ public class DataOrigin
5454
[JsonPropertyName("destination")]
5555
public string Destination { get; set; } = default!;
5656

57-
[JsonProperty(PropertyName = "fromExternalApp")]
58-
[JsonPropertyName("fromExternalApp")]
59-
public bool FromExternalApp { get; set; } = false;
57+
[JsonProperty(PropertyName = "artifactType")]
58+
[JsonPropertyName("artifactType")]
59+
public ArtifactType ArtifactType { get; set; } = ArtifactType.Unset;
6060

6161
public override int GetHashCode()
6262
{

0 commit comments

Comments
 (0)