protected function generateWorkflowFile($path, $fileType, $parameters = array())
    {
        $warning = '';

        // Generate workflow file by template
        $template = 'Workflow.' . $fileType . '.twig';
        $templatePath = $this->getApplication()->getKernel()->getBundle($this->thisBundle)->getPath() . '/Resources/views/WorkflowTemplate/';
        if (!is_file($templatePath . $template)) {
            throw new \Exception("Generation of a workflow example is not supported with format '$fileType'");
        }

        $code = $this->getContainer()->get('twig')->render($this->thisBundle . ':WorkflowTemplate:' . $template, $parameters);

        file_put_contents($path, $code);

        return $warning;
    }