feat: expose iteration/iterationSize fields for diagram overlay
All checks were successful
CI / cleanup-branch (push) Has been skipped
CI / build (push) Successful in 1m12s
CI / docker (push) Successful in 1m5s
CI / deploy-feature (push) Has been skipped
CI / deploy (push) Successful in 52s

Replace synthetic wrapper node approach with direct iteration fields:
- ProcessorNode gains iteration (child's index) and iterationSize
  (container's total) fields, populated from ClickHouse flat records
- Frontend hooks detect iteration containers from iterationSize != null
  instead of scanning for wrapper processorTypes
- useExecutionOverlay filters children by iteration field instead of
  wrapper nodes, eliminating ITERATION_WRAPPER_TYPES entirely
- Cleaner data contract: API returns exactly what the DB stores

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-01 17:14:36 +02:00
parent e8f9ada1d1
commit cf439248b5
7 changed files with 61 additions and 83 deletions

View File

@@ -101,7 +101,7 @@ public class DetailService {
p.getDurationMs(),
p.getErrorMessage(), p.getErrorStackTrace(),
p.getAttributes() != null ? new LinkedHashMap<>(p.getAttributes()) : null,
null, null, null, null, null,
null, null, null, null, null, null, null,
p.getResolvedEndpointUri(),
p.getErrorType(), p.getErrorCategory(),
p.getRootCauseType(), p.getRootCauseMessage(),
@@ -144,7 +144,7 @@ public class DetailService {
p.errorMessage(), p.errorStacktrace(),
parseAttributes(p.attributes()),
p.iteration(), p.iterationSize(),
null, null, null,
null, null, null, null, null,
p.resolvedEndpointUri(),
p.errorType(), p.errorCategory(),
p.rootCauseType(), p.rootCauseMessage(),
@@ -188,6 +188,7 @@ public class DetailService {
p.durationMs() != null ? p.durationMs() : 0L,
p.errorMessage(), p.errorStacktrace(),
parseAttributes(p.attributes()),
null, null,
p.loopIndex(), p.loopSize(),
p.splitIndex(), p.splitSize(),
p.multicastIndex(),

View File

@@ -22,6 +22,8 @@ public final class ProcessorNode {
private final String errorMessage;
private final String errorStackTrace;
private final Map<String, String> attributes;
private final Integer iteration;
private final Integer iterationSize;
private final Integer loopIndex;
private final Integer loopSize;
private final Integer splitIndex;
@@ -44,6 +46,7 @@ public final class ProcessorNode {
Instant startTime, Instant endTime, long durationMs,
String errorMessage, String errorStackTrace,
Map<String, String> attributes,
Integer iteration, Integer iterationSize,
Integer loopIndex, Integer loopSize,
Integer splitIndex, Integer splitSize,
Integer multicastIndex,
@@ -63,6 +66,8 @@ public final class ProcessorNode {
this.errorMessage = errorMessage;
this.errorStackTrace = errorStackTrace;
this.attributes = attributes;
this.iteration = iteration;
this.iterationSize = iterationSize;
this.loopIndex = loopIndex;
this.loopSize = loopSize;
this.splitIndex = splitIndex;
@@ -95,6 +100,8 @@ public final class ProcessorNode {
public String getErrorMessage() { return errorMessage; }
public String getErrorStackTrace() { return errorStackTrace; }
public Map<String, String> getAttributes() { return attributes; }
public Integer getIteration() { return iteration; }
public Integer getIterationSize() { return iterationSize; }
public Integer getLoopIndex() { return loopIndex; }
public Integer getLoopSize() { return loopSize; }
public Integer getSplitIndex() { return splitIndex; }

View File

@@ -192,17 +192,23 @@ class TreeReconstructionTest {
@Test
void buildTree_seqBasedModel_iterationFields() {
// Verify iteration/iterationSize are populated as loopIndex/loopSize
// Verify iteration/iterationSize are populated on the correct nodes
List<ProcessorRecord> processors = List.of(
procWithSeq("loop1", "loop", "COMPLETED", 1, null, null, null),
procWithSeq("body", "log", "COMPLETED", 2, 1, 5, 10)
procWithSeq("split1", "split", "COMPLETED", 1, null, null, 3),
procWithSeq("body", "log", "COMPLETED", 2, 1, 0, null),
procWithSeq("body", "log", "COMPLETED", 3, 1, 1, null),
procWithSeq("body", "log", "COMPLETED", 4, 1, 2, null)
);
List<ProcessorNode> roots = detailService.buildTree(processors);
assertThat(roots).hasSize(1);
ProcessorNode child = roots.get(0).getChildren().get(0);
assertThat(child.getLoopIndex()).isEqualTo(5);
assertThat(child.getLoopSize()).isEqualTo(10);
ProcessorNode container = roots.get(0);
assertThat(container.getIterationSize()).isEqualTo(3);
assertThat(container.getIteration()).isNull();
assertThat(container.getChildren()).hasSize(3);
assertThat(container.getChildren().get(0).getIteration()).isEqualTo(0);
assertThat(container.getChildren().get(1).getIteration()).isEqualTo(1);
assertThat(container.getChildren().get(2).getIteration()).isEqualTo(2);
}
}