Search in sources :

Example 1 with JsonWorkflowParser

use of org.apache.airavata.workflow.core.parser.JsonWorkflowParser in project airavata by apache.

the class WorkflowFactory method getWorkflowParser.

public static WorkflowParser getWorkflowParser(String workflowString) throws Exception {
    WorkflowParser workflowParser = null;
    try {
        String wfParserClassName = ServerSettings.getWorkflowParser();
        Class<?> aClass = Class.forName(wfParserClassName);
        Constructor<?> constructor = aClass.getConstructor(String.class);
        workflowParser = (WorkflowParser) constructor.newInstance(workflowString);
    } catch (ApplicationSettingsException e) {
        log.info("A custom workflow parser is not defined, Use default Airavata JSON workflow parser");
    }
    if (workflowParser == null) {
        workflowParser = new JsonWorkflowParser(workflowString);
    }
    return workflowParser;
}
Also used : ApplicationSettingsException(org.apache.airavata.common.exception.ApplicationSettingsException) JsonWorkflowParser(org.apache.airavata.workflow.core.parser.JsonWorkflowParser) WorkflowParser(org.apache.airavata.workflow.core.parser.WorkflowParser) JsonWorkflowParser(org.apache.airavata.workflow.core.parser.JsonWorkflowParser)

Aggregations

ApplicationSettingsException (org.apache.airavata.common.exception.ApplicationSettingsException)1 JsonWorkflowParser (org.apache.airavata.workflow.core.parser.JsonWorkflowParser)1 WorkflowParser (org.apache.airavata.workflow.core.parser.WorkflowParser)1