Skip to content

Commit

Permalink
merge: #10734
Browse files Browse the repository at this point in the history
10734: [Backport stable/8.1] Add activatedElementInstanceKeys to modification record template r=remcowesterhoud a=backport-action

# Description
Backport of #10733 to `stable/8.1`.

relates to #10732

Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
  • Loading branch information
zeebe-bors-camunda[bot] and remcowesterhoud committed Oct 17, 2022
2 parents 2d58ea0 + eaca172 commit c5c8e69
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 c5c8e69

Please sign in to comment.