0

The problem is that the cube filter uses loadContext . But I redefine the method responsible for loading data and do not use loadcontext, but form a response for the front in the program. How do I apply a filter?

    @Install(to = "workProcessesDl", target = Target.DATA_LOADER)
    private List<ContractHistoryWorkProcess> workProcessesDlLoadDelegate(LoadContext<ContractHistoryWorkProcess> loadContext) {

        return getEditedEntity().getCustomers().stream().flatMap(c -> c.getFacilities().stream()).flatMap(
                f -> f.getWorkProcesses().stream()).collect(Collectors.toList());
    }

I want to apply a filter to the collection that I'm forming, which is set by the user. But the problem is that the filters work with the database, and my collection is formed programmatically, without queries to the database.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Buba
  • 101
  • 7
  • Are you getting an error message? If you are, please put the exact wording of the error message in your post. – Robert Harvey Apr 21 '22 at 12:40
  • There is no mistake. It's just that I want to apply a filter to the collection that I'm forming, which is set by the user. But the problem is that the filters work with the database, and my collection is formed programmatically, without queries to the database – Buba Apr 21 '22 at 12:46
  • Won't Java Streams work for any collection in Java? Pretty sure you don't need a database connection to make them work. – Robert Harvey Apr 21 '22 at 12:49
  • I want to change this filter to my collection https://doc.cuba-platform.com/manual-latest/gui_Filter.html – Buba Apr 21 '22 at 12:52

0 Answers0