I think you misunderstand how rules work.
All Facts inserted into working memory will be compared to all patterns in
all rules; and where a match is found an activation recorded (i.e. LHS
runs).
So the following would group all products of type (if you insert
DelieveryList's into WM and set
In my opinion it will be much easier if you insert individual Orders and
Products
Here's a hurriedly put together example to help you think in terms of rules
(I have no experience of your problem domain so this might be laughably
wrong):-
Global ArrayList branch1;
rule Delievery split -