Give precedence to CRITICAL state in business rules state processing

In current business rules state processing, state is calculated with the maximum value of the state id, which makes UNKNOWN state having precedence over CRITICAL.

This patches gives the highest priority to CRITICAL state in business rule state calculation, if at least one son is in CRITICAL state.