6.3.2. Including PMML models within a DMN file in Business Central
In Business Central, you can include Predictive Model Markup Language (PMML) models from your project in a specified DMN file. When you include a PMML model within a DMN file, you can invoke that PMML model as a boxed function expression for a DMN decision node or business knowledge model node. If you update the source file for an included PMML model, you must remove and re-include the PMML model in the DMN file to apply the source changes.
You cannot include PMML models from other projects in Business Central.
Prerequisites
-
The PMML models are imported (as
.pmmlfiles) in the same project in Business Central as the DMN file in which you want to include the models.
Procedure
In your DMN project, add the following dependencies to the project
pom.xmlfile to enable PMML evaluation:<!-- Required for the PMML compiler --> <dependency> <groupId>org.drools</groupId> <artifactId>kie-pmml</artifactId> <version>${rhdm.version}</version> <scope>provided</scope> </dependency> <!-- Alternative dependencies for JPMML Evaluator, override `kie-pmml` dependency --> <dependency> <groupId>org.kie</groupId> <artifactId>kie-dmn-jpmml</artifactId> <version>${rhdm.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.jpmml</groupId> <artifactId>pmml-evaluator</artifactId> <version>1.5.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.jpmml</groupId> <artifactId>pmml-evaluator-extension</artifactId> <version>1.5.1</version> <scope>provided</scope> </dependency>To access the project
pom.xmlfile in Business Central, you can select any existing asset in the project and then in the Project Explorer menu on the left side of the screen, click the Customize View gear icon and select Repository Viewpom.xml. If you want to use the full PMML specification implementation with the Java Evaluator API for PMML (JPMML), use the alternative set of JPMML dependencies in your DMN project. If the JPMML dependencies and the standard
kie-pmmldependency are both present, thekie-pmmldependency is disabled. For information about JPMML licensing terms, see Openscoring.io.重要The legacy
kie-pmmldependency is deprecated with Red Hat Decision Manager 7.10.0 and will be replaced bykie-pmml-trustydependency in a future Red Hat Decision Manager release.注記Instead of specifying a Red Hat Decision Manager
<version>for individual dependencies, consider adding the Red Hat Business Automation bill of materials (BOM) dependency to your projectpom.xmlfile. The Red Hat Business Automation BOM applies to both Red Hat Decision Manager and Red Hat Process Automation Manager. When you add the BOM files, the correct versions of transitive dependencies from the provided Maven repositories are included in the project.Example BOM dependency:
<dependency> <groupId>com.redhat.ba</groupId> <artifactId>ba-platform-bom</artifactId> <version>7.10.0.redhat-00004</version> <scope>import</scope> <type>pom</type> </dependency>For more information about the Red Hat Business Automation BOM, see What is the mapping between RHDM product and maven library version?.
If you added the JPMML dependencies in your DMN project to use the JPMML Evaluator, download the following JAR files and add them to the
~/kie-server.war/WEB-INF/liband~/business-central.war/WEB-INF/libdirectories in your Red Hat Decision Manager distribution:-
kie-dmn-jpmmlJAR file in the Red Hat Decision Manager 7.10.0 Maven Repository distribution (rhdm-7.10.0-maven-repository/maven-repository/org/kie/kie-dmn-jpmml/7.48.0.Final-redhat-00004/kie-dmn-jpmml-7.48.0.Final-redhat-00004.jar) from the Red Hat Customer Portal - JPMML Evaluator 1.5.1 JAR file from the online Maven repository
- JPMML Evaluator Extensions 1.5.1 JAR file from the online Maven repository
These artifacts are required to enable JPMML evaluation in KIE Server and Business Central.
重要Red Hat supports integration with the Java Evaluator API for PMML (JPMML) for PMML execution in Red Hat Decision Manager. However, Red Hat does not support the JPMML libraries directly. If you include JPMML libraries in your Red Hat Decision Manager distribution, see the Openscoring.io licensing terms for JPMML.
-
-
In Business Central, go to Menu
Design Projects, click the project name, and select the DMN file you want to modify. - In the DMN designer, click the Included Models tab.
Click Include Model, select a PMML model from your project in the Models list, enter a unique name for the included model, and click Include:
図6.43 Including a PMML model
The PMML model is added to this DMN file:
図6.44 DMN file with included PMML model
In the Model tab of the DMN designer, select or create the decision node or business knowledge model node in which you want to invoke the PMML model and click the Edit icon to open the DMN boxed expression designer:
図6.45 Opening a new decision node boxed expression
図6.46 Opening a new business knowledge model boxed expression
- Set the expression type to Function (default for business knowledge model nodes), click the top-left function cell, and select PMML.
In the document and model rows in the table, double-click the undefined cells to specify the included PMML document and the relevant PMML model within that document:
図6.47 Adding a PMML model in a DMN business knowledge model
図6.48 Example PMML definition in a DMN business knowledge model
If you update the source file for an included PMML model, you must remove and re-include the PMML model in the DMN file to apply the source changes.
To edit the included model name or to remove the included model from the DMN file, use the Included Models tab in the DMN designer.