CBPWorkflow :: CloseActivity: Bitrix method

      
<?php 
//  CBPWorkflow :: CloseActivity()
//  /dist/bitrix/modules/bizproc/classes/general/workflow.php:364

    
public function CloseActivity(CBPActivity $activity$arEventParameters = array())
    {
        switch (
$activity->executionStatus)
        {
            case 
CBPActivityExecutionStatus::Executing:
                
$activity->MarkCompleted($arEventParameters);
                return;

            case 
CBPActivityExecutionStatus::Canceling:
                
$activity->MarkCanceled($arEventParameters);
                return;

            case 
CBPActivityExecutionStatus::Closed:
                return;

            case 
CBPActivityExecutionStatus::Faulting:
                
$activity->MarkFaulted($arEventParameters);
                return;
        }

        throw new 
Exception("InvalidClosingState");
    }