Just a tiny note since I’m here.
Don’t force variable to primitives unless absolutely required. It greatly increases the amount of time required to parse the .rules files (it could add minutes or more in some circumstances).
And in this case it’s pointless. The result of TaskNum - 100 is going to be a BigDecimal anyway. So just let OH handle the types.
TasNum = item.state as Number
Also, this doesn’t help you with Rules DSL rules, but for those using the OH 3 Rules Engine (aka. NGRE) there is access to Item metadata in the rules. So you could put the mapping between Items in the Item definition. See Design Pattern: Using Item Metadata as an Alternative to Several DPs. A good example of using it for this kind of mapping is in Design Pattern: Debounce.