public function FaultActivity(CBPActivity $activity, Exception $e, $arEventParameters = array()) { if ($activity == null) { throw new Exception("activity"); } if ($activity->executionStatus == CBPActivityExecutionStatus::Closed) { if ($activity->parent == null) { $this->Terminate($e); } else { $this->FaultActivity($activity->parent, $e, $arEventParameters); } } else { $activity->SetStatus(CBPActivityExecutionStatus::Faulting); $this->AddItemToQueue(array($activity, CBPActivityExecutorOperationType::HandleFault, $e)); } }