General confi­gura­tion

In order to determine the recom­men­ded Ge­ne­ra­tion Vari­ant 1 (Interface and Rules Module) for the project, the confi­gura­tion file is supplemented accordingly:

index 03

Additional settings for the project

These settings are usually defined only once and apply to all decision tables in the project.
The resources/lfet/lfet.project.yaml file receives further entries 1) − 6):
lfet:

  ide.default: java

  ide.java:
    enabled: true              # 1)

    package: lfet.demo         # 2)

    src:                       # 3)
      encoding: utf-8
      path: ${project.root}/../../java/${package}
      create.missing.folders: true

    interface:                 # 4)
      enabled: true
      name: ${dt.name}_iFace
      modifier: '""'
      method.modifier: '""'
      annotations:
        - javax.annotation.processing.Generated("LF-ET")
      language: en

    interface.rules.class:     # 5)
      name: ${dt.name}_rulesEngine
      modifier: public
      method.modifier: public
      annotations:
        - javax.annotation.processing.Generated("LF-ET")

    ini.path: '""'             # 6)

The new entries in detail:

1)  ide.java

The "general key" for Java. It is used to determine if the configuration parameter for Java should be taken into consideration or not.

2)  ide.java.package

We hereby define the package that should be used for the generated source files.

3)  ide.java.src…​

A few specifications for source files: directory, encoding and the missing directories should be created automatically.

Parameters on the right side are also used here as arguments, e.g. project.root or package, see Default keys.

4)  ide.java.interface

Activating the Generation Variant 1 (Interface and Rules Module) and determining the first basic settings for interfaces:

  • Name of the respective interface

  • Modifier for the interface and methods, empty string = no modifier

  • Annotation for designation as 'generated'

  • Language for automatic replacement of special characters when creating method names, such as e.g. '<' becomes 'less'

5)  ide.java.interface.rules.class…​

The first basic settings for the rules modules:

  • Name of the respective rules module

  • Modifier for class and method

  • Annotation for designation as 'generated'

6)  ide.java.ini.path…​

Suppressing the automatic search for additional INI files for Java generation

The first gene­ra­tion

Java gene­ra­tion can now be executed success­fully:

gensrc menu 02 java

config project 01
 

Once these basic settings are configured, an interface and a rules module are generated automatically for each deci­sion ta­ble in the lfet.​demo package at a touch of a button:

config project 02

Gene­ra­ted modules are not changed – they are recomputed and regene­rated at each gene­ra­tion.
 

The fastest way to launch gene­ration is to use the key­board short­cut CTRL+G.

Hints

  • Along with the confi­gu­ra­tion described above, the following are the only prerequsites for success­ful gene­ra­tion:

    • that deci­sion ta­bles are error-free, see Checking decision tables, and

    • that the names of the deci­sion ta­bles do not lead to invalid Java class names during generation

  • Gene­ra­tion can be configured comprehensively through generation parameters, starting from simple classes right up to generic, state­less services.

  • You can also define settings that differ from or supple­ment the standard settings for individual deci­sion ta­bles, e.g. individual class names, a different package, etc. See individual settings for a deci­sion ta­ble.