OK, that’s the root cause of the problem. Indeed it’s failing to initialize “theArray” variables. Why?
It seems like it’s not liking “newArrayList” perhaps? There are lots of other ways to create and initialize an ArrayList in Rules DSL. How to define global variables in Rules? shows one.