use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.
the class InputNodeImpl method getInputObject.
@Override
public InputDataObjectType getInputObject() {
if (inputDataObjectType == null) {
inputDataObjectType = new InputDataObjectType(getName());
inputDataObjectType.setValue(getValue());
inputDataObjectType.setType(getDataType());
// inputDataObjectType.setIsRequired(true);
// inputDataObjectType.setDataStaged(true);
// inputDataObjectType.setInputOrder(0);
}
return inputDataObjectType;
}
use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.
the class ApplicationProcessor method getInputAsString.
private static String getInputAsString(ProcessContext context, String name) {
List<InputDataObjectType> inputList = context.getProcessModel().getProcessInputs();
String value = null;
for (Iterator<InputDataObjectType> iterator = inputList.iterator(); iterator.hasNext(); ) {
InputDataObjectType inputDataObjectType = iterator.next();
if (inputDataObjectType.getName().equals(name)) {
value = inputDataObjectType.getValue();
break;
}
}
return value;
}
use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.
the class DataTransferrer method extractInFileParams.
public List<String> extractInFileParams() {
List<String> filePrmsList = new ArrayList<String>();
List<InputDataObjectType> applicationInputs = processContext.getProcessModel().getProcessInputs();
if (applicationInputs != null && !applicationInputs.isEmpty()) {
for (InputDataObjectType output : applicationInputs) {
if (output.getType().equals(DataType.URI)) {
filePrmsList.add(output.getValue());
}
}
}
return filePrmsList;
}
use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.
the class UASDataStagingProcessor method buildDataStagingFromInputContext.
private static void buildDataStagingFromInputContext(ProcessContext context, JobDefinitionType value, String smsUrl) throws Exception {
// sort the inputs first and then build the command ListR
Comparator<InputDataObjectType> inputOrderComparator = new Comparator<InputDataObjectType>() {
@Override
public int compare(InputDataObjectType inputDataObjectType, InputDataObjectType t1) {
return inputDataObjectType.getInputOrder() - t1.getInputOrder();
}
};
Set<InputDataObjectType> sortedInputSet = new TreeSet<InputDataObjectType>(inputOrderComparator);
for (InputDataObjectType input : context.getProcessModel().getProcessInputs()) {
sortedInputSet.add(input);
}
if (sortedInputSet != null && !sortedInputSet.isEmpty()) {
for (InputDataObjectType input : sortedInputSet) {
if ("".equals(input.getValue()) || input.getValue() == null) {
continue;
}
if (input.getType().equals(DataType.URI)) {
createInURISMSElement(value, smsUrl, input.getValue(), true);
} else if (input.getType().equals(DataType.STRING) && input.isDataStaged()) {
createInURISMSElement(value, smsUrl, input.getValue(), false);
} else if (input.getType().equals(DataType.STRING) && !input.isDataStaged()) {
ApplicationProcessor.addApplicationArgument(value, context, input.getValue());
} else if (input.getType().equals(DataType.FLOAT) || input.getType().equals(DataType.INTEGER)) {
if (!(input.getName().equals(BESConstants.NUMBER_OF_PROCESSES) || input.getName().equals(BESConstants.PROCESSES_PER_HOST))) {
// temp avoid environ going to app args
ApplicationProcessor.addApplicationArgument(value, context, String.valueOf(input.getValue()));
}
}
}
}
}
use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.
the class DataRetrievalIT method runExperiment.
public String runExperiment(String user, String project) throws ApplicationSettingsException, AiravataClientException, InvalidRequestException, AiravataClientException, AiravataSystemException, TException, ExperimentNotFoundException {
List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
InputDataObjectType input = new InputDataObjectType();
input.setName("echo_input");
input.setType(DataType.STRING);
input.setValue("echo_output=Hello World");
exInputs.add(input);
List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
OutputDataObjectType output = new OutputDataObjectType();
output.setName("echo_output");
output.setType(DataType.STRING);
output.setValue("");
exOut.add(output);
ExperimentModel simpleExperiment = ExperimentModelUtil.createSimpleExperiment("default", project, user, "echoExperiment", "SimpleEcho0", "SimpleEcho0", exInputs);
simpleExperiment.setExperimentOutputs(exOut);
ComputationalResourceSchedulingModel scheduling = ExperimentModelUtil.createComputationResourceScheduling("localhost", 1, 1, 1, "normal", 0, 0);
scheduling.setResourceHostId("localhost");
UserConfigurationDataModel userConfigurationData = new UserConfigurationDataModel();
userConfigurationData.setAiravataAutoSchedule(false);
userConfigurationData.setOverrideManualScheduledParams(false);
userConfigurationData.setComputationalResourceScheduling(scheduling);
simpleExperiment.setUserConfigurationData(userConfigurationData);
Client client = getClient();
final String expId = client.createExperiment(authzToken, "default", simpleExperiment);
client.launchExperiment(authzToken, expId, "testToken");
return expId;
}
Aggregations