use of org.apache.airavata.workflow.core.parser.WorkflowParser 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;
}
use of org.apache.airavata.workflow.core.parser.WorkflowParser in project airavata by apache.
the class WorkflowInterpreter method launchWorkflow.
/**
* Package-Private method.
*
* @throws Exception
*/
void launchWorkflow() throws Exception {
// WorkflowBuilder workflowBuilder = WorkflowFactory.getWorkflowBuilder(experiment.getExperimentId(), credentialToken, null);
workflowString = getWorkflow();
WorkflowParser workflowParser = WorkflowFactory.getWorkflowParser(workflowString);
log.debug("Initialized workflow parser");
workflowParser.parse();
setInputNodes(workflowParser.getInputNodes());
log.debug("Parsed the workflow and got the workflow input nodes");
// process workflow input nodes
processWorkflowInputNodes(getInputNodes());
if (readyList.isEmpty()) {
StringBuilder sb = new StringBuilder();
for (InputNode inputNode : inputNodes) {
sb.append(", ");
sb.append(inputNode.getInputObject().getName());
sb.append("=");
sb.append(inputNode.getInputObject().getValue());
}
throw new AiravataException("No workflow application node is in ready state to run with experiment inputs" + sb.toString());
}
processReadyList();
}
Aggregations