CBPWorkflowTemplateLoader :: ParceWorkflowTemplate: Bitrix method

      
<?php 
//  CBPWorkflowTemplateLoader :: ParceWorkflowTemplate()
//  /dist/bitrix/modules/bizproc/classes/general/workflowtemplateloader.php:319

    
private function ParceWorkflowTemplate($arWorkflowTemplate, &$arActivityNamesCBPActivity $parentActivity null)
    {
        if (!
is_array($arWorkflowTemplate))
            throw new 
CBPArgumentOutOfRangeException("arWorkflowTemplate");

        foreach (
$arWorkflowTemplate as $activityFormatted)
        {
            if (
in_array($activityFormatted["Name"], $arActivityNames))
                throw new 
Exception("DuplicateActivityName");

            
$arActivityNames[] = $activityFormatted["Name"];
            
$activity $this->CreateActivity($activityFormatted["Type"], $activityFormatted["Name"]);
            if (
$activity == null)
                throw new 
Exception("Activity is not found.");

            
$activity->InitializeFromArray($activityFormatted["Properties"]);
            if (
$parentActivity)
                
$parentActivity->FixUpParentChildRelationship($activity);

            if (
$activityFormatted["Children"])
                
$this->ParceWorkflowTemplate($activityFormatted["Children"], $arActivityNames$activity);
        }

        return 
$activity;
    }