public function executeCreate_indicador(sfWebRequest $request)
 {
     $request->setRequestFormat('json');
     $title = $request->getParameter('item_title');
     $previousid = $request->getParameter('previous');
     $tree = $request->getParameter('tree');
     $tree = explode("-", $tree);
     $user = $this->getUser()->getAttribute(sfConfig::get('app_session_current_user'), null);
     if ($user != null) {
         try {
             $conn = Propel::getConnection();
             $conn->beginTransaction();
             $indicator_bean = new IndicatorsSc();
             $indicator_bean->setTitulo($title);
             $indicator_bean->setDescripcion('');
             $indicator_bean->setTreeId($tree[1]);
             $indicator_bean->setPreviousId($previousid);
             $indicator_bean->setFlag('habilitado');
             $indicator_bean->save();
             //si no es el primer nodo a patir de arbol
             if ($indicator_bean->getPreviousId() != 0) {
                 //obtengo el ultimo para sacar su configuracion antigua
                 $pre_indicador = IndicatorsScPeer::retrieveByPK($previousid);
                 $pre_indicador->setUltimoNodo(false);
                 $pre_indicador->setValorOptimo(100);
                 $pre_indicador->save();
                 $indicator_bean->setParents($pre_indicador->getParents() . 'p' . $pre_indicador->getId() . 's-');
                 $indicator_bean->setUltimoNodo(true);
                 $indicator_bean->save();
             } else {
                 $indicator_bean->setUltimoNodo(true);
                 $indicator_bean->save();
             }
             $conn->commit();
             $this->message = 'success';
             $this->indicator = $indicator_bean->getId();
             $this->title = $indicator_bean->getTitulo();
             $this->lastNode = $indicator_bean->getUltimoNodo();
             return sfView::SUCCESS;
         } catch (Exception $e) {
             $this->message = $e->getMessage();
             return sfView::ERROR;
         }
     } else {
         $this->message = 'session expired';
         return sfView::ERROR;
     }
 }