Search in sources :

Example 1 with ServerlessWorkflowParser

use of io.automatiko.engine.workflow.serverless.parser.ServerlessWorkflowParser in project automatiko-engine by automatiko-io.

the class ServerlessProcess method from.

public static List<ServerlessProcess> from(ProcessConfig config, Resource... resources) {
    List<ServerlessProcess> compiled = new ArrayList<>();
    ServerlessWorkflowParser parser = new ServerlessWorkflowParser();
    for (Resource resource : resources) {
        try {
            compiled.add(new ServerlessProcess(parser.parse(resource.getReader()), config));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    return compiled;
}
Also used : ServerlessWorkflowParser(io.automatiko.engine.workflow.serverless.parser.ServerlessWorkflowParser) ArrayList(java.util.ArrayList) Resource(io.automatiko.engine.api.io.Resource) IOException(java.io.IOException)

Example 2 with ServerlessWorkflowParser

use of io.automatiko.engine.workflow.serverless.parser.ServerlessWorkflowParser in project automatiko-engine by automatiko-io.

the class ProcessCodegen method parseWorkflowFile.

private static Process parseWorkflowFile(Resource r, String parser) {
    try {
        ServerlessWorkflowParser workflowParser = new ServerlessWorkflowParser();
        Process p = workflowParser.parse(r.getReader());
        ((WorkflowProcess) p).getMetaData().put("IsServerlessWorkflow", true);
        p.setResource(r);
        return p;
    } catch (IOException e) {
        throw new ProcessParsingException("Could not parse file " + r.getSourcePath(), e);
    }
}
Also used : ServerlessWorkflowParser(io.automatiko.engine.workflow.serverless.parser.ServerlessWorkflowParser) Process(io.automatiko.engine.api.definition.process.Process) WorkflowProcess(io.automatiko.engine.api.definition.process.WorkflowProcess) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException)

Aggregations

ServerlessWorkflowParser (io.automatiko.engine.workflow.serverless.parser.ServerlessWorkflowParser)2 IOException (java.io.IOException)2 Process (io.automatiko.engine.api.definition.process.Process)1 WorkflowProcess (io.automatiko.engine.api.definition.process.WorkflowProcess)1 Resource (io.automatiko.engine.api.io.Resource)1 UncheckedIOException (java.io.UncheckedIOException)1 ArrayList (java.util.ArrayList)1