private void saveApplicationJob(JobExecutionContext jobExecutionContext)
throws GFacProviderException {
ApplicationDeploymentDescriptionType app = jobExecutionContext.
getApplicationContext().getApplicationDeploymentDescription().getType();
ApplicationJob appJob = GFacUtils.createApplicationJob(jobExecutionContext);
appJob.setJobId(jobId);
LocalProviderJobData data = new LocalProviderJobData();
data.setApplicationName(app.getExecutableLocation());
data.setInputDir(app.getInputDataDirectory());
data.setOutputDir(app.getOutputDataDirectory());
data.setWorkingDir(builder.directory().toString());
data.setInputParameters(ProviderUtils.getInputParameters(jobExecutionContext));
ByteArrayOutputStream stream = new ByteArrayOutputStream();
JAXB.marshal(data, stream);
appJob.setJobData(stream.toString());
appJob.setSubmittedTime(Calendar.getInstance().getTime());
appJob.setStatus(ApplicationJobStatus.SUBMITTED);
appJob.setStatusUpdateTime(appJob.getSubmittedTime());
GFacUtils.recordApplicationJob(jobExecutionContext, appJob);
}