private void saveDraft(JobType jobType, String appPath, String postBody, Boolean overwrite) throws IOException {
    String workflowFilePath = workflowFilesService.getWorkflowFileName(appPath.trim(), jobType);
    if (!hdfsFileUtils.fileExists(workflowFilePath)) {
      String noOpWorkflow = oozieUtils.getNoOpWorkflowXml(postBody, jobType);
      workflowFilesService.createFile(workflowFilePath, noOpWorkflow, overwrite);
    }
    String workflowDraftPath = workflowFilesService.getWorkflowDraftFileName(appPath.trim(), jobType);
    workflowFilesService.createFile(workflowDraftPath, postBody, true);
  }
This is a class used to bridge the communication between the and the Oozie
API executing inside ambari.
contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/OozieProxyImpersonator.java