public function generate($idChain,$name,array $options = []) {
        $chainModel = $this->resolveChainModel($idChain, $options);
        
        $modelDocument = $chainModel->getModel($name);
        if(isset($options["fileName"]) && !empty($options["fileName"])){
            $modelDocument->setFileName($options["fileName"]);
            unset($options["fileName"]);
        }
        $pathFileOut = $modelDocument
                ->setChainModel($chainModel)
                ->write($options["data"]);
        
        if($pathFileOut === null){
            throw new RuntimeException(sprintf("Failed to generate document '%s' with name '%s'",$idChain,$name));
        }
        if(!is_readable($pathFileOut)){
            throw new RuntimeException(sprintf("Failed to generate document '%s' with name '%s'. File '%s' is not readable.",$idChain,$name,$pathFileOut));
        }
        return $pathFileOut;
    }