Skip to content
Alexey O. Shigarov edited this page Jun 5, 2020 · 10 revisions

Usage

TabbyXL

Use the following command to run TabbyXL:

java -jar TabbyXL-1.1.0-jar-with-dependencies.jar <params>

Params:
-input <path>                      specify a path to an input excel workbook (*.xlsx)
-sheets <sheet indexes>            specify sheet indexes in the input excel workbook (e.g. "0-2,4,5,7-10")
-ruleset <path>                    specify a path to a ruleset file (e.g. *.crl (CRL), *.drl or *.dslr (Drools), or *.clp (Jess))
-categorySpec <path>               specify a path to a directory with category specifications in YAML files (*.cat)
-output <path>                     specify a path to a directory for outputting results
-ignoreSuperscript <true|false>    specify true to ignore superscript text in cells (false used by default)
-useCellText <true|false>          specify true to use cell values as text (false used by default)
-useShortNames <true|false>        specify true to use short names (just sheet names) for output files (false used by default)
-debuggingMode <true|false>        specify true to turn on debugging mode (false used by default)
-ruleEngineConfig <path>           specify optionally a path to a configuration file (*.properties) of a rule engine you prefer to use (e.g. Drools, Jess)
                                   (CRL-to-Java translation is used by default instead of a rule engine)
-help                              print this usage

Only two parameters are mandatory

  • -input <path>
  • -ruleset <path>

We recommend you to use JDK 8 or more

with CRL2J

Do not specify -ruleEngineConfig param if you choose to use CRL2J option.

Note that, with this option, you should run java included in JDK, not JRE. Otherwise, you get the following message:

Exception in thread "main" java.lang.IllegalStateException
        at ru.icc.td.tabbyxl.crl2j.compiler.CharSequenceCompiler.<init>(CharSequenceCompiler.java:44)
        at ru.icc.td.tabbyxl.crl2j.RuleCodeGen.compileAllRules(RuleCodeGen.java:38)
        at ru.icc.td.tabbyxl.TabbyXL.loadCRL2J(TabbyXL.java:638)
        at ru.icc.td.tabbyxl.TabbyXL.runRulesetWithCRL2J(TabbyXL.java:648)
        at ru.icc.td.tabbyxl.TabbyXL.main(TabbyXL.java:487)

If you see this message, then, please, check that you run java included in JDK. You also can try to use %JAVA_HOME%/bin/java instead of java.

See the following examples:

  1. Example 1
  2. Example 2

with Drools-DSL

Create the configuration file (drools-dsl.properties) with Drools-DSL settings as follows:

RULE_SERVICE_PROVIDER = http://drools.org/
RULE_SERVICE_PROVIDER_IMPL = org.drools.jsr94.rules.RuleServiceProviderImpl
SOURCE = dslr
DSL = <specify the path to crl.dsl file>

Note that the configuration file contains the path to the DSL-specification of CRL-dialect in DSL attribute. Make sure that this path is correct.

Specify the path to this configuration file in -ruleEngineConfig param to run the rule execution with Drools-DSL.

with Drools

Create the configuration file (drools.properties) with Drools settings as follows:

RULE_SERVICE_PROVIDER = http://drools.org/
RULE_SERVICE_PROVIDER_IMPL = org.drools.jsr94.rules.RuleServiceProviderImpl
SOURCE = drl

Specify the path to this configuration file in -ruleEngineConfig param to run the rule execution with Drools.

See the following examples:

  1. Example 1
  2. Example 2

with Jess

Install Jess firstly. Download it from the official site. Unpack the library file jess.jar from the downloaded archive (Jess71p2.zip) and into a directory.

Create the configuration file (jess.properties) with Jess settings as follows:

RULE_SERVICE_PROVIDER = jess.jsr94
RULE_SERVICE_PROVIDER_IMPL = jess.jsr94.RuleServiceProviderImpl
SOURCE = clp

Specify the path to this configuration file in -ruleEngineConfig param to run the rule execution with Jess.

Note that you also need to specify the path to jess.jar file in -cp as follows:

on Linux

java -cp <specify the path to jess.jar file>:TabbyXL-1.1.0-jar-with-dependencies.jar <params>

on Windows

java -cp <specify the path to jess.jar file>;TabbyXL-1.1.0-jar-with-dependencies.jar <params>

MvnGen

MvnGen provides the serialization of Java source code generated by CRL2J-translation as Maven projects. Note that the created project is ready for compilation and building of the target application for spreadsheet data extraction and transformation to a canonical form.

java -cp TabbyXL-1.1.0-jar-with-dependencies.jar ru.icc.td.tabbyxl.MvnGen <rules> <prj>

Params:
<rules> specify a path to an input ruleset file (*.crl)
<prj>    specify a path to an directory of the output project

The created project can be built by Apache Maven to get the target executable application (JAR file) with all required dependencies. The executable JAR can be run with a single parameter, a path to the input spreadsheet file.

See the following examples:

  1. Example 1
  2. Example 2
Clone this wiki locally