oop/main/helper/DiagramHelper.php
public function saveAsFile($diagram, $savePath) {
    if(is_dir($savePath)) {
      $filePath = $savePath.'/'.$this->cleanFileName($diagram->id).'.bpmn';
    } else {
      $filePath = './'.$this->cleanFileName($diagram->id).'.bpmn';
    }

    $handle = fopen($filePath, 'c+');
    ftruncate($handle, filesize($filePath));
    fwrite($handle, $diagram->bpmn20Xml);
    fclose($handle);

    return $filePath;
  }
public function saveAsFile($diagram, $savePath) {
    if(is_dir($savePath)) {
      $filePath = $savePath.'/'.$this->cleanFileName($diagram->id).'.bpmn';
    } else {
      $filePath = './'.$this->cleanFileName($diagram->id).'.bpmn';
    }

    $handle = fopen($filePath, 'c+');
    ftruncate($handle, filesize($filePath));
    fwrite($handle, $diagram->bpmn20Xml);
    fclose($handle);

    return $filePath;
  }
public function saveAsFile ( $ diagram , $ savePath ) { if ( is_dir ( $ savePath ) ) { $ filePath = $ savePath . '/' . $ this -> cleanFileName ( $ diagram -> id ) . '.bpmn' ; } else { $ filePath = './' . $ this -> cleanFileName ( $ diagram -> id ) . '.bpmn' ; } $ handle = fopen ( $ filePath , 'c+' ) ; ftruncate ( $ handle , filesize ( $ filePath ) ) ; fwrite ( $ handle , $ diagram -> bpmn20Xml ) ; fclose ( $ handle ) ; return $ filePath ; }
saves the bpmn diagram as file.

@param $diagram
@param $savePath
@return string
saves the bpmn diagram as file .