io.automatiko.engine.quarkus.deployment.ProcessCompilationProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of automatiko-common-deployment Show documentation
Show all versions of automatiko-common-deployment Show documentation
Common Deployment module for Quarkus Extension for Automatiko Engine
The newest version!
package io.automatiko.engine.quarkus.deployment;
import static java.util.Arrays.asList;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;
import io.automatiko.engine.codegen.ApplicationGenerator;
import io.automatiko.engine.codegen.Generator;
import io.automatiko.engine.codegen.process.ProcessCodegen;
public class ProcessCompilationProvider extends AutomatikoCompilationProvider {
@Override
public Set handledExtensions() {
return new HashSet<>(asList(".bpmn", ".bpmn2", ".sw.json", ".sw.yml", ".sw.yaml", ".json", ".yml", ".yaml"));
}
@Override
protected Set filterFilesToCompile(Set filesToCompile) {
return filesToCompile.stream().filter(f -> f.getName().endsWith(".bpmn") ||
f.getName().endsWith("bpmn2") ||
f.getName().endsWith(".sw.json") ||
f.getName().endsWith(".sw.yml") ||
f.getName().endsWith(".sw.yaml")).collect(Collectors.toSet());
}
@Override
protected Generator addGenerator(ApplicationGenerator appGen, Set filesToCompile, Context context)
throws IOException {
return appGen.withGenerator(ProcessCodegen.ofFiles(new ArrayList<>(filesToCompile)))
.withClassLoader(Thread.currentThread().getContextClassLoader());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy