1) The (when, perform) structure would be basic for all rules?
Yes, there are actually a few more structures:
.addRule()
.when() // if
.perform() // then
.otherwise() // else
2) This seems like it will build object tree, which will then be
processed, right? No space for custom code?
You can already do exactly what you just suggested :) Custom code is no problem, it just accepts an object like any normal Java code - it's just Java.
3) Isn't that a fluent API overuse? How about something like:
I don't know what you are referring to here as overuse, but yes, I am exaggerating the use of the fluent API to make a point. The rules could be completely un-fluent and still use these same APIs. I'm not sure I see the point/difference of the sample you've shown.
I agree, some kind of more general structure here would probably be better.
5) Could the variable be filled outside .when () ? But perhaps just a
matter of taste.
Absolutely you could - and yes, it's all a matter of taste :)