|
a/src/main/java/converter/Main.java |
|
b/src/main/java/converter/Main.java |
|
... |
|
... |
24 |
JSONObject jsonObject;
|
24 |
JSONObject jsonObject;
|
25 |
// create Options object
|
25 |
// create Options object
|
26 |
Options options = new Options();
|
26 |
Options options = new Options();
|
27 |
|
27 |
|
28 |
// add t option
|
28 |
// add t option
|
|
|
29 |
options.addOption("help", false, "Show all options");
|
|
|
30 |
options.addOption("h", false, "Show all options");
|
29 |
options.addOption("config", true, "Choose config file");
|
31 |
options.addOption("config", true, "Choose config file");
|
30 |
options.addOption("s", true, "Choose source file");
|
32 |
options.addOption("s", true, "Choose source file");
|
31 |
options.addOption("d", true, "Choose destination file");
|
33 |
options.addOption("d", true, "Choose destination file");
|
32 |
options.addOption("i", false, "Infer start and end events");
|
34 |
options.addOption("i", false, "Infer start and end events");
|
33 |
|
35 |
|
34 |
CommandLine cmd = new BasicParser().parse(options, args);
|
36 |
CommandLine cmd = new BasicParser().parse(options, args);
|
35 |
|
37 |
|
|
|
38 |
if(cmd.hasOption("h") || cmd.hasOption("help") || cmd.getArgs().length == 0) {
|
|
|
39 |
System.out.println("-config\tChoose config file\n-s\tChoose source file - Mandatory\n-d\tChoose destination file\n-i\tInfer start and end events");
|
|
|
40 |
System.exit(0);
|
|
|
41 |
}
|
36 |
if (cmd.hasOption("i"))
|
42 |
if (cmd.hasOption("i"))
|
37 |
infer = true;
|
43 |
infer = true;
|
38 |
else
|
44 |
else
|
39 |
infer = false;
|
45 |
infer = false;
|
40 |
if (cmd.hasOption("config")) {
|
46 |
if (cmd.hasOption("config")) {
|
|
... |
|
... |
47 |
"\tEnd:[\"BusinessEvent\"],\n" +
|
53 |
"\tEnd:[\"BusinessEvent\"],\n" +
|
48 |
"}");
|
54 |
"}");
|
49 |
if (cmd.hasOption("s"))
|
55 |
if (cmd.hasOption("s"))
|
50 |
path = cmd.getOptionValue("s");
|
56 |
path = cmd.getOptionValue("s");
|
51 |
else
|
57 |
else
|
52 |
throw new IllegalArgumentException("No config file is set");
|
58 |
throw new IllegalArgumentException("No source file is set");
|
53 |
if (cmd.hasOption("d"))
|
59 |
if (cmd.hasOption("d"))
|
54 |
pathToSave = cmd.getOptionValue("d");
|
60 |
pathToSave = cmd.getOptionValue("d");
|
55 |
else
|
61 |
else
|
56 |
pathToSave = "output.bpmn";
|
62 |
pathToSave = "output.bpmn";
|
57 |
|
63 |
|