use of org.apache.airavata.model.application.io.OutputDataObjectType in project airavata by apache.
the class ExperimentRegistry method updateProcessOutputs.
public void updateProcessOutputs(List<OutputDataObjectType> processOutput, String processID) throws RegistryException {
try {
ProcessResource processResource = new ProcessResource();
processResource.setProcessId(processID);
List<ProcessOutputResource> existingProcessOutputs = processResource.getProcessOutputs();
for (OutputDataObjectType output : processOutput) {
for (ProcessOutputResource resource : existingProcessOutputs) {
if (resource.getOutputName().equals(output.getName())) {
resource.setProcessId(processID);
resource.setOutputName(output.getName());
resource.setOutputValue(output.getValue());
if (output.getType() != null) {
resource.setDataType(output.getType().toString());
}
resource.setIsRequired(output.isIsRequired());
resource.setRequiredToAddedToCmd(output.isRequiredToAddedToCommandLine());
resource.setDataMovement(output.isDataMovement());
resource.setLocation(output.getLocation());
resource.setApplicationArgument(output.getApplicationArgument());
resource.setSearchQuery(output.getSearchQuery());
resource.setOutputStreaming(output.isOutputStreaming());
resource.setStorageResourceId(output.getStorageResourceId());
resource.save();
}
}
}
} catch (Exception e) {
logger.error("Error while updating process outputs", e);
throw new RegistryException(e);
}
}
use of org.apache.airavata.model.application.io.OutputDataObjectType in project airavata by apache.
the class ExperimentRegistry method updateExperiment.
// CPI Update Methods
public void updateExperiment(ExperimentModel experiment, String expId) throws RegistryException {
try {
if (!workerResource.isProjectExists(experiment.getProjectId())) {
logger.error("Project does not exist in the system..");
throw new Exception("Project does not exist in the system, Please create the project first...");
}
ExperimentResource existingExperiment = gatewayResource.getExperiment(expId);
existingExperiment.setExperimentName(experiment.getExperimentName());
existingExperiment.setUserName(experiment.getUserName());
existingExperiment.setGatewayId(experiment.getGatewayId());
existingExperiment.setGatewayExecutionId(experiment.getGatewayExecutionId());
existingExperiment.setGatewayInstanceId(experiment.getGatewayInstanceId());
existingExperiment.setProjectId(experiment.getProjectId());
existingExperiment.setCreationTime(AiravataUtils.getTime(experiment.getCreationTime()));
existingExperiment.setDescription(experiment.getDescription());
existingExperiment.setExecutionId(experiment.getExecutionId());
if (experiment.isEnableEmailNotification()) {
existingExperiment.setEnableEmailNotification(true);
if (experiment.getEmailAddresses() != null) {
existingExperiment.setEmailAddresses(StringUtils.join(experiment.getEmailAddresses(), ","));
}
} else {
existingExperiment.setEnableEmailNotification(false);
}
existingExperiment.save();
UserConfigurationDataModel userConfigurationData = experiment.getUserConfigurationData();
if (userConfigurationData != null) {
updateUserConfigData(userConfigurationData, expId);
}
List<InputDataObjectType> experimentInputs = experiment.getExperimentInputs();
if (experimentInputs != null && !experimentInputs.isEmpty()) {
updateExpInputs(experimentInputs, expId);
}
List<OutputDataObjectType> experimentOutputs = experiment.getExperimentOutputs();
if (experimentOutputs != null && !experimentOutputs.isEmpty()) {
updateExpOutputs(experimentOutputs, expId);
}
List<ExperimentStatus> experimentStatuses = experiment.getExperimentStatus();
if (experimentStatuses != null && experimentStatuses.size() > 0) {
if (experimentStatuses.get(0) != null) {
updateExperimentStatus(experimentStatuses.get(0), expId);
}
}
List<ErrorModel> errors = experiment.getErrors();
if (errors != null && !errors.isEmpty()) {
for (ErrorModel errror : errors) {
updateExperimentError(errror, expId);
}
}
} catch (Exception e) {
logger.error("Error while updating experiment...", e);
throw new RegistryException(e);
}
}
use of org.apache.airavata.model.application.io.OutputDataObjectType in project airavata by apache.
the class ThriftDataModelConversion method getProcessOutputs.
public static List<OutputDataObjectType> getProcessOutputs(List<ProcessOutputResource> processOutputResources) {
List<OutputDataObjectType> processOutputs = new ArrayList<OutputDataObjectType>();
if (processOutputResources != null && !processOutputResources.isEmpty()) {
for (ProcessOutputResource outputResource : processOutputResources) {
OutputDataObjectType output = getOutput(outputResource);
processOutputs.add(output);
}
}
return processOutputs;
}
use of org.apache.airavata.model.application.io.OutputDataObjectType in project airavata by apache.
the class ThriftDataModelConversion method getExpOutputs.
public static List<OutputDataObjectType> getExpOutputs(List<ExperimentOutputResource> experimentOutputResourceList) {
List<OutputDataObjectType> exOutputs = new ArrayList<OutputDataObjectType>();
if (experimentOutputResourceList != null && !experimentOutputResourceList.isEmpty()) {
for (ExperimentOutputResource outputResource : experimentOutputResourceList) {
OutputDataObjectType output = getOutput(outputResource);
exOutputs.add(output);
}
}
return exOutputs;
}
use of org.apache.airavata.model.application.io.OutputDataObjectType in project airavata by apache.
the class ThriftDataModelConversion method getOutput.
public static OutputDataObjectType getOutput(Object object) {
if (object != null) {
OutputDataObjectType dataObjectType = new OutputDataObjectType();
if (object instanceof ExperimentOutputResource) {
ExperimentOutputResource outputResource = (ExperimentOutputResource) object;
dataObjectType.setName(outputResource.getOutputName());
dataObjectType.setValue(outputResource.getOutputValue());
dataObjectType.setType(DataType.valueOf(outputResource.getDataType()));
dataObjectType.setApplicationArgument(outputResource.getApplicationArgument());
dataObjectType.setIsRequired(outputResource.getIsRequired());
dataObjectType.setRequiredToAddedToCommandLine(outputResource.getRequiredToAddedToCmd());
dataObjectType.setDataMovement(outputResource.getDataMovement());
dataObjectType.setLocation(outputResource.getLocation());
dataObjectType.setSearchQuery(outputResource.getSearchQuery());
dataObjectType.setOutputStreaming(outputResource.isOutputStreaming());
dataObjectType.setStorageResourceId(outputResource.getStorageResourceId());
return dataObjectType;
} else if (object instanceof ProcessOutputResource) {
ProcessOutputResource outputResource = (ProcessOutputResource) object;
dataObjectType.setName(outputResource.getOutputName());
dataObjectType.setValue(outputResource.getOutputValue());
dataObjectType.setType(DataType.valueOf(outputResource.getDataType()));
dataObjectType.setApplicationArgument(outputResource.getApplicationArgument());
dataObjectType.setIsRequired(outputResource.getIsRequired());
dataObjectType.setRequiredToAddedToCommandLine(outputResource.getRequiredToAddedToCmd());
dataObjectType.setDataMovement(outputResource.getDataMovement());
dataObjectType.setLocation(outputResource.getLocation());
dataObjectType.setSearchQuery(outputResource.getSearchQuery());
dataObjectType.setOutputStreaming(outputResource.isOutputStreaming());
dataObjectType.setStorageResourceId(outputResource.getStorageResourceId());
return dataObjectType;
} else {
return null;
}
}
return null;
}
Aggregations