Skip to content

Commit

Permalink
merge: #10733
Browse files Browse the repository at this point in the history
10733: Add activatedElementInstanceKeys to modification record template r=saig0 a=remcowesterhoud

## Description

<!-- Please explain the changes you made here. -->
Adds the new `activatedElementInstanceKeys` to the modification record template for ElasticSearch.

## Related issues

<!-- Which issues are closed by this PR or are related -->

closes #10732 



Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
  • Loading branch information
zeebe-bors-camunda[bot] and remcowesterhoud committed Oct 17, 2022
2 parents f0cca91 + c3acb60 commit 7fb27df
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"index_patterns": [
"zeebe-record_process-instance-modification_*"
],
"composed_of": ["zeebe-record"],
"composed_of": [
"zeebe-record"
],
"priority": 20,
"version": 1,
"template": {
Expand Down Expand Up @@ -48,6 +50,9 @@
}
}
}
},
"activatedElementInstanceKeys": {
"type": "long"
}
}
}
Expand Down
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 7fb27df

Please sign in to comment.