Skip to content

Commit

Permalink
fix(protocol): add getActivatedElementInstanceKeys to interface
Browse files Browse the repository at this point in the history
This method needs to be part of the interface in order for the ElasticSearchIT to generate a record containing this field, and verifying exporting works as expected.
  • Loading branch information
remcowesterhoud committed Oct 17, 2022
1 parent 1e2141e commit c3acb60
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ public List<ProcessInstanceModificationActivateInstructionValue> getActivateInst
.toList();
}

@Override
public Set<Long> getActivatedElementInstanceKeys() {
return activatedElementInstanceKeys.stream()
.map(LongValue::getValue)
.collect(Collectors.toSet());
}

/** Returns true if this record has terminate instructions, otherwise false. */
@JsonIgnore
public boolean hasTerminateInstructions() {
Expand All @@ -104,12 +111,6 @@ public ProcessInstanceModificationRecord addActivateInstruction(
return this;
}

public Set<Long> getActivatedElementInstanceKeys() {
return activatedElementInstanceKeys.stream()
.map(LongValue::getValue)
.collect(Collectors.toSet());
}

public ProcessInstanceModificationRecord addActivatedElementInstanceKey(final long key) {
activatedElementInstanceKeys.add().setValue(key);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.camunda.zeebe.protocol.record.RecordValue;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.immutables.value.Value;

@Value.Immutable
Expand All @@ -32,6 +33,8 @@ public interface ProcessInstanceModificationRecordValue
/** Returns a list of activate instructions (if available), or an empty list. */
List<ProcessInstanceModificationActivateInstructionValue> getActivateInstructions();

Set<Long> getActivatedElementInstanceKeys();

@Value.Immutable
@ImmutableProtocol(
builder = ImmutableProcessInstanceModificationTerminateInstructionValue.Builder.class)
Expand Down

0 comments on commit c3acb60

Please sign in to comment.