kie-dmn/kie-dmn-xls2dmn-cli/README.md
Experimental DMN generator for Excel (.xls/.xlsx) file containing DMN decision tables.
NOTE being an experimental feature, the behaviour, requirements and capabilities may vary at any time.
This can be an helpful utility to convert spreadsheet file into DMN decision table automatically.
You can retrieve this CLI Utility from Maven Central by downloading it from: https://search.maven.org/artifact/org.kie/kie-dmn-xls2dmn-cli
You should download the file kie-dmn-xls2dmn-cli-<version>.jar, where <version> is the latest available or desired one.
Alternatively, you can retrieve the .jar file on the current local directory,
by running the following Maven command from the command line and replacing for the needed <version>:
mvn org.apache.maven.plugins:maven-dependency-plugin:3.2.0:copy -Dartifact=org.kie:kie-dmn-xls2dmn-cli:<version>:jar -DoutputDirectory=.
Usage: java -jar <xl2dmn .jar file> [-hV] INPUT_FILE [OUTPUT_FILE]
Experimental DMN generator for Excel (.xls/.xlsx) file containing DMN decision
tables.
INPUT_FILE The input Excel (.xls/.xlsx) file containing DMN decision
tables.
[OUTPUT_FILE] Specify filename for generated DMN model file.
If not specified, will generate INPUT_FILE with .dmn
postfixed.
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
For example:
java -jar kie-dmn-xls2dmn-cli-7.57.0.Final.jar Loan_approvals.xlsx
will generate a DMN model file named Loan_approvals.xlsx.dmn.
Requirements:
This converters transforms Excel (.xls/.xlsx) file automatically into DMN decision tables IF the content of the spreadsheet matches specific conventions.
The following conventions are assumed for the Spreadsheet file containing the Decision Table(s):
For example, this Excel spreadsheet formalises a Loan Approval as a first DMN Decision Table:
in this decision table, accordingly to the conventions described above:
DTI Rating, PITI Rating are dependent sub-Decision(s)FICO Score is a dependent InputDataThe remaining Sheets are formalised as follows:
Accordingly, for the decision table PITI Rating there is one depdendent InputData named PITI Ratio; for the decision table DTI Rating there is one dependent InputData named DTI Ratio.
Running the CLI Utility will generate the following DMN model, as expected:
and with each Decisions containing the respective Decision Table:
This example is provded to show the convenience in using the CLI Utility converter, instead of having to define by hand all the values in any DMN Editor. The values have been fetched from online sources and the expected FEEL expression defined in the Spredsheet.
Once transformed it consist of a dependend InputData and one Decision, the single Sheet:
The Decision Table contains the expected values:
This example is provded to show the convenience in using the CLI Utility converter to define score values in the Spreadsheet, instead of having to be defined by hand in any DMN Editor.
Once transformed it consist of a two InputData(s) and two Decision, as expected:
The Decision Table(s) contain the expected values: