How to programmatically stop a migration?
According to my comment on Luke solution, here is the complete code to interrupt you Migration in Migrate these days.

public function preImport() {
  parent::preImport();
  if($this-&gt;externalDependency == 0){
  throw new MigrateException('Dependencies were unfulfilled.');
  }
}

public function postImport() {
  parent::postImport();
  if($this-&gt;externalDependency == 0){
  return false;
  }
  // My code here
}

public function processImport(array $options = array()) {
  try {
    $result = parent::processImport($options);
    return $result;
  }
  catch (MigrateException $e) {
    $this-&gt;endProcess();
    drupal_set_message($e-&gt;getMessage(), 'error');
    return MigrationBase::RESULT_STOPPED;
  }
}