[id='executable-model-upgrading-proc_{context}']
ifdef::DM,PAM[]
:PRODUCT_VERSION: 7.8
endif::[]
ifdef::DROOLS,JBPM,OP[]
:PRODUCT_VERSION: 7.39
endif::[]

= Enabling executable rule models when upgrading to {PRODUCT} {PRODUCT_VERSION}

Beginning in {PRODUCT} {PRODUCT_VERSION}, rule assets are built from executable rule models by default with the standard `kie-maven-plugin` plugin. The executable model is a more efficient alternative to the standard asset packaging in previous versions of {PRODUCT}.

When you install {PRODUCT} {PRODUCT_VERSION}, this default executable model behavior is configured for all new projects that you create going forward. However, if you are upgrading to {PRODUCT} {PRODUCT_VERSION} from a previous version of the product and you have not already enabled executable rule models, you must add the required dependency to your existing {PRODUCT} projects so that your rule assets are built from executable models in {PRODUCT} {PRODUCT_VERSION}. If you do not use the `kie-maven-plugin` plugin or if the required `drools-model-compiler` dependency is missing from your project, then rule assets are built without executable models.

For more information about executable rule models, see
ifdef::DM,PAM[]
{URL_DEPLOYING_AND_MANAGING_SERVICES}#executable-model-con_packaging-deploying[_{PACKAGING_DEPLOYING_PROJECT}_].
endif::[]
ifdef::DROOLS,JBPM,OP[]
xref:executable-model-con_packaging-deploying[].
endif::[]

.Procedure
In the `pom.xml` file of your Maven project or on the relevant class path of your Java project, add the following dependency to enable rule assets to be built from the default executable model:

[source,xml,subs="attributes+"]
----
<dependency>
  <groupId>org.drools</groupId>
  <artifactId>drools-model-compiler</artifactId>
  <version>${{PRODUCT_INIT}.version}</version>
</dependency>
----

This dependency compiles the executable model into {PRODUCT} internal data structures so that it can be executed by the {RULE_ENGINE}.

The `<version>` is the Maven artifact version for {PRODUCT} currently used in your project (for example, {MAVEN_ARTIFACT_VERSION}).

ifdef::DM,PAM[]
[NOTE]
====
Instead of specifying a {PRODUCT} `<version>` for individual dependencies, consider adding the {PRODUCT_BA} bill of materials (BOM) dependency to your project `pom.xml` file. The {PRODUCT_BA} BOM applies to both {PRODUCT_DM} and {PRODUCT_PAM}. 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:

[source,xml,subs="attributes+"]
----
<dependency>
  <groupId>com.redhat.ba</groupId>
  <artifactId>ba-platform-bom</artifactId>
  <version>{BOM_VERSION}</version>
  <scope>import</scope>
  <type>pom</type>
</dependency>
----

For more information about the {PRODUCT_BA} BOM, see
ifdef::PAM[]
https://access.redhat.com/solutions/3405361[What is the mapping between RHPAM product and maven library version?].
endif::[]
ifdef::DM[]
https://access.redhat.com/solutions/3363991[What is the mapping between RHDM product and maven library version?].
endif::[]
====
endif::DM,PAM[]
