List<WorkflowInput> workflowInputs=new ArrayList<WorkflowInput>();
for (int i = 0; i < inputNodes.size(); i++) {
InputNode inputNode = inputNodes.get(i);
workflowInputs.add(new WorkflowInput(inputNode.getID(), inputNode.getDefaultValue().toString()));
}
AiravataAPI api = engine.getConfiguration().getAiravataAPI();
ExperimentAdvanceOptions options = api.getExecutionManager().createExperimentAdvanceOptions(instanceNameFinal, api.getCurrentUser(), null);
if (AmazonCredential.getInstance().getAwsAccessKeyId() != null) {
options.getCustomSecuritySettings().getAmazonWSSettings().setAccessKeyId(AmazonCredential.getInstance().getAwsAccessKeyId());
options.getCustomSecuritySettings().getAmazonWSSettings().setSecretAccessKey(AmazonCredential.getInstance().getAwsSecretAccessKey());
}
//TODO get the token id from UI
// For the moment hard code it
// TODO Build UI to get the token id
//options.getCustomSecuritySettings().getCredentialStoreSecuritySettings().setTokenId("1234");
String experimentId = api.getExecutionManager().runExperiment(api.getWorkflowManager().getWorkflowAsString(workflow), workflowInputs,options);
try {
WorkflowInterpreterLaunchWindow.this.engine.getMonitor().getConfiguration().setTopic(experimentId);
WorkflowInterpreterLaunchWindow.this.engine.getMonitor().start();
} catch (MonitorException e1) {
WorkflowInterpreterLaunchWindow.this.engine.getGUI().getErrorWindow().error(e1);