use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.
the class ExperimentRegistry method updateExpInputs.
public void updateExpInputs(List<InputDataObjectType> exInputs, String expID) throws RegistryException {
try {
ExperimentResource experimentResource = new ExperimentResource();
experimentResource.setExperimentId(expID);
List<ExperimentInputResource> experimentInputs = experimentResource.getExperimentInputs();
for (InputDataObjectType input : exInputs) {
for (ExperimentInputResource exinput : experimentInputs) {
if (exinput.getInputName().equals(input.getName())) {
exinput.setInputValue(input.getValue());
exinput.setExperimentId(expID);
if (input.getType() != null) {
exinput.setDataType(input.getType().toString());
}
exinput.setMetadata(input.getMetaData());
exinput.setApplicationArgument(input.getApplicationArgument());
exinput.setInputOrder(input.getInputOrder());
exinput.setIsRequired(input.isIsRequired());
exinput.setRequiredToAddedToCmd(input.isRequiredToAddedToCommandLine());
exinput.setStorageResourceId(input.getStorageResourceId());
exinput.setIsReadOnly(input.isIsReadOnly());
exinput.save();
}
}
}
} catch (Exception e) {
logger.error("Unable to update experiment inputs", e);
throw new RegistryException(e);
}
}
use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.
the class ExperimentRegistry method addProcessInputs.
public String addProcessInputs(List<InputDataObjectType> processInputs, String processID) throws RegistryException {
try {
for (InputDataObjectType input : processInputs) {
ProcessInputResource resource = new ProcessInputResource();
resource.setProcessId(processID);
resource.setInputName(input.getName());
resource.setInputValue(input.getValue());
if (input.getType() != null) {
resource.setDataType(input.getType().toString());
}
resource.setMetadata(input.getMetaData());
resource.setApplicationArgument(input.getApplicationArgument());
resource.setInputOrder(input.getInputOrder());
resource.setIsRequired(input.isIsRequired());
resource.setRequiredToAddedToCmd(input.isRequiredToAddedToCommandLine());
resource.setStorageResourceId(input.getStorageResourceId());
resource.setIsReadOnly(input.isIsReadOnly());
resource.save();
}
return processID;
} catch (Exception e) {
logger.error("Unable to save process inputs", e);
throw new RegistryException(e);
}
}
use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.
the class AppCatalogThriftConversion method getInputDataObjType.
public static InputDataObjectType getInputDataObjType(ApplicationInputResource input) {
InputDataObjectType inputDataObjectType = new InputDataObjectType();
inputDataObjectType.setName(input.getInputKey());
inputDataObjectType.setValue(input.getInputVal());
inputDataObjectType.setApplicationArgument(input.getAppArgument());
inputDataObjectType.setInputOrder(input.getInputOrder());
inputDataObjectType.setMetaData(input.getMetadata());
inputDataObjectType.setType(DataType.valueOf(input.getDataType()));
inputDataObjectType.setStandardInput(input.isStandardInput());
inputDataObjectType.setUserFriendlyDescription(input.getUserFriendlyDesc());
inputDataObjectType.setIsRequired(input.getRequired());
inputDataObjectType.setRequiredToAddedToCommandLine(input.getRequiredToCMD());
inputDataObjectType.setDataStaged(input.isDataStaged());
inputDataObjectType.setIsReadOnly(input.isReadOnly());
return inputDataObjectType;
}
use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.
the class ThriftDataModelConversion method getInput.
public static InputDataObjectType getInput(Object object) {
if (object != null) {
InputDataObjectType dataObjectType = new InputDataObjectType();
if (object instanceof ExperimentInputResource) {
ExperimentInputResource inputResource = (ExperimentInputResource) object;
dataObjectType.setName(inputResource.getInputName());
dataObjectType.setValue(inputResource.getInputValue());
dataObjectType.setType(DataType.valueOf(inputResource.getDataType()));
dataObjectType.setApplicationArgument(inputResource.getApplicationArgument());
dataObjectType.setStandardInput(inputResource.getStandardInput());
dataObjectType.setUserFriendlyDescription(inputResource.getUserFriendlyDescription());
dataObjectType.setMetaData(inputResource.getMetadata());
dataObjectType.setInputOrder(inputResource.getInputOrder());
dataObjectType.setIsRequired(inputResource.getIsRequired());
dataObjectType.setRequiredToAddedToCommandLine(inputResource.getRequiredToAddedToCmd());
dataObjectType.setDataStaged(inputResource.getDataStaged());
dataObjectType.setIsReadOnly(inputResource.isReadOnly());
dataObjectType.setStorageResourceId(inputResource.getStorageResourceId());
return dataObjectType;
} else if (object instanceof ProcessInputResource) {
ProcessInputResource inputResource = (ProcessInputResource) object;
dataObjectType.setName(inputResource.getInputName());
dataObjectType.setValue(inputResource.getInputValue());
dataObjectType.setType(DataType.valueOf(inputResource.getDataType()));
dataObjectType.setApplicationArgument(inputResource.getApplicationArgument());
dataObjectType.setStandardInput(inputResource.getStandardInput());
dataObjectType.setUserFriendlyDescription(inputResource.getUserFriendlyDescription());
dataObjectType.setMetaData(inputResource.getMetadata());
dataObjectType.setInputOrder(inputResource.getInputOrder());
dataObjectType.setIsRequired(inputResource.getIsRequired());
dataObjectType.setRequiredToAddedToCommandLine(inputResource.getRequiredToAddedToCmd());
dataObjectType.setDataStaged(inputResource.getDataStaged());
dataObjectType.setStorageResourceId(inputResource.getStorageResourceId());
dataObjectType.setIsReadOnly(inputResource.isReadOnly());
return dataObjectType;
} else {
return null;
}
}
return null;
}
use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.
the class ThriftDataModelConversion method getProcessInputs.
public static List<InputDataObjectType> getProcessInputs(List<ProcessInputResource> processInputResources) {
List<InputDataObjectType> nodeInputs = new ArrayList<InputDataObjectType>();
if (processInputResources != null && !processInputResources.isEmpty()) {
for (ProcessInputResource inputResource : processInputResources) {
InputDataObjectType nodeInput = getInput(inputResource);
nodeInputs.add(nodeInput);
}
}
return nodeInputs;
}
Aggregations