}
// Using the workflowContext Header values if user provided them in the request and overwrite the default values in DD
//todo finish the scheduling based on workflow execution context
TaskDetails taskData = context.getTaskData();
if(taskData != null && taskData.isSetTaskScheduling()){
ComputationalResourceScheduling computionnalResource = taskData.getTaskScheduling();
try {
int cpuCount = computionnalResource.getTotalCPUCount();
if(cpuCount>0){
app.setCpuCount(cpuCount);
}
} catch (NullPointerException e) {
log.debug("No Value sent in WorkflowContextHeader for CPU Count, value in the Deployment Descriptor will be used");
new GFacProviderException("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used",e);
}
try {
int nodeCount = computionnalResource.getNodeCount();
if(nodeCount>0){
app.setNodeCount(nodeCount);
}
} catch (NullPointerException e) {
log.debug("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used");
new GFacProviderException("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used",e);
}
try {
String queueName = computionnalResource.getQueueName();
if (queueName != null) {
if(app.getQueue() == null){
QueueType queueType = app.addNewQueue();
queueType.setQueueName(queueName);
}else{
app.getQueue().setQueueName(queueName);
}
}
} catch (NullPointerException e) {
log.debug("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used");
new GFacProviderException("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used",e);
}
try {
int maxwallTime = computionnalResource.getWallTimeLimit();
if(maxwallTime>0){
app.setMaxWallTime(maxwallTime);
}
} catch (NullPointerException e) {
log.debug("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used");