Adding logik in java rewrite engine