Hello,
I would like to process the list of all things in a textual rule and am looking for a possibility that is similar to group.members.forEach[item|… Is there something like that?
Not in DSL, but you may have luck with JSR223, there is an object things
which can be used with a method .getAll
. What I don’t know, though, is the output.
What do you want to achieve?
Just to elaborate here, as @Udo_Hartmann indicates, the ThingRegistry
is not available in Rules DSL. However, it is available in all the other rules languages including Blockly I think,
But, once you have access to the ThingRegistry
, getAllThings()
will give you all the Things as a List/Array (whatever is appropriate for the language). At that point it will be the same as what comes from group.memnbers
and can be processed in similar ways. But those ways will differ from one language to the next. There are examples of processing lists like this for most of the languages at Design Pattern: Working with Groups in Rules.
The syntax is different for the different languages but in general they work mostly the same with filter
, forEach
, map
, reduce
, et. al.