Xtend Scripts vs JSR223?

I’m a professional software developer and I’ve been able to survive using xtend, but when I found jsr223 in openhab 1 I was so much happier. I shared a rule I wrote in Javascript that I just couldn’t do in a similar way in xtend without a lot of extra and duplicate code. Here it is: General Scene Rule for jsr223

One of the things I really appreciated about it was the fact that I could define any arbitrary data structure for a particular problem and then use that to create rules, even based on the data structure. So in the example above I had an array of objects that included item names. I could then use those item names in each object to create a rule trigger. As far as I know (and I could be ignorant) it is not possible to do in xtend and each item I want to trigger the rule would need to be explicitly included as a trigger somewhere in one of the rules.

After I upgraded to openhab 2, jsr223 wasn’t quite ready to use at the time so I went back to xtend. Most of my rules are not bad in xtend, but I just recently had a doozie. I was setting up my house to open or close vents based on temperature sensors in each room and the operating state of the thermostat. I ended up copying and pasting the same complex rule for each room, after making sure the first was well debugged. I just did a text search and replace for the copies to replace office with bedroom for example. Using jsr223, which I believe is working better now and I will probably eventually switch back to, I could create a data structure defining each room and make one rule with various triggers determined from the data structure. This is just much easier for me and the way that I like to think about problems.