1. A method for performing a composite task, comprising: determining an undo task for each subtask in a plurality of subtasks for the composite task; performing each subtask in the plurality of subtasks; performing the associated undo task for each subtask that was performed if the performing of any subtask in the plurality of subtasks fails; and wherein a subtask is one of: a local subtask, a distributed subtask, and a composite subtask.