Skip to content

Commit

Permalink
feat(proto): add isInterrupting for subscriptions (#147)
Browse files Browse the repository at this point in the history
* add new property `isInterrupting` for message subscriptions and process message subscriptions
  • Loading branch information
saig0 authored Dec 30, 2021
1 parent a1b23a2 commit c217c97
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/io/zeebe/exporter/proto/RecordTransformer.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ private static Schema.MessageSubscriptionRecord toMessageSubscriptionRecord(
.setBpmnProcessId(value.getBpmnProcessId())
.setMessageKey(value.getMessageKey())
.setVariables(toStruct(value.getVariables()))
.setIsInterrupting(value.isInterrupting())
.setMetadata(toMetadata(record))
.build();
}
Expand Down Expand Up @@ -416,6 +417,7 @@ private static Schema.ProcessMessageSubscriptionRecord toProcessMessageSubscript
.setMessageKey(value.getMessageKey())
.setCorrelationKey(value.getCorrelationKey())
.setElementId(value.getElementId())
.setIsInterrupting(value.isInterrupting())
.setMetadata(toMetadata(record))
.build();
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/proto/schema.proto
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ message MessageSubscriptionRecord {
string bpmnProcessId = 6;
int64 messageKey = 7;
google.protobuf.Struct variables = 8;
bool isInterrupting = 9;
}

message MessageStartEventSubscriptionRecord {
Expand Down Expand Up @@ -260,6 +261,7 @@ message ProcessMessageSubscriptionRecord {
int64 messageKey = 7;
string elementId = 8;
string correlationKey = 9;
bool isInterrupting = 10;
}

message ProcessRecord {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ public void shouldTransformMessageSubscription() {
assertThat(messageSubscriptionRecord.getProcessInstanceKey()).isEqualTo(1L);
assertThat(messageSubscriptionRecord.getBpmnProcessId()).isEqualTo(value.getBpmnProcessId());
assertThat(messageSubscriptionRecord.getMessageKey()).isEqualTo(value.getMessageKey());
assertThat(messageSubscriptionRecord.getIsInterrupting()).isTrue();

assertVariables(messageSubscriptionRecord.getVariables());
}
Expand Down Expand Up @@ -389,6 +390,7 @@ public void shouldTransformProcessMessageSubscription() {
assertThat(workflowInstanceSubscriptionRecord.getCorrelationKey())
.isEqualTo(value.getCorrelationKey());
assertThat(workflowInstanceSubscriptionRecord.getElementId()).isEqualTo(value.getElementId());
assertThat(workflowInstanceSubscriptionRecord.getIsInterrupting()).isTrue();

assertVariables(workflowInstanceSubscriptionRecord.getVariables());
}
Expand Down Expand Up @@ -644,6 +646,7 @@ private MessageSubscriptionRecordValue mockMessageSubscriptionRecordValue() {
when(messageSubscriptionRecordValue.getBpmnProcessId()).thenReturn("bpmnProcessId");
when(messageSubscriptionRecordValue.getMessageKey()).thenReturn(2L);
when(messageSubscriptionRecordValue.getVariables()).thenReturn(Map.of("foo", 23));
when(messageSubscriptionRecordValue.isInterrupting()).thenReturn(true);

return messageSubscriptionRecordValue;
}
Expand All @@ -662,6 +665,7 @@ private ProcessMessageSubscriptionRecordValue mockProcessMessageSubscriptionReco

when(workflowInstanceSubscriptionRecordValue.getVariables())
.thenReturn(Collections.singletonMap("foo", 23));
when(workflowInstanceSubscriptionRecordValue.isInterrupting()).thenReturn(true);

return workflowInstanceSubscriptionRecordValue;
}
Expand Down

0 comments on commit c217c97

Please sign in to comment.