Within
Evaluates if value is within range of a specified tolerance
value. The value itself can be any numeric value while the
tolerance can be any of the following representations:
5% - op1 is within 5% of op2
[5,20]% - op1 can be lower than op2 by 5% or can be higher than
op2 by upto 20%
10 - op1 can be lower than op2 by 10x
Required Attributes
op1
Identifies the first operand of a conditional tag.
op2
Identifies the second operand of a conditional tag.
Usage Examples
Example #1
<if>
<within op1="${average}" op2="${value}" tolerance="[5,10]%" />
<then>
<log>parameters within tolerance</log>
</then>
<else>
<fail>The average value is more than -5,+10% off from previous value</fail>
</else>
</if>
Example #2
<if>
<within op1="${average}" op2="${value}" tolerance="5%" />
<else>
<fail>The average value is more than 5% off from previous value</fail>
</else>
</if>