public function apply(WorkflowHistory $history)
 {
     $activity = $this->getAttribute(['activityType', 'name']) . '-' . $this->getAttribute(['activityType', 'version']);
     $cause = $this->getAttribute('cause');
     $history->setActivityFailed();
     $history->setWorkflowFailed('Unable to schedule activity task: ' . $activity . ' (' . $cause . ')');
 }
 public function apply(WorkflowHistory $history)
 {
     $reason = $this->getAttribute('reason');
     if ($details = $this->getAttribute('details', null)) {
         $reason .= ' (' . $details . ')';
     }
     if ($cause = $this->getAttribute('cause', null)) {
         $reason .= ' (Cause: ' . $cause . ')';
     }
     $history->setTimeEnded($this->timestamp);
     $history->setWorkflowFailed('Terminated: ' . $reason);
 }
 public function apply(WorkflowHistory $history)
 {
     $history->setTimeEnded($this->timestamp);
     $history->setWorkflowFailed('Cancelled: ' . $this->getAttribute('details'));
 }
 public function apply(WorkflowHistory $history)
 {
     $history->setTimeEnded($this->timestamp);
     $history->setWorkflowFailed('Timeout: ' . $this->getAttribute('timeoutType'));
 }