Search in sources :

Example 1 with WorkflowModel

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;
    }
}
Also used : WorkflowModel(org.apache.airavata.model.WorkflowModel) RegistryService(org.apache.airavata.registry.api.RegistryService) SharingRegistryService(org.apache.airavata.sharing.registry.service.cpi.SharingRegistryService) RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException) CredentialStoreException(org.apache.airavata.credential.store.exception.CredentialStoreException) AiravataException(org.apache.airavata.common.exception.AiravataException) TException(org.apache.thrift.TException) ApplicationSettingsException(org.apache.airavata.common.exception.ApplicationSettingsException) SecurityCheck(org.apache.airavata.service.security.interceptor.SecurityCheck)

Example 2 with WorkflowModel

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;
}
Also used : WorkflowInputResource(org.apache.airavata.registry.core.workflow.catalog.resources.WorkflowInputResource) WorkflowModel(org.apache.airavata.model.WorkflowModel) WorkflowCatalogResource(org.apache.airavata.registry.core.workflow.catalog.resources.WorkflowCatalogResource)

Aggregations

WorkflowModel (org.apache.airavata.model.WorkflowModel)2 AiravataException (org.apache.airavata.common.exception.AiravataException)1 ApplicationSettingsException (org.apache.airavata.common.exception.ApplicationSettingsException)1 CredentialStoreException (org.apache.airavata.credential.store.exception.CredentialStoreException)1 RegistryService (org.apache.airavata.registry.api.RegistryService)1 RegistryServiceException (org.apache.airavata.registry.api.exception.RegistryServiceException)1 WorkflowCatalogResource (org.apache.airavata.registry.core.workflow.catalog.resources.WorkflowCatalogResource)1 WorkflowInputResource (org.apache.airavata.registry.core.workflow.catalog.resources.WorkflowInputResource)1 SecurityCheck (org.apache.airavata.service.security.interceptor.SecurityCheck)1 SharingRegistryService (org.apache.airavata.sharing.registry.service.cpi.SharingRegistryService)1 TException (org.apache.thrift.TException)1