First of all have you reviewed [wiki] Getting Started with OH3: rewriting the tutorial - 8. Rules
The rule trigger isn’t covered in Blockly. That’s done outside the script action.
At a high level you want to put all your door is and window Items into a Group. it Then you can use Design Pattern: Working with Groups in Rules to filter and create a single message with all the open windows and doors.