How to use Java class for Flow Condition Type?

I’m new to BPMN & DMN but I don’t think I can put that looping logic inside a DMN. The DMN is where the records/values are set but then I need to loop through those to see what is set. I think I need code to do this.