Skip to content

Commit

Permalink
Merge remote-tracking branch 'zeebe/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
nitram509 committed Jan 6, 2024
2 parents 772289e + 87a4eff commit c14f7a3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.zeebe</groupId>
<artifactId>zeebe-simple-monitor</artifactId>
<version>2.5.3-2-SNAPSHOT</version>
<version>2.6.2-SNAPSHOT</version>
<packaging>jar</packaging>

<parent>
Expand All @@ -19,7 +19,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<zeebe.version>8.3.4</zeebe.version>
<version.zeebe.spring>8.3.4.3</version.zeebe.spring>
<version.zeebe.spring>8.3.4.5</version.zeebe.spring>
<hazelcast.exporter.version>1.4.0</hazelcast.exporter.version>

<querydsl.version>5.0.0</querydsl.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
package io.zeebe.monitor.repository;

import io.zeebe.monitor.entity.VariableEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;

public interface VariableRepository extends PagingAndSortingRepository<VariableEntity, String>, CrudRepository<VariableEntity, String> {
import java.util.List;

Page<VariableEntity> findByProcessInstanceKey(long processInstanceKey, Pageable pageable);
public interface VariableRepository extends CrudRepository<VariableEntity, String> {

List<VariableEntity> findByProcessInstanceKeyOrderByTimestampAscIdAsc(long processInstanceKey);

long countByProcessInstanceKey(long processInstanceKey);
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected void fillViewDetailsIntoDto(
Pageable pageable,
ProcessInstanceDto dto) {
final Map<VariableTuple, List<VariableEntity>> variablesByScopeAndName =
variableRepository.findByProcessInstanceKey(instance.getKey(), pageable).stream()
variableRepository.findByProcessInstanceKeyOrderByTimestampAscIdAsc(instance.getKey()).stream()
.collect(Collectors.groupingBy(v -> new VariableTuple(v.getScopeKey(), v.getName())));
variablesByScopeAndName.forEach(
(scopeKeyName, variables) -> {
Expand Down Expand Up @@ -87,7 +87,7 @@ protected void fillViewDetailsIntoDto(
});

final long count = variableRepository.countByProcessInstanceKey(instance.getKey());
addPaginationToModel(model, pageable, count);
addPaginationToModel(model, Pageable.ofSize(Integer.MAX_VALUE), count);
}

private static class VariableTuple {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

import io.zeebe.monitor.entity.ProcessEntity;
import io.zeebe.monitor.entity.ProcessInstanceEntity;

import java.util.Collections;
import java.util.Optional;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand All @@ -24,8 +26,8 @@ public class InstancesVariableListControllerTest extends AbstractViewOrResourceT
public void setUp() {
when(processRepository.findAll(any(Pageable.class))).thenReturn(Page.empty());
when(elementInstanceRepository.findByProcessInstanceKey(anyLong())).thenReturn(Page.empty());
when(variableRepository.findByProcessInstanceKey(anyLong(), any(Pageable.class)))
.thenReturn(Page.empty());
when(variableRepository.findByProcessInstanceKeyOrderByTimestampAscIdAsc(anyLong()))
.thenReturn(Collections.emptyList());
}

@Test
Expand Down

0 comments on commit c14f7a3

Please sign in to comment.