User cannot use Java code inside “when” part of the rules. However, it can be use in the “then” part.