The "If condition did not produce a Boolean value" error was actually somewhat misleading, as there is nothing wrong with the way I've set up the test in the if
element. Here is the problem:
Either the <then>
or <else>
sub-element can be omitted if no action is required under that condition.
The if
command requires either one or both of then
or else
as its children. In this case, the command used as the body of the if
was being treated as a condition, and the error is due to it not having a (boolean) return value.
This works:
<if test="equal" value1="{$m.parent_id}" value2="{$var.tasks-menu-id}">
<then>
<math:increment field="var.tasks-children"/>
</then>
</if>