public function actionAddAttributeFromTree($type, $treeType, $nodeId, $rowNumber, $trackableStructurePosition = false, $id = null, $isBeingCopied = false)
 {
     $postData = PostUtil::getData();
     $savedWorkflow = null;
     $workflow = null;
     $this->resolveSavedWorkflowAndWorkflowByPostData($postData, $savedWorkflow, $workflow, $type, $id, (bool) $isBeingCopied);
     $nodeIdWithoutTreeType = WorkflowRelationsAndAttributesToTreeAdapter::removeTreeTypeFromNodeId($nodeId, $treeType);
     $moduleClassName = $workflow->getModuleClassName();
     $modelClassName = $moduleClassName::getPrimaryModelName();
     $form = new WizardActiveForm();
     $form->id = WorkflowWizardView::getFormId();
     $form->enableAjaxValidation = true;
     //ensures error validation populates correctly
     $wizardFormClassName = WorkflowToWizardFormAdapter::getFormClassNameByType($workflow->getType());
     $model = ComponentForWorkflowFormFactory::makeByComponentType($moduleClassName, $modelClassName, $workflow->getType(), $treeType);
     $form->modelClassNameForError = $wizardFormClassName;
     $attribute = WorkflowRelationsAndAttributesToTreeAdapter::resolveAttributeByNodeId($nodeIdWithoutTreeType);
     $model->attributeIndexOrDerivedType = WorkflowRelationsAndAttributesToTreeAdapter::resolveAttributeByNodeId($nodeIdWithoutTreeType);
     $inputPrefixData = WorkflowRelationsAndAttributesToTreeAdapter::resolveInputPrefixData($wizardFormClassName, $treeType, (int) $rowNumber);
     $adapter = new WorkflowAttributeToElementAdapter($inputPrefixData, $model, $form, $treeType);
     $view = new AttributeRowForWorkflowComponentView($adapter, (int) $rowNumber, $inputPrefixData, $attribute, (bool) $trackableStructurePosition, true, $treeType);
     $content = $view->render();
     $form->renderAddAttributeErrorSettingsScript($view::getFormId());
     Yii::app()->getClientScript()->setToAjaxMode();
     Yii::app()->getClientScript()->render($content);
     echo $content;
 }
 /**
  * @param integer $rowCount
  * @param array $componentData
  * @param bool $trackableStructurePosition
  * @return array
  */
 protected function renderItems(&$rowCount, $componentData, $trackableStructurePosition = false)
 {
     assert('is_int($rowCount)');
     assert('is_array($componentData)');
     assert('is_bool($trackableStructurePosition)');
     $items = array();
     $wizardFormClassName = get_class($this->model);
     foreach ($componentData as $component) {
         $nodeIdWithoutTreeType = $component->attributeIndexOrDerivedType;
         $inputPrefixData = WorkflowRelationsAndAttributesToTreeAdapter::resolveInputPrefixData($wizardFormClassName, $this->getTreeType(), $rowCount);
         $adapter = new WorkflowAttributeToElementAdapter($inputPrefixData, $component, $this->form, $this->getTreeType());
         $view = new AttributeRowForWorkflowComponentView($adapter, $rowCount, $inputPrefixData, WorkflowRelationsAndAttributesToTreeAdapter::resolveAttributeByNodeId($nodeIdWithoutTreeType), (bool) $trackableStructurePosition, true, static::getTreeType());
         $view->addWrapper = false;
         $items[] = array('content' => $view->render());
         $rowCount++;
     }
     return $items;
 }