use of org.apache.airavata.model.WorkflowModel in project airavata by apache.
the class AiravataServerHandler method getWorkflow.
@Override
@SecurityCheck
public WorkflowModel getWorkflow(AuthzToken authzToken, String workflowTemplateId) throws InvalidRequestException, AiravataClientException, AuthorizationException, AiravataSystemException, TException {
RegistryService.Client regClient = registryClientPool.getResource();
try {
WorkflowModel result = regClient.getWorkflow(workflowTemplateId);
registryClientPool.returnResource(regClient);
return result;
} catch (Exception e) {
String msg = "Error in retrieving the workflow " + workflowTemplateId + ".";
logger.error(msg, e);
AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
exception.setMessage(msg + " More info : " + e.getMessage());
registryClientPool.returnBrokenResource(regClient);
throw exception;
}
}
use of org.apache.airavata.model.WorkflowModel in project airavata by apache.
the class WorkflowCatalogThriftConversion method getWorkflow.
public static WorkflowModel getWorkflow(WorkflowResource resource) throws WorkflowCatalogException {
WorkflowModel workflow = new WorkflowModel();
workflow.setTemplateId(resource.getWfTemplateId());
workflow.setGraph(resource.getGraph());
workflow.setName(resource.getWfName());
if (resource.getImage() != null) {
workflow.setImage(resource.getImage().getBytes());
}
WorkflowInputResource inputResource = new WorkflowInputResource();
List<WorkflowCatalogResource> resources = inputResource.get(WorkflowCatAbstractResource.WorkflowInputConstants.WF_TEMPLATE_ID, resource.getWfTemplateId());
workflow.setWorkflowInputs(getWFInputs(resources));
return workflow;
}
Aggregations