code: def cancel(self, success=False):
          
          self.success = success
          cancel = []
          mask = Task.NOT_FINISHED_MASK
          for task in Task.Iterator(self.task_tree, mask):
              cancel.append(task)
          for task in cancel:
              task.cancel()
docs: Cancels all open tasks in the workflow.
  
          :type  success: bool
          :param success: Whether the Workflow should be marked as successfully
                          completed.