Generating the external library files

You execute the Decision Intelligence Client Managed Software plug-ins to generate the external library files.

Before you begin

Before you generate external library files, manually configure the Decision Intelligence plug-ins in the <build> section of the generated external library.

The import-maven-plugin generates the business object model, external annotation files, and vocabulary file from the classes contained in the Java™ libraries listed in the <dependencies> section.

The import-maven-plugin can be configured by using the following parameters:

Parameter Details
skip Set to false by default. When set to true, the execution of the import-maven-plugin is skipped and the files are not generated.
locales The locales parameter defines the locales that the external library supports. It accepts a list of values that are separated by commas. For example: en_US, fr_FR. For more information about supported locales, see Table 2. External library identifiers in Creating a POM file for an external library.
importMethods When the importMethods parameter is set to true, Java class methods are automatically verbalized. When set to false, Java class methods are not verbalized.
filter

This parameter allows you to manually define which classes and packages to import or ignore.

By default, only classes and packages from direct dependencies are imported and verbalized. Direct dependencies are those defined in the POM file. If a filter is specified, all classes and packages from both direct and indirect dependencies are checked before being potentially imported and verbalized.

You use the <includes> parameter to list the classes and packages to import, and the <excludes> parameter to list the ones to exclude. You can use either the fully qualified name of a class or the fully qualified name of a package followed by .* or .**, as shown in the following example:

<filter>
  <includes>
    <include>org.apache.commons.math3.complex.Complex</include>
  </includes>
  <excludes>
    <exclude>org.apache.commons.**</exclude>
  </excludes>
</filter>

Use .* to select the content of a package, and .** to select a package and all its subpackages.

Note: In addition to the <include> and <exclude> filters, you can also use the @NotBusiness annotation to narrow down the scope of the verbalization generation. For more information about the @NotBusiness annotation, see the Annotations API Java reference under Reference.
referenceFolder Allows you to specify the name of the reference folder. The reference folder contains information that doesn't have to be generated again, such as external annotations and vocabulary files.

Procedure

  1. Open your command line interface and navigate to the directory that contains the pom.xml file.
  2. Run the mvn install command.
    The command runs the import-maven-plugin and the build-maven-plugin.

Results

The import-maven-plugin creates the following directories and files:
  • A BOM directory that contains the model.b2xa and model.bom files. These files cannot be edited manually. However, you can annotate the model.bom file.
  • A vocabulary file for each locale that the external library supports. You can annotate the vocabulary files, or manually edit them after moving them to the <referencefolder>/bom directory.
  • A deployment directory. This directory and the files it contains do not need to be checked or edited.
  • A resources directory that contains pure function annotations that are deduced from the code.
  • A reference directory that is empty. You can use this directory to add external annotations and copy a vocabulary file that you would like to edit.
The build-maven-plugin creates the following files:
  • A deployable JAR that contains the library files. After the JAR file is deployed, the external library is ready to be imported into Decision Designer.
  • A markdown file that contains the external library documentation. The documentation shows each imported type, along with the verbalization of its constructors, attributes, and methods. The name of this file depends on the local of the external library, for example Complex_en_US.md.

What to do next

If you are satisfied with the generated external library, you can deploy it and import it into Decision Designer.

Use the mvn clean deploy command to deploy the external library into your archive repository.

If you are not satisfied with the generated files, you can:
  • Manually edit the vocabulary files.
  • Annotate the Java source code, if possible.
  • Add external annotations.
  • Add custom BOM types and members.