generateCompoundIterativeTask(): added check for restart

Change-Id: I6274d77b62414671313db76f7320950678ee7996