public function export(HTTPRequest $request)
    {
        $url = explode('/', $request->getURL());
        $definitionID = end($url);
        if ($definitionID && is_numeric($definitionID)) {
            $exporter = new WorkflowDefinitionExporter($definitionID);
            $exportFilename = WorkflowDefinitionExporter::config()
                ->get('export_filename_prefix') . '-' . $definitionID . '.yml';
            $exportBody = $exporter->export();
            $fileData = array(
                'name' => $exportFilename,
                'mime' => 'text/x-yaml',
                'body' => $exportBody,
                'size' => $exporter->getExportSize($exportBody)
            );
            return $exporter->sendFile($fileData);
        }
    }