Search in sources :

Example 1 with BpmnProcessCompiler

use of io.automatiko.engine.workflow.bpmn2.BpmnProcessCompiler in project automatiko-engine by automatiko-io.

the class SvgProcessImageGeneratorTest method testGeneration.

public void testGeneration(String processResource) throws IOException {
    BpmnProcessCompiler compiler = new BpmnProcessCompiler();
    BpmnProcess process = compiler.from(null, new ClassPathResource(processResource)).get(0);
    assertThat(process).isNotNull();
    SvgBpmnProcessImageGenerator generator = new SvgBpmnProcessImageGenerator((WorkflowProcess) process.process());
    String svg = generator.generate();
    assertThat(svg).isNotEmpty();
    Files.write(Paths.get("target", "test.svg"), svg.getBytes(StandardCharsets.UTF_8));
}
Also used : BpmnProcess(io.automatiko.engine.workflow.bpmn2.BpmnProcess) BpmnProcessCompiler(io.automatiko.engine.workflow.bpmn2.BpmnProcessCompiler) SvgBpmnProcessImageGenerator(io.automatiko.engine.codegen.process.image.SvgBpmnProcessImageGenerator) ClassPathResource(io.automatiko.engine.services.io.ClassPathResource)

Aggregations

SvgBpmnProcessImageGenerator (io.automatiko.engine.codegen.process.image.SvgBpmnProcessImageGenerator)1 ClassPathResource (io.automatiko.engine.services.io.ClassPathResource)1 BpmnProcess (io.automatiko.engine.workflow.bpmn2.BpmnProcess)1 BpmnProcessCompiler (io.automatiko.engine.workflow.bpmn2.BpmnProcessCompiler)1