ApplicationDescriptionDocument appDescDoc = template;
if (appDescDoc == null) {
appDescDoc = ApplicationDescriptionDocument.Factory.newInstance();
}
ApplicationDescriptionType appType = appDescDoc.getApplicationDescription();
if (appType == null) {
appType = appDescDoc.addNewApplicationDescription();
}
ApplicationDescriptionType.ApplicationName appName = appType.getApplicationName();
if (appName == null) {
appName = appType.addNewApplicationName();
}
appName.setStringValue(appInfo.getApplicationName().trim());
appName.setTargetNamespace(appInfo.getObjectNamespace());
DeploymentDescriptionType deployment = appType.getDeploymentDescription();
if (deployment == null) {
deployment = appType.addNewDeploymentDescription();
}
deployment.setHostName(appInfo.getHostName().trim());
deployment.setExecutable(appInfo.getExecutable());
if (appInfo.getWorkDir() != null) {
deployment.setWorkDir(appInfo.getWorkDir());
}
if (appInfo.getTmpDir() != null) {
deployment.setTmpDir(appInfo.getTmpDir());
}
if (appInfo.getJobType() != null) {
appType.setJobType(org.ogce.schemas.gfac.documents.JobTypeType.Enum.forString(appInfo.getJobType()));
}
if (appInfo.getLeadNameListFile() != null) {
deployment.setLeadNameListFile(appInfo.getLeadNameListFile());
}
if (appInfo.getMaxWallTime() != null) {
appType.setMaxWallTime(Integer.valueOf(appInfo.getMaxWallTime()));
}
if (appInfo.getPcount() != null) {
appType.setCount(Integer.valueOf(appInfo.getPcount()));
}
if (appInfo.getQueue() != null) {
appType.addNewQueue().setQueueName(appInfo.getQueue());
}
if (appInfo.getProjectName() != null) {
appType.addNewProject().setProjectName(appInfo.getProjectName());
}
if (appInfo.getRslparmName() != null && appInfo.getRslparmValue() != null && appInfo.getRslparmName() != "") {
RSLParmType rslParmType = appType.addNewRslparm();
rslParmType.setName(appInfo.getRslparmName());
rslParmType.setStringValue(appInfo.getRslparmValue());
}if (appInfo.getMinMemory() != null) {
appType.setMinMemory(appInfo.getMinMemory());
}
if (appInfo.getHostCount() != null) {
appType.setHostCount(appInfo.getHostCount());
}
try {
SchemaValidator validator = new SchemaValidator(appType);
validator.validate();
} catch (GFacSchemaException e) {