Skip to content

Commit 37e36b7

Browse files
authored
pass workflow id in alert constructors (#465)
Signed-off-by: Surya Sashank Nistala <[email protected]>
1 parent 110bf01 commit 37e36b7

File tree

1 file changed

+10
-10
lines changed
  • src/main/kotlin/org/opensearch/commons/alerting/model

1 file changed

+10
-10
lines changed

src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ data class Alert(
7979
actionExecutionResults: List<ActionExecutionResult> = mutableListOf(),
8080
schemaVersion: Int = NO_SCHEMA_VERSION,
8181
executionId: String? = null,
82-
workflow: Workflow? = null,
82+
workflowId: String? = null,
8383
) : this(
8484
monitorId = monitor.id, monitorName = monitor.name, monitorVersion = monitor.version, monitorUser = monitor.user,
8585
triggerId = trigger.id, triggerName = trigger.name, state = state, startTime = startTime,
8686
lastNotificationTime = lastNotificationTime, errorMessage = errorMessage, errorHistory = errorHistory,
8787
severity = trigger.severity, actionExecutionResults = actionExecutionResults, schemaVersion = schemaVersion,
8888
aggregationResultBucket = null, findingIds = emptyList(), relatedDocIds = emptyList(),
89-
executionId = executionId, workflowId = workflow?.id ?: ""
89+
executionId = executionId, workflowId = workflowId ?: ""
9090
)
9191

9292
constructor(
@@ -101,14 +101,14 @@ data class Alert(
101101
schemaVersion: Int = NO_SCHEMA_VERSION,
102102
findingIds: List<String> = emptyList(),
103103
executionId: String? = null,
104-
workflow: Workflow? = null,
104+
workflowId: String? = null,
105105
) : this(
106106
monitorId = monitor.id, monitorName = monitor.name, monitorVersion = monitor.version, monitorUser = monitor.user,
107107
triggerId = trigger.id, triggerName = trigger.name, state = state, startTime = startTime,
108108
lastNotificationTime = lastNotificationTime, errorMessage = errorMessage, errorHistory = errorHistory,
109109
severity = trigger.severity, actionExecutionResults = actionExecutionResults, schemaVersion = schemaVersion,
110110
aggregationResultBucket = null, findingIds = findingIds, relatedDocIds = emptyList(),
111-
executionId = executionId, workflowId = workflow?.id ?: ""
111+
executionId = executionId, workflowId = workflowId ?: ""
112112
)
113113

114114
constructor(
@@ -124,14 +124,14 @@ data class Alert(
124124
aggregationResultBucket: AggregationResultBucket,
125125
findingIds: List<String> = emptyList(),
126126
executionId: String? = null,
127-
workflow: Workflow? = null,
127+
workflowId: String? = null,
128128
) : this(
129129
monitorId = monitor.id, monitorName = monitor.name, monitorVersion = monitor.version, monitorUser = monitor.user,
130130
triggerId = trigger.id, triggerName = trigger.name, state = state, startTime = startTime,
131131
lastNotificationTime = lastNotificationTime, errorMessage = errorMessage, errorHistory = errorHistory,
132132
severity = trigger.severity, actionExecutionResults = actionExecutionResults, schemaVersion = schemaVersion,
133133
aggregationResultBucket = aggregationResultBucket, findingIds = findingIds, relatedDocIds = emptyList(),
134-
executionId = executionId, workflowId = workflow?.id ?: ""
134+
executionId = executionId, workflowId = workflowId ?: ""
135135
)
136136

137137
constructor(
@@ -148,14 +148,14 @@ data class Alert(
148148
actionExecutionResults: List<ActionExecutionResult> = mutableListOf(),
149149
schemaVersion: Int = NO_SCHEMA_VERSION,
150150
executionId: String? = null,
151-
workflow: Workflow? = null,
151+
workflowId: String? = null,
152152
) : this(
153153
id = id, monitorId = monitor.id, monitorName = monitor.name, monitorVersion = monitor.version, monitorUser = monitor.user,
154154
triggerId = trigger.id, triggerName = trigger.name, state = state, startTime = startTime,
155155
lastNotificationTime = lastNotificationTime, errorMessage = errorMessage, errorHistory = errorHistory,
156156
severity = trigger.severity, actionExecutionResults = actionExecutionResults, schemaVersion = schemaVersion,
157157
aggregationResultBucket = null, findingIds = findingIds, relatedDocIds = relatedDocIds,
158-
executionId = executionId, workflowId = workflow?.id ?: ""
158+
executionId = executionId, workflowId = workflowId ?: ""
159159
)
160160

161161
constructor(
@@ -168,14 +168,14 @@ data class Alert(
168168
errorMessage: String,
169169
errorHistory: List<AlertError> = mutableListOf(),
170170
schemaVersion: Int = NO_SCHEMA_VERSION,
171-
workflow: Workflow? = null,
171+
workflowId: String? = null,
172172
) : this(
173173
id = id, monitorId = monitor.id, monitorName = monitor.name, monitorVersion = monitor.version, monitorUser = monitor.user,
174174
triggerId = trigger.id, triggerName = trigger.name, state = state, startTime = startTime,
175175
lastNotificationTime = lastNotificationTime, errorMessage = errorMessage, errorHistory = errorHistory,
176176
severity = trigger.severity, actionExecutionResults = listOf(), schemaVersion = schemaVersion,
177177
aggregationResultBucket = null, findingIds = listOf(), relatedDocIds = listOf(),
178-
workflowId = workflow?.id ?: ""
178+
workflowId = workflowId ?: ""
179179
)
180180

181181
enum class State {

0 commit comments

Comments
 (0)