Search in sources :

Example 1 with WorkflowInterpreterConfiguration

use of org.apache.airavata.workflow.engine.interpretor.WorkflowInterpreterConfiguration in project airavata by apache.

the class WorkflowEngineImpl method launchExperiment.

@Override
public void launchExperiment(String experimentId, String token) throws WorkflowEngineException {
    try {
        ExperimentCatalog experimentCatalog = RegistryFactory.getDefaultExpCatalog();
        Experiment experiment = (Experiment) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT, experimentId);
        WorkflowCatalog workflowCatalog = WorkflowCatalogFactory.getWorkflowCatalog();
        WorkflowInterpreterConfiguration config = new WorkflowInterpreterConfiguration(new Workflow(workflowCatalog.getWorkflow(experiment.getApplicationId()).getGraph()));
        final WorkflowInterpreter workflowInterpreter = new WorkflowInterpreter(experiment, token, config, getOrchestratorClient(), rabbitMQPublisher);
        new Thread() {

            public void run() {
                try {
                    workflowInterpreter.scheduleDynamically();
                } catch (WorkflowException e) {
                    logger.error(e.getMessage(), e);
                } catch (RegistryException e) {
                    logger.error(e.getMessage(), e);
                } catch (AiravataException e) {
                    logger.error(e.getMessage(), e);
                }
            }
        }.start();
    } catch (Exception e) {
        logger.error("Error while retrieving the experiment", e);
        WorkflowEngineException exception = new WorkflowEngineException("Error while launching the workflow experiment. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : ExperimentCatalog(org.apache.airavata.registry.cpi.ExperimentCatalog) WorkflowInterpreter(org.apache.airavata.workflow.engine.interpretor.WorkflowInterpreter) WorkflowCatalog(org.apache.airavata.registry.cpi.WorkflowCatalog) WorkflowException(org.apache.airavata.workflow.model.exceptions.WorkflowException) WorkflowInterpreterConfiguration(org.apache.airavata.workflow.engine.interpretor.WorkflowInterpreterConfiguration) Workflow(org.apache.airavata.workflow.model.wf.Workflow) RegistryException(org.apache.airavata.registry.cpi.RegistryException) RegistryException(org.apache.airavata.registry.cpi.RegistryException) AiravataException(org.apache.airavata.common.exception.AiravataException) AiravataClientConnectException(org.apache.airavata.model.error.AiravataClientConnectException) WorkflowException(org.apache.airavata.workflow.model.exceptions.WorkflowException) AiravataException(org.apache.airavata.common.exception.AiravataException)

Aggregations

AiravataException (org.apache.airavata.common.exception.AiravataException)1 AiravataClientConnectException (org.apache.airavata.model.error.AiravataClientConnectException)1 ExperimentCatalog (org.apache.airavata.registry.cpi.ExperimentCatalog)1 RegistryException (org.apache.airavata.registry.cpi.RegistryException)1 WorkflowCatalog (org.apache.airavata.registry.cpi.WorkflowCatalog)1 WorkflowInterpreter (org.apache.airavata.workflow.engine.interpretor.WorkflowInterpreter)1 WorkflowInterpreterConfiguration (org.apache.airavata.workflow.engine.interpretor.WorkflowInterpreterConfiguration)1 WorkflowException (org.apache.airavata.workflow.model.exceptions.WorkflowException)1 Workflow (org.apache.airavata.workflow.model.wf.Workflow)1