Added method to get total number of tasks from nested composite tasks