Perform the following steps to exit a Project based on the value of a variable.
From within the Project Designer page, expand the Job Control folder in the Component Library, and then drag the Exit Project task to the Project Outline.
On the Control tab of the Exit Project task, specify the Execute Only If condition for when the Project should exit.