@Override
public String runExperiment(String workflowTemplateId,
List<WorkflowInput> inputs, String user, String metadata,
String workflowInstanceName, WorkflowContextHeaderBuilder builder)
throws AiravataAPIInvocationException {
ExperimentAdvanceOptions options = createExperimentAdvanceOptions(workflowInstanceName, user, metadata);
ApplicationSchedulingContext[] nodeSchedules = builder.getWorkflowSchedulingContext().getApplicationSchedulingContextArray();
for (ApplicationSchedulingContext context : nodeSchedules) {
NodeSettings nodeSettings = options.getCustomWorkflowSchedulingSettings().addNewNodeSettings(context.getWorkflowNodeId());
if (context.isSetServiceId()) nodeSettings.setServiceId(context.getServiceId());
if (context.isSetGatekeeperEpr()) nodeSettings.getHostSettings().setGatekeeperEPR(context.getGatekeeperEpr());
if (context.isSetHostName()) nodeSettings.getHostSettings().setHostId(context.getHostName());
if (context.isSetWsgramPreferred()) nodeSettings.getHostSettings().setWSGramPreffered(context.getWsgramPreferred());
if (context.isSetCpuCount()) nodeSettings.getHPCSettings().setCPUCount(context.getCpuCount());
if (context.isSetJobManager()) nodeSettings.getHPCSettings().setJobManager(context.getJobManager());
if (context.isSetMaxWallTime()) nodeSettings.getHPCSettings().setMaxWallTime(context.getMaxWallTime());
if (context.isSetNodeCount()) nodeSettings.getHPCSettings().setNodeCount(context.getNodeCount());
if (context.isSetQueueName()) nodeSettings.getHPCSettings().setQueueName(context.getQueueName());
}
ApplicationOutputDataHandling[] dataHandlingSettings = builder.getWorkflowOutputDataHandling().getApplicationOutputDataHandlingArray();
for (ApplicationOutputDataHandling handling : dataHandlingSettings) {
options.getCustomWorkflowOutputDataSettings().addNewOutputDataSettings(handling.getNodeId(), handling.getOutputDataDirectory(),handling.getDataRegistryUrl(),handling.getDataPersistance());
}
//TODO rest of the builder configurations as they are added to the experiment options
return runExperiment(workflowTemplateId, inputs, options);
}