/** * @return bool|null */ public function start() { parent::start(); switch ($this->Status) { case 'Started': // If we are doing a subtask, check which one to continue switch ($this->Doing) { case 'Deployment': return $this->continueRevertDeploy(); case 'Snapshot': return $this->continueRevertDatabase(); default: $this->log("Unable to process {$this->Title} with subtask of {$this->Doing}"); $this->markFailed(); return false; } case 'Queued': // Begin rollback by initiating deployment return $this->startRevertDeploy(); default: $this->log("Unable to process {$this->Title} with status of {$this->Status}"); $this->markFailed(); return false; } }
public function start() { parent::start(); // Just in case this step is being mistakenly restarted if ($this->hasResponse()) { $this->log("{$this->Title} has already been processed with a response of {$this->Approval}"); $this->markFailed(); return false; } // Begin or process this step switch ($this->Status) { case 'Started': return $this->checkStatus(); case 'Queued': return $this->startApproval(); default: $this->log("Unable to process {$this->Title} with status of {$this->Status}"); $this->markFailed(); return false; } }