Skip to content

Commit

Permalink
syntax improvements + add TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
tbouffard committed Aug 23, 2024
1 parent 2a7dff7 commit f66a592
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.io.File;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.util.concurrent.Callable;

import io.process.analytics.tools.bpmn.generator.BPMNLayoutGenerator.ExportType;
Expand Down Expand Up @@ -54,7 +53,6 @@ public class App implements Callable<Integer> {
private File[] inputFiles;

public static void main(String[] args) throws Exception {

int exitCode = runApp(args);
System.exit(exitCode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
import static io.process.analytics.tools.bpmn.generator.export.BPMNExporter.defaultBpmnExporter;
import static io.process.analytics.tools.bpmn.generator.internal.BpmnInOut.defaultBpmnInOut;

import java.io.File;
import java.io.IOException;

import io.process.analytics.tools.bpmn.generator.algo.ShapeLayouter;
import io.process.analytics.tools.bpmn.generator.algo.ShapeSorter;
import io.process.analytics.tools.bpmn.generator.converter.BpmnToAlgoModelConverter;
import io.process.analytics.tools.bpmn.generator.export.ASCIIExporter;
import io.process.analytics.tools.bpmn.generator.export.SVGExporter;
import io.process.analytics.tools.bpmn.generator.input.CSVtoBPMN;
import io.process.analytics.tools.bpmn.generator.internal.BpmnInOut;
import io.process.analytics.tools.bpmn.generator.internal.FileUtils;
import io.process.analytics.tools.bpmn.generator.internal.generated.model.TDefinitions;
import io.process.analytics.tools.bpmn.generator.model.Diagram;
import io.process.analytics.tools.bpmn.generator.model.Grid;
Expand Down Expand Up @@ -93,20 +89,17 @@ private String exportToSvg(LayoutSortedDiagram diagram) {


private String export(LayoutSortedDiagram layout, ExportType exportType) {
switch (exportType) {
case ASCII:
return exportToAscii(layout);
case BPMN:
return exportToBpmn(layout);
case SVG:
return exportToSvg(layout);
default:
throw new IllegalStateException("Unexpected Export Type: " + exportType);
}
return switch (exportType) {
case ASCII -> exportToAscii(layout);
case BPMN -> exportToBpmn(layout);
case SVG -> exportToSvg(layout);
default -> throw new IllegalStateException("Unexpected Export Type: " + exportType);
};
}

@RequiredArgsConstructor
@Getter
// TODO switch to record
public static class LayoutSortedDiagram {

private final TDefinitions originalDefinitions;
Expand Down

0 comments on commit f66a592

Please sign in to comment.