}
private WorkflowContextHeaderBuilder createWorkflowContextHeaderBuilder(
ExperimentAdvanceOptions options, String submissionUser)
throws AiravataAPIInvocationException {
WorkflowContextHeaderBuilder builder=createWorkflowContextHeader();
builder.setUserIdentifier(submissionUser);
NodeSettings[] nodeSettingsList = options.getCustomWorkflowSchedulingSettings().getNodeSettingsList();
for (NodeSettings nodeSettings : nodeSettingsList) {
List<NameValuePairType> nameValuePairTypes = nodeSettings.getNameValuePair();
for (NameValuePairType nameValuePairType : nameValuePairTypes) {
builder.addApplicationSchedulingKeyPair(nodeSettings.getNodeId(),nameValuePairType.getName(), nameValuePairType.getValue(), nameValuePairType.getDescription());
}
builder.addApplicationSchedulingContext(nodeSettings.getNodeId(), nodeSettings.getServiceId(), nodeSettings.getHostSettings().getHostId(), nodeSettings.getHostSettings().isWSGRAMPreffered(), nodeSettings.getHostSettings().getGatekeeperEPR(), nodeSettings.getHPCSettings().getJobManager(), nodeSettings.getHPCSettings().getCPUCount(), nodeSettings.getHPCSettings().getNodeCount(), nodeSettings.getHPCSettings().getQueueName(), nodeSettings.getHPCSettings().getMaxWallTime());
}
OutputDataSettings[] outputDataSettingsList = options.getCustomWorkflowOutputDataSettings().getOutputDataSettingsList();
for (OutputDataSettings outputDataSettings : outputDataSettingsList) {
builder.addApplicationOutputDataHandling(outputDataSettings.getNodeId(),outputDataSettings.getOutputDataDirectory(), outputDataSettings.getDataRegistryUrl(), outputDataSettings.isDataPersistent());
}
if (options.getCustomSecuritySettings().getAmazonWSSettings().getAccessKeyId() != null) {
builder.setAmazonWebServices(options.getCustomSecuritySettings().getAmazonWSSettings().getAccessKeyId(),
options.getCustomSecuritySettings().getAmazonWSSettings().getSecretAccessKey());
}
if (options.getCustomSecuritySettings().getCredentialStoreSecuritySettings() != null) {
builder.setCredentialManagementService(options.getCustomSecuritySettings().
getCredentialStoreSecuritySettings().getTokenId(),
submissionUser);
}