logger.fine("Generated script file name [" + pgeScriptName + "]");
return pgeScriptName;
}
protected void runPge() throws Exception {
ScriptFile sf = null;
try {
long startTime = System.currentTimeMillis();
logger.info("PGE start time [" + new Date(startTime) + "]");
// create script to run
sf = buildPgeRunScript();
sf.writeScriptFile(getScriptPath().getAbsolutePath());
// run script and evaluate whether success or failure
updateStatus(RUNNING_PGE.getWorkflowStatusName());
logger.info("Starting execution of PGE...");
if (!wasPgeSuccessful(ExecUtils.callProgram(
pgeConfig.getShellType() + " " + getScriptPath(), logger,
new File(pgeConfig.getExeDir()).getAbsoluteFile()))) {
throw new RuntimeException("Pge didn't finish successfully");
} else {
logger.info(
"Successfully completed running: '" + sf.getCommands() + "'");
}
long endTime = System.currentTimeMillis();
logger.info("PGE end time [" + new Date(startTime) + "]");
long runTime = endTime - startTime;
logger.info("PGE runtime in millis [" + runTime + "]");
pgeMetadata.replaceMetadata(PGE_RUNTIME, Long.toString(runTime));
} catch (Exception e) {
throw new Exception("Exception when executing PGE commands '"
+ (sf != null ? sf.getCommands() : "NULL") + "' : "
+ e.getMessage(), e);
}
}