Thank you user202311 and Ngenator, both approaches work very well.
rule-id : index(var.schemas, value) + i + 1
or
rule-id : i * 2 + 1