CBPAllStateService :: DeleteWorkflow: Bitrix method

      
<?php 
//  CBPAllStateService :: DeleteWorkflow()
//  /dist/bitrix/modules/bizproc/classes/general/stateservice.php:130

    
public static function DeleteWorkflow($workflowId)
    {
        global 
$DB;

        
$workflowId trim($workflowId);
        if (
strlen($workflowId) <= 0)
            throw new 
Exception("workflowId");

        
$info self::getWorkflowStateInfo($workflowId);
        if (!empty(
$info['STARTED_BY']))
            
self::cleanRunningCountersCache($info['STARTED_BY']);

        
$DB->Query(
            
"DELETE FROM b_bp_workflow_permissions ".
            
"WHERE WORKFLOW_ID = '".$DB->ForSql($workflowId)."' "
        
);

        
$DB->Query(
            
"DELETE FROM b_bp_workflow_state ".
            
"WHERE ID = '".$DB->ForSql($workflowId)."' "
        
);
    }