Struggling migrating of JS rules from openHAB 3 to 4

Just giving you some ideas of how it would look like in JRuby:

Nashorn JS JRuby
itemRegistry.getItem("someItemName").getState(); someItemName.state
events.sendCommand(someItem, ON); someItem.on
if (someItem.getState() === ON) if someItem.on?

See item state
var MemberList = Java.from(itemRegistry.getItem(groupItemName).members); member_list = groupItemName.members
var HomeLocation = new PointType(new DecimalType(21.12345), new DecimalType(10.853317)); home_location = PointType.new(21.12345, 10.853317)

The number of members:

NetworkDevicesOnline.members.size # The number of members
NetworkDevicesOnline.members.select(&:on?).size # The number of members that are in the ON state

See:

If you post some of your actual rules, I’ll be happy to convert them for you into jruby to get you started.